/* ============================================
   黔礼相遇·青春贵阳 — 学生艺术档案袋
   Design System: 纸本档案 · 墨韵
   ============================================ */

/* ---- Design Tokens ---- */
:root {
  /* Paper & Ink */
  --paper:        #EEE9E3;
  --paper-light:  #F5F1EB;
  --paper-white:  #FAF8F5;
  --ink:          #1B3254;
  --ink-light:    #2D4566;
  --ink-soft:     #4A6670;
  --ink-mute:     #7A8A99;
  --line:         #D9D3CC;
  --line-soft:    #E5E0D9;

  /* Accents — 黔地金 / 赭石 / 苗银 */
  --gold:         #C8893E;
  --gold-soft:    #E8C896;
  --gold-bg:      #FBF3E6;
  --terracotta:   #B85C3B;
  --terra-soft:   #E8B8A3;
  --terra-bg:     #FBEEE6;
  --silver:       #8B9DAE;

  /* Six Phases */
  --p1: #5B8FA8;  --p1-bg: #E8F0F4;  /* 入项探索 — sky blue */
  --p2: #C8893E;  --p2-bg: #FBF3E6;  /* 知识建构 — gold */
  --p3: #7A9B6E;  --p3-bg: #EFF4EC;  /* 合作创作 — sage */
  --p4: #B85C3B;  --p4-bg: #FBEEE6;  /* 优化作品 — terracotta */
  --p5: #7B5E8E;  --p5-bg: #F2EDF4;  /* 出项展评 — purple */
  --p6: #4A6670;  --p6-bg: #E8EDF0;  /* 反思 — slate */

  /* Status */
  --st-draft:    #8B9DAE;
  --st-pending:  #C8893E;
  --st-revision: #B85C3B;
  --st-archived: #7A9B6E;
  --st-exhibit:  #7B5E8E;
  --st-published:#5B8FA8;

  /* Typography */
  --font-serif: 'Noto Serif SC', 'Songti SC', 'STSong', serif;
  --font-sans:  'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-mono:  'DM Mono', 'JetBrains Mono', 'Courier New', monospace;

  /* Radius */
  --r-sm: 6px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-xl: 24px;
  --r-pill: 999px;

  /* Shadow — paper lift */
  --sh-1: 0 1px 2px rgba(27,50,84,.06), 0 1px 3px rgba(27,50,84,.04);
  --sh-2: 0 2px 8px rgba(27,50,84,.08), 0 1px 3px rgba(27,50,84,.05);
  --sh-3: 0 8px 24px rgba(27,50,84,.10), 0 2px 8px rgba(27,50,84,.06);
  --sh-phone: 0 20px 60px rgba(27,50,84,.18), 0 8px 20px rgba(27,50,84,.10);

  /* Transitions */
  --ease: cubic-bezier(.4, 0, .2, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --t-fast: .18s;
  --t-mid: .3s;
  --t-slow: .5s;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font-family: inherit; font-size: inherit; }
img { max-width: 100%; display: block; }
ul, ol { list-style: none; }

/* ---- Paper Texture ---- */
.paper-bg {
  background-color: var(--paper);
  background-image:
    radial-gradient(circle at 20% 30%, rgba(200,137,62,.025) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(27,50,84,.02) 0%, transparent 50%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.11 0 0 0 0 0.20 0 0 0 0 0.33 0 0 0 0.03 0'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---- Typography ---- */
.t-serif { font-family: var(--font-serif); }
.t-mono  { font-family: var(--font-mono); }
.t-ink   { color: var(--ink); }
.t-soft  { color: var(--ink-soft); }
.t-mute  { color: var(--ink-mute); }
.t-gold  { color: var(--gold); }
.t-terra { color: var(--terracotta); }

/* ---- Components: Card ---- */
.card {
  background: var(--paper-white);
  border-radius: var(--r-md);
  box-shadow: var(--sh-1);
  border: 1px solid var(--line-soft);
  transition: box-shadow var(--t-mid) var(--ease), transform var(--t-mid) var(--ease);
}
.card:hover { box-shadow: var(--sh-2); }
.card-pad { padding: 16px; }

/* ---- Components: Button ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--r-sm);
  font-size: 14px;
  font-weight: 500;
  transition: all var(--t-fast) var(--ease);
  white-space: nowrap;
}
.btn-primary {
  background: var(--ink);
  color: var(--paper-white);
}
.btn-primary:hover { background: var(--ink-light); transform: translateY(-1px); box-shadow: var(--sh-2); }
.btn-gold {
  background: var(--gold);
  color: #fff;
}
.btn-gold:hover { background: #B57A35; transform: translateY(-1px); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn-ghost:hover { background: var(--paper-light); border-color: var(--ink-mute); }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 15px; }
.btn-block { width: 100%; }

/* ---- Components: Badge ---- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
}
.badge-draft    { background: #E8EDF0; color: var(--st-draft); }
.badge-pending  { background: var(--gold-bg); color: var(--st-pending); }
.badge-revision { background: var(--terra-bg); color: var(--st-revision); }
.badge-archived { background: #EFF4EC; color: var(--st-archived); }
.badge-exhibit  { background: var(--p5-bg); color: var(--st-exhibit); }
.badge-published{ background: var(--p1-bg); color: var(--st-published); }

/* Phase badge */
.pbadge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: 500;
}
.pbadge .dot { width: 6px; height: 6px; border-radius: 50%; }
.pb1 { background: var(--p1-bg); color: var(--p1); } .pb1 .dot { background: var(--p1); }
.pb2 { background: var(--p2-bg); color: var(--p2); } .pb2 .dot { background: var(--p2); }
.pb3 { background: var(--p3-bg); color: var(--p3); } .pb3 .dot { background: var(--p3); }
.pb4 { background: var(--p4-bg); color: var(--p4); } .pb4 .dot { background: var(--p4); }
.pb5 { background: var(--p5-bg); color: var(--p5); } .pb5 .dot { background: var(--p5); }
.pb6 { background: var(--p6-bg); color: var(--p6); } .pb6 .dot { background: var(--p6); }

/* ---- Components: Progress ---- */
.progress-track {
  height: 6px;
  background: var(--line-soft);
  border-radius: var(--r-pill);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: var(--r-pill);
  transition: width .8s var(--ease-out);
}

/* ---- Components: Avatar ---- */
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--p1-bg);
  color: var(--p1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
}
.avatar-sm { width: 28px; height: 28px; font-size: 11px; }
.avatar-lg { width: 48px; height: 48px; font-size: 16px; }

/* ---- Components: Input ---- */
.input, .textarea, .select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--paper-white);
  color: var(--ink);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.input:focus, .textarea:focus, .select:focus {
  outline: none;
  border-color: var(--ink-soft);
  box-shadow: 0 0 0 3px rgba(74,102,112,.1);
}
.textarea { resize: vertical; min-height: 80px; line-height: 1.6; }
.label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 6px;
}
.label .req { color: var(--terracotta); }

/* ---- Components: Chip/Tag ---- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: var(--r-pill);
  font-size: 12px;
  background: var(--paper-light);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  transition: all var(--t-fast);
  cursor: pointer;
}
.chip:hover { border-color: var(--ink-mute); }
.chip.active {
  background: var(--ink);
  color: var(--paper-white);
  border-color: var(--ink);
}

/* ---- Phone Frame ---- */
.phone-frame {
  width: 390px;
  height: 844px;
  background: var(--paper);
  border-radius: 44px;
  box-shadow: var(--sh-phone);
  border: 8px solid #1a1a2e;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}
.phone-notch {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 28px;
  background: #1a1a2e;
  border-radius: 0 0 18px 18px;
  z-index: 100;
}
.phone-status {
  height: 44px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 0 28px 6px;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
}
.phone-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
}
.phone-content::-webkit-scrollbar { width: 0; }

/* Screen container — one visible at a time */
.screen { display: none; }
.screen.active { display: block; animation: screenIn .3s var(--ease-out); }

@keyframes screenIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---- Bottom Nav (Mobile) ---- */
.bottom-nav {
  height: 64px;
  display: flex;
  background: var(--paper-white);
  border-top: 1px solid var(--line-soft);
  flex-shrink: 0;
}
.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 10px;
  color: var(--ink-mute);
  transition: color var(--t-fast);
  position: relative;
}
.nav-item .nav-ico { font-size: 20px; line-height: 1; }
.nav-item.active { color: var(--ink); font-weight: 600; }
.nav-item.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 28px;
  height: 3px;
  background: var(--gold);
  border-radius: 0 0 3px 3px;
}

/* ---- Desktop Frame ---- */
.desktop-frame {
  width: 100%;
  max-width: 1280px;
  height: 800px;
  background: var(--paper-white);
  border-radius: 16px;
  box-shadow: var(--sh-3);
  border: 1px solid var(--line);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.desktop-titlebar {
  height: 40px;
  background: #E8E3DC;
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 8px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--line);
}
.desktop-titlebar .dot-r { width: 12px; height: 12px; border-radius: 50%; background: #FF5F57; }
.desktop-titlebar .dot-y { width: 12px; height: 12px; border-radius: 50%; background: #FEBC2E; }
.desktop-titlebar .dot-g { width: 12px; height: 12px; border-radius: 50%; background: #28C840; }
.desktop-titlebar .url-bar {
  flex: 1;
  max-width: 400px;
  margin: 0 auto;
  height: 24px;
  background: var(--paper-white);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--ink-mute);
  font-family: var(--font-mono);
}
.desktop-body {
  flex: 1;
  display: flex;
  overflow: hidden;
}

/* ---- Sidebar (Desktop) ---- */
.sidebar {
  width: 220px;
  background: var(--paper);
  border-right: 1px solid var(--line-soft);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
}
.sidebar-brand {
  padding: 20px 18px 16px;
  border-bottom: 1px solid var(--line-soft);
}
.sidebar-brand .logo {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
}
.sidebar-brand .sub {
  font-size: 10px;
  color: var(--ink-mute);
  margin-top: 2px;
}
.sidebar-nav { padding: 10px 8px; flex: 1; }
.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  font-size: 13px;
  color: var(--ink-soft);
  transition: all var(--t-fast);
  margin-bottom: 2px;
  cursor: pointer;
}
.sidebar-nav .nav-link:hover { background: var(--paper-light); color: var(--ink); }
.sidebar-nav .nav-link.active {
  background: var(--ink);
  color: var(--paper-white);
  font-weight: 500;
}
.sidebar-nav .nav-link .ico { font-size: 16px; width: 20px; text-align: center; }
.sidebar-nav .nav-section {
  font-size: 10px;
  font-weight: 600;
  color: var(--ink-mute);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 16px 12px 6px;
}

/* ---- Desktop Main ---- */
.desktop-main {
  flex: 1;
  overflow-y: auto;
  background: var(--paper);
}
.desktop-main::-webkit-scrollbar { width: 6px; }
.desktop-main::-webkit-scrollbar-track { background: transparent; }
.desktop-main::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }

/* ---- Utility ---- */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.flex-1 { flex: 1; }
.flex-wrap { flex-wrap: wrap; }
.text-c { text-align: center; }
.text-r { text-align: right; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.p-3 { padding: 12px; }
.p-4 { padding: 16px; }
.hidden { display: none !important; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- Section Title ---- */
.sec-title {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
}
.sec-title .bar {
  width: 3px;
  height: 14px;
  background: var(--gold);
  border-radius: 2px;
}

/* ---- Animations ---- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fadeUp .5s var(--ease-out) both; }
.delay-1 { animation-delay: .05s; }
.delay-2 { animation-delay: .1s; }
.delay-3 { animation-delay: .15s; }
.delay-4 { animation-delay: .2s; }
.delay-5 { animation-delay: .25s; }
.delay-6 { animation-delay: .3s; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .5; }
}
.pulse { animation: pulse 2s ease-in-out infinite; }

@keyframes spin {
  to { transform: rotate(360deg); }
}
.spin { animation: spin 1s linear infinite; }

/* ---- Toast ---- */
.toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--paper-white);
  padding: 10px 24px;
  border-radius: var(--r-pill);
  font-size: 13px;
  z-index: 9999;
  animation: toastIn .3s var(--ease-out);
  box-shadow: var(--sh-3);
}
@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 20px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

/* ---- Scrollbar (global thin) ---- */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--ink-mute); }
