/* ========================================
   文件中转站 — Complete Redesign
   ======================================== */

:root {
  --bg: #f5f0e8;
  --bg-deep: #ebe5db;
  --surface: #fffcf7;
  --surface-glass: rgba(255, 252, 247, 0.82);
  --text: #1a1714;
  --text-secondary: #7a7168;
  --border: rgba(26, 23, 20, 0.08);
  --border-strong: rgba(26, 23, 20, 0.14);
  --accent: #c96d31;
  --accent-hover: #b35a22;
  --accent-soft: rgba(201, 109, 49, 0.1);
  --success: #2d7a50;
  --error: #b83b3b;
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 28px;
  --shadow-sm: 0 2px 8px rgba(62, 35, 11, 0.06);
  --shadow-md: 0 8px 32px rgba(62, 35, 11, 0.1);
  --shadow-lg: 0 24px 64px rgba(62, 35, 11, 0.14);
}

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

body {
  font-family: "Noto Sans SC", "DM Sans", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3 {
  font-family: "DM Sans", "Noto Sans SC", sans-serif;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

button, input {
  font: inherit;
  color: inherit;
}

/* ========================================
   Page System — full viewport, stacked
   ======================================== */

.page {
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
}

.hidden {
  display: none !important;
}

/* ========================================
   LOGIN PAGE
   ======================================== */

.page-auth {
  display: grid;
  place-items: center;
  padding: 24px;
  position: relative;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(201, 109, 49, 0.08), transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(160, 120, 80, 0.06), transparent 50%),
    linear-gradient(170deg, #faf6ef 0%, var(--bg) 50%, var(--bg-deep) 100%);
}

/* Floating orbs for atmosphere */
.auth-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.auth-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
}

.auth-orb--1 {
  width: 500px;
  height: 500px;
  background: rgba(201, 109, 49, 0.15);
  top: -10%;
  right: -5%;
  animation: float-1 20s ease-in-out infinite;
}

.auth-orb--2 {
  width: 400px;
  height: 400px;
  background: rgba(120, 140, 100, 0.12);
  bottom: -8%;
  left: -5%;
  animation: float-2 25s ease-in-out infinite;
}

.auth-orb--3 {
  width: 300px;
  height: 300px;
  background: rgba(180, 140, 90, 0.1);
  top: 40%;
  left: 50%;
  animation: float-3 18s ease-in-out infinite;
}

@keyframes float-1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-40px, 30px) scale(1.05); }
}

@keyframes float-2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(30px, -40px) scale(1.08); }
}

@keyframes float-3 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-20px, -30px) scale(0.95); }
}

/* Auth Card */
.auth-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 48px 40px;
  animation: card-enter 600ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes card-enter {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.auth-header {
  text-align: center;
  margin-bottom: 36px;
}

.tag {
  display: inline-block;
  padding: 5px 14px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 20px;
}

.auth-header h1 {
  font-size: clamp(28px, 6vw, 36px);
  margin-bottom: 10px;
}

.auth-desc {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
}

/* Form */
.auth-form {
  display: grid;
  gap: 20px;
}

.field {
  display: grid;
  gap: 8px;
}

.field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.7);
  font-size: 15px;
  outline: none;
  transition: border-color 200ms, box-shadow 200ms;
}

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

input::placeholder {
  color: rgba(122, 113, 104, 0.5);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 180ms ease;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(201, 109, 49, 0.2);
}

.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 16px rgba(201, 109, 49, 0.3);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(201, 109, 49, 0.2);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-strong);
}

.btn-ghost:hover {
  background: rgba(26, 23, 20, 0.04);
  color: var(--text);
  border-color: var(--border-strong);
}

.btn-danger {
  background: transparent;
  color: var(--error);
  border: 1px solid rgba(184, 59, 59, 0.2);
}

.btn-danger:hover {
  background: rgba(184, 59, 59, 0.08);
  border-color: rgba(184, 59, 59, 0.3);
}

.btn-full {
  width: 100%;
}

.auth-hint {
  text-align: center;
  font-size: 12px;
  color: var(--text-secondary);
  opacity: 0.7;
}

/* Messages */
.msg {
  min-height: 20px;
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  color: var(--success);
  transition: color 200ms;
}

.msg.error {
  color: var(--error);
}

/* ========================================
   WORKSPACE PAGE
   ======================================== */

.page-app {
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(201, 109, 49, 0.04), transparent 50%),
    var(--bg);
}

/* Navbar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px clamp(20px, 4vw, 48px);
  background: rgba(245, 240, 232, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.navbar-brand .tag {
  margin-bottom: 0;
}

.navbar-brand h2 {
  font-size: clamp(18px, 3vw, 24px);
}

.navbar-end {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar {
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-hover);
  font-size: 13px;
  font-weight: 600;
}

/* Workspace Content */
.workspace {
  flex: 1;
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  padding: 32px clamp(20px, 4vw, 48px) 64px;
  display: grid;
  gap: 28px;
  align-content: start;
}

/* Upload Zone */
.upload-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  padding: 48px 32px;
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, rgba(255, 252, 247, 0.6), rgba(245, 240, 232, 0.4));
  transition: all 250ms ease;
  cursor: default;
}

.upload-zone.is-active {
  border-color: var(--accent);
  background:
    linear-gradient(135deg, rgba(201, 109, 49, 0.06), rgba(201, 109, 49, 0.02));
  transform: scale(0.995);
}

.upload-icon {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 4px;
}

.upload-title {
  font-size: 17px;
  font-weight: 600;
}

.upload-sub {
  font-size: 13px;
  color: var(--text-secondary);
}

.upload-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

/* Progress Bar */
.progress-bar {
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: 13px;
}

.progress-name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 70%;
}

.progress-pct {
  color: var(--accent);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.progress-track {
  height: 6px;
  background: rgba(26, 23, 20, 0.06);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 150ms ease;
}

/* Files Section */
.files-section {
  display: grid;
  gap: 16px;
}

.files-header h3 {
  font-size: 20px;
  letter-spacing: -0.01em;
}

.files-list {
  display: grid;
  gap: 10px;
}

.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: all 180ms ease;
}

.file-item:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.file-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.file-name {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  word-break: break-all;
}

.file-meta {
  margin: 0;
  font-size: 12px;
  color: var(--text-secondary);
}

.file-empty {
  padding: 48px 24px;
  text-align: center;
  color: var(--text-secondary);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.file-empty p {
  margin: 0 0 4px;
  font-weight: 500;
}

.file-empty span {
  font-size: 13px;
  opacity: 0.7;
}

.download-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: all 180ms ease;
}

.download-link:hover {
  background: var(--accent-hover);
  box-shadow: 0 2px 8px rgba(201, 109, 49, 0.25);
}

.btn-sm {
  padding: 9px 18px;
  font-size: 13px;
}

/* ========================================
   Page Transition
   ======================================== */

.page-app {
  animation: page-in 500ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes page-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ========================================
   Responsive
   ======================================== */

@media (max-width: 640px) {
  .auth-card {
    padding: 36px 28px;
    border-radius: 22px;
  }

  .auth-header {
    margin-bottom: 28px;
  }

  .auth-header h1 {
    font-size: 28px;
  }

  .page-auth {
    padding: 16px;
  }

  .navbar {
    flex-wrap: wrap;
    gap: 12px;
    padding: 14px 16px;
  }

  .navbar-brand .tag {
    display: none;
  }

  .workspace {
    padding: 24px 16px 48px;
    gap: 24px;
  }

  .upload-zone {
    padding: 36px 20px;
  }

  .upload-actions {
    flex-direction: column;
    width: 100%;
  }

  .upload-actions .btn {
    width: 100%;
  }

  .file-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .file-actions {
    width: 100%;
  }

  .file-actions .download-link,
  .file-actions .btn-danger {
    flex: 1;
    text-align: center;
  }
}

@media (max-width: 380px) {
  .auth-card {
    padding: 28px 20px;
  }

  .auth-header h1 {
    font-size: 24px;
  }

  .navbar-end {
    flex-wrap: wrap;
  }
}
