/* 童蒙云 · 基础设计系统
   设计方向：东方、温暖、克制。用纸张质感承载数据，不用冷冰冰的“后台蓝”。 */
:root {
  --paper: #f6f2e9;
  --paper-2: #efe9dc;
  --surface: #fffdf8;
  --surface-2: #fbf8f0;
  --ink: #1e2a24;
  --ink-2: #35443b;
  --muted: #7b877f;
  --muted-2: #9aa39d;
  --line: #e5dfd2;
  --line-2: #efeae0;
  --green: #1e5b45;
  --green-deep: #123d2e;
  --green-soft: #e8f0e9;
  --green-mid: #5c8d76;
  --coral: #d97757;
  --coral-soft: #fbede7;
  --gold: #c39843;
  --gold-soft: #f8f0dc;
  --blue: #5c7fa3;
  --blue-soft: #eaf0f6;
  --red: #bb4d45;
  --red-soft: #fbeae8;
  --shadow-sm: 0 1px 2px rgba(30, 42, 36, 0.04), 0 6px 18px rgba(30, 42, 36, 0.035);
  --shadow: 0 2px 4px rgba(30, 42, 36, 0.03), 0 18px 44px rgba(30, 42, 36, 0.07);
  --shadow-lg: 0 30px 80px rgba(18, 61, 46, 0.16);
  --radius: 18px;
  --radius-sm: 12px;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --serif: "Songti SC", "STSong", "Noto Serif SC", "SimSun", serif;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  font-size: 14px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: #1e5b4530; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img, svg { display: block; max-width: 100%; }
h1, h2, h3, h4, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
table { border-collapse: collapse; width: 100%; }
input, textarea, select { outline: none; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }

.container { width: min(1240px, calc(100% - 64px)); margin: 0 auto; }
.serif { font-family: var(--serif); }
.muted { color: var(--muted); }
.tiny { font-size: 12px; }
.small { font-size: 13px; }
.strong { font-weight: 650; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: var(--green);
  color: #fff;
  font-weight: 600;
  font-size: 13.5px;
  line-height: 1;
  transition: transform .2s var(--ease), background .2s, box-shadow .2s, border-color .2s;
  white-space: nowrap;
}
.btn:hover { background: var(--green-deep); transform: translateY(-1px); box-shadow: 0 8px 18px rgba(30, 91, 69, .18); }
.btn:active { transform: translateY(0); }
.btn.secondary { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn.secondary:hover { border-color: #cfc6b6; background: #fff; box-shadow: var(--shadow-sm); }
.btn.ghost { background: transparent; color: var(--ink-2); border-color: transparent; }
.btn.ghost:hover { background: rgba(30, 42, 36, .05); box-shadow: none; }
.btn.coral { background: var(--coral); }
.btn.coral:hover { background: #c96748; }
.btn.danger { background: var(--red); }
.btn.sm { min-height: 32px; padding: 0 12px; font-size: 12.5px; border-radius: 8px; }
.btn.lg { min-height: 50px; padding: 0 24px; border-radius: 12px; font-size: 15px; }
.btn.icon-only { width: 40px; padding: 0; }
.btn:disabled { opacity: .55; pointer-events: none; }

.input, .select, .textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  min-height: 40px;
  padding: 8px 12px;
  color: var(--ink);
  font-size: 13.5px;
  transition: border-color .2s, box-shadow .2s;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--green-mid); box-shadow: 0 0 0 3px #1e5b4512; }
.input::placeholder, .textarea::placeholder { color: #aab1ab; }
.textarea { min-height: 110px; resize: vertical; line-height: 1.7; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%237b877f' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-size: 12.5px; font-weight: 650; color: var(--ink-2); }
.field .hint { font-size: 11.5px; color: var(--muted); }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 20px 22px 0; }
.card-title { font-size: 15px; font-weight: 700; letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; }
.card-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.card-body { padding: 18px 22px 22px; }
.card-link { font-size: 12.5px; color: var(--green); font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.card-link:hover { text-decoration: underline; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 23px;
  padding: 0 9px;
  border-radius: 99px;
  background: var(--paper-2);
  color: var(--ink-2);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}
.pill.green { background: var(--green-soft); color: var(--green); }
.pill.coral { background: var(--coral-soft); color: #b45b3d; }
.pill.gold { background: var(--gold-soft); color: #916a20; }
.pill.blue { background: var(--blue-soft); color: #496d92; }
.pill.red { background: var(--red-soft); color: var(--red); }
.pill.gray { background: #f0eee8; color: var(--muted); }
.pill .dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 13px; flex: none;
  letter-spacing: -.02em;
}
.avatar.sm { width: 28px; height: 28px; font-size: 11px; }
.avatar.lg { width: 56px; height: 56px; font-size: 18px; }
.avatar.xl { width: 76px; height: 76px; font-size: 24px; }
.avatar-stack { display: flex; }
.avatar-stack .avatar { border: 2px solid var(--surface); margin-left: -8px; }
.avatar-stack .avatar:first-child { margin-left: 0; }

.toast-wrap { position: fixed; z-index: 2000; top: 22px; right: 22px; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.toast {
  display: flex; align-items: flex-start; gap: 10px;
  min-width: 280px; max-width: 380px;
  background: #1f2d26; color: #fff;
  padding: 13px 15px; border-radius: 12px;
  box-shadow: 0 18px 42px rgba(0,0,0,.24);
  font-size: 13px;
  animation: toast-in .28s var(--ease);
  pointer-events: auto;
}
.toast.success { background: #1e5b45; }
.toast.error { background: #9d423b; }
.toast .toast-icon { flex: none; margin-top: 1px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px) scale(.98); } }

.modal-backdrop {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(18, 31, 25, .48);
  backdrop-filter: blur(5px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  animation: fade-in .18s ease;
}
.modal {
  width: min(640px, 100%);
  max-height: min(88vh, 920px);
  background: var(--surface);
  border-radius: 20px;
  box-shadow: 0 40px 120px rgba(0,0,0,.3);
  display: flex; flex-direction: column;
  overflow: hidden;
  animation: modal-in .24s var(--ease);
}
.modal.wide { width: min(900px, 100%); }
.modal.narrow { width: min(480px, 100%); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 22px 24px 14px; border-bottom: 1px solid var(--line-2); }
.modal-head h3 { font-size: 18px; letter-spacing: -.02em; }
.modal-head p { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.modal-body { padding: 22px 24px; overflow: auto; }
.modal-foot { padding: 14px 24px 20px; border-top: 1px solid var(--line-2); display: flex; justify-content: flex-end; gap: 10px; background: var(--surface-2); }
.modal-close { width: 32px; height: 32px; border-radius: 8px; border: 0; background: transparent; color: var(--muted); display: grid; place-items: center; }
.modal-close:hover { background: var(--paper-2); color: var(--ink); }
@keyframes modal-in { from { opacity: 0; transform: translateY(14px) scale(.985); } }
@keyframes fade-in { from { opacity: 0; } }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
.divider { height: 1px; background: var(--line-2); margin: 18px 0; }
.section-label { font-size: 11px; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; color: var(--muted-2); }

.empty { text-align: center; padding: 48px 24px; color: var(--muted); }
.empty .empty-icon { width: 54px; height: 54px; margin: 0 auto 12px; border-radius: 16px; background: var(--paper-2); display: grid; place-items: center; color: var(--muted-2); }

.skeleton { position: relative; overflow: hidden; background: #ece7dc; border-radius: 8px; }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent); animation: shimmer 1.4s infinite; }
@keyframes shimmer { 100% { transform: translateX(100%); } }

.scroll-x { overflow-x: auto; scrollbar-width: thin; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #d5cfc2; border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

@media (max-width: 720px) {
  .container { width: min(100% - 36px, 1240px); }
  .form-grid { grid-template-columns: 1fr; }
  .modal-backdrop { padding: 10px; align-items: flex-end; }
  .modal { max-height: 92vh; border-radius: 18px 18px 0 0; }
}
