*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family:
    "Inter",
    "SF Pro Display",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    sans-serif;
  background: #f0f2f5;
  color: #2d3748;
  line-height: 1.6;
  padding: 0 1.5rem 2rem;
  max-width: 900px;
  margin: 0 auto;
}

/* ---------- Header ---------- */

.site-header {
  text-align: center;
  padding: 1.5rem 0 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid #e2e8f0;
}

.site-logo {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #1e293b;
  text-decoration: none;
}

.site-logo:hover {
  color: #3b82f6;
  text-decoration: none;
}

/* ---------- Headings ---------- */

h1 {
  margin-bottom: 1.2rem;
  font-weight: 700;
  font-size: 1.5rem;
  color: #1a202c;
}

h2 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 0.8rem;
}

a {
  color: #3b82f6;
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

.card {
  background: #fff;
  border-radius: 12px;
  padding: 2rem;
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.06),
    0 4px 12px rgba(0, 0, 0, 0.04);
  margin-bottom: 1.5rem;
}

/* ---------- Upload form ---------- */

.upload-form label {
  display: block;
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #94a3b8;
  margin-bottom: 0.25rem;
}

.upload-form select {
  font-size: 0.85rem;
  padding: 0.3rem 0.5rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #fff;
  color: #64748b;
}

.upload-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.priority-picker {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.priority-picker label {
  margin-bottom: 0;
  font-size: 0.75rem;
}

/* ---------- Dropzone ---------- */

.dropzone {
  border: 2px dashed #cbd5e1;
  border-radius: 10px;
  padding: 2.5rem 1rem;
  text-align: center;
  cursor: pointer;
  transition:
    border-color 0.2s,
    background 0.2s;
  margin-bottom: 1.25rem;
  position: relative;
}

.dropzone:hover,
.dropzone.drag-over {
  border-color: #3b82f6;
  background: #eff6ff;
}

.dropzone.has-file {
  border-color: #22c55e;
  background: #f0fdf4;
}

.dropzone input[type="file"] {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}

.dropzone-text {
  font-size: 0.95rem;
  color: #94a3b8;
  pointer-events: none;
}

/* ---------- File status ---------- */

.file-status {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.9rem;
  margin-bottom: 1.25rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.9rem;
}

.file-status #file-name {
  font-weight: 600;
  color: #1e293b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-status #file-size {
  color: #64748b;
  flex-shrink: 0;
}

/* ---------- Progress bar ---------- */

.progress-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.progress-bar {
  flex: 1;
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: #3b82f6;
  border-radius: 4px;
  transition: width 0.15s ease;
}

.progress-text {
  font-size: 0.85rem;
  font-weight: 600;
  color: #64748b;
  min-width: 3rem;
  text-align: right;
}

/* ---------- Buttons ---------- */

button,
.btn {
  display: inline-block;
  padding: 0.55rem 1.3rem;
  border: none;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  background: #3b82f6;
  color: #fff;
  transition:
    background 0.15s,
    transform 0.1s;
  text-decoration: none;
}
button:hover,
.btn:hover {
  background: #2563eb;
  text-decoration: none;
}
button:active,
.btn:active {
  transform: scale(0.98);
}

.btn-neutral {
  background: #e2e8f0;
  color: #334155;
}
.btn-neutral:hover {
  background: #cbd5e1;
}

.btn-danger {
  background: #ef4444;
}
.btn-danger:hover {
  background: #dc2626;
}

.btn-sm {
  padding: 0.3rem 0.7rem;
  font-size: 0.85rem;
}

.btn-copy {
  padding: 0.45rem 1rem;
  flex-shrink: 0;
}

/* ---------- Detail actions ---------- */

.detail-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

/* ---------- Share result ---------- */

.share-result {
  margin-top: 1.5rem;
  padding: 1.2rem;
  border-radius: 8px;
  word-break: break-all;
}

.share-result.success {
  background: #f0fdf4;
  border-left: 4px solid #22c55e;
}

.share-result.error {
  background: #fef2f2;
  border-left: 4px solid #ef4444;
}

.share-result p {
  margin-bottom: 0.4rem;
}

.share-result .hint {
  color: #64748b;
  font-size: 0.85rem;
  margin-top: 0.4rem;
  margin-bottom: 0;
}

.share-result .warning {
  color: #dc2626;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0;
}

.copy-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.5rem 0;
}

.share-url-link {
  flex: 1;
  padding: 0.45rem 0.7rem;
  font-size: 0.9rem;
  font-family: "SF Mono", "Fira Code", "Consolas", monospace;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  color: #3b82f6;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-decoration: none;
}

.share-url-link:hover {
  text-decoration: underline;
}

/* ---------- Stats grid ---------- */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: #fff;
  border-radius: 12px;
  padding: 1rem 1.2rem;
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.06),
    0 4px 12px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.stat-value {
  font-size: 1.4rem;
  font-weight: 700;
  color: #1a202c;
}

.stat-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #94a3b8;
}

.stat-bar {
  height: 6px;
  background: #e2e8f0;
  border-radius: 3px;
  overflow: hidden;
  margin-top: 0.4rem;
}

.stat-bar-fill {
  height: 100%;
  background: #3b82f6;
  border-radius: 3px;
  transition: width 0.3s ease;
}

/* ---------- Table ---------- */

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th,
td {
  text-align: left;
  padding: 0.65rem 0.8rem;
  border-bottom: 1px solid #e2e8f0;
}

th {
  background: #f8fafc;
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #64748b;
}

tr:hover {
  background: #f8fafc;
}

.actions-cell {
  display: flex;
  gap: 0.25rem;
  align-items: center;
  white-space: nowrap;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  font-size: 1.1rem;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 4px;
  text-decoration: none;
  transition: background 0.15s;
  padding: 0;
  line-height: 1;
}

.icon-btn:hover {
  background: #e2e8f0;
  text-decoration: none;
}

.icon-btn-danger:hover {
  background: #fee2e2;
}

/* ---------- Download / detail page ---------- */

.file-info {
  margin-bottom: 0.5rem;
}
.file-info span {
  font-weight: 600;
}

/* ---------- Preview: images ---------- */

.preview-card {
  overflow: hidden;
}

.image-preview {
  display: block;
}

.image-preview img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  cursor: pointer;
}

/* ---------- Preview: video ---------- */

.video-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #0f172a;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-play-btn {
  font-size: 1.1rem;
  padding: 0.8rem 2rem;
  z-index: 1;
}

.video-player {
  width: 100%;
  height: 100%;
  border-radius: 8px;
}

/* ---------- Preview: markdown ---------- */

.md-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 1rem;
  border-bottom: 2px solid #e2e8f0;
}

.md-tab {
  background: none;
  color: #64748b;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 0.4rem 1rem;
  margin-bottom: -2px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s;
}

.md-tab:hover {
  color: #334155;
  background: none;
}

.md-tab.active {
  color: #3b82f6;
  border-bottom-color: #3b82f6;
  background: none;
}

.md-rendered {
  line-height: 1.7;
}

.md-rendered h1,
.md-rendered h2,
.md-rendered h3 {
  margin: 1rem 0 0.5rem;
}

.md-rendered p {
  margin-bottom: 0.6rem;
}

.md-rendered pre {
  background: #f1f5f9;
  padding: 0.8rem;
  border-radius: 6px;
  overflow-x: auto;
  font-size: 0.85rem;
}

.md-rendered code {
  font-family: "SF Mono", "Fira Code", "Consolas", monospace;
  font-size: 0.85em;
  background: #f1f5f9;
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
}

.md-rendered pre code {
  background: none;
  padding: 0;
}

.md-content pre {
  background: #f8fafc;
  padding: 1rem;
  border-radius: 6px;
  overflow-x: auto;
  font-size: 0.85rem;
  white-space: pre-wrap;
  word-wrap: break-word;
}
