/* =========================================================================
   FileNest 设计系统  v2.0
   品牌：薄荷绿 #5ed29c / 墨黑 #070b0a / 深绿 #0f3b2c
   原则：信息密度优先、层级靠留白与字号、动效克制（≤180ms）
   ========================================================================= */

:root {
  --mint: #5ed29c;
  --mint-600: #35b87d;
  --mint-700: #1f9663;
  --mint-soft: rgba(94, 210, 156, .14);
  --ink: #070b0a;
  --deep: #0f3b2c;

  --bg: #f5f7f6;
  --surface: #ffffff;
  --surface-2: #fafbfa;
  --surface-3: #eff2f0;
  --border: #e3e8e5;
  --border-strong: #cfd8d3;
  --text: #0f1714;
  --text-2: #43524b;
  --muted: #7b8a83;
  --accent: var(--mint-700);
  --accent-soft: rgba(31, 150, 99, .1);
  --danger: #d64545;
  --danger-soft: rgba(214, 69, 69, .1);
  --warn: #b7791f;
  --warn-soft: rgba(183, 121, 31, .12);
  --info: #2b6cb0;
  --shadow-sm: 0 1px 2px rgba(15, 23, 20, .05);
  --shadow-md: 0 4px 16px -6px rgba(15, 23, 20, .14);
  --shadow-lg: 0 24px 60px -24px rgba(15, 23, 20, .28);
  --radius: 10px;
  --radius-lg: 16px;
  --sidebar-w: 268px;
  --topbar-h: 60px;
  --font: "Inter", "HarmonyOS Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  --ease: cubic-bezier(.2, .7, .3, 1);
}

[data-theme="dark"] {
  --bg: #070b0a;
  --surface: #0d1412;
  --surface-2: #101917;
  --surface-3: #16211d;
  --border: #1e2b26;
  --border-strong: #2b3a34;
  --text: #e9f1ed;
  --text-2: #b3c2bb;
  --muted: #819890;
  --accent: var(--mint);
  --accent-soft: rgba(94, 210, 156, .12);
  --danger: #f2777a;
  --danger-soft: rgba(242, 119, 122, .12);
  --warn: #e2b04a;
  --warn-soft: rgba(226, 176, 74, .12);
  --info: #7ab6e8;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .6);
  --shadow-md: 0 6px 22px -8px rgba(0, 0, 0, .7);
  --shadow-lg: 0 30px 70px -30px rgba(0, 0, 0, .85);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -.015em; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--mint-600); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--mint-soft); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 10px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------------------------------------------------------------- Logo */
.logo { display: inline-flex; align-items: center; gap: 9px; font-weight: 700; letter-spacing: -.02em; }
.logo__mark {
  width: 22px; height: 22px; border-radius: 7px; flex: none;
  background: linear-gradient(145deg, var(--mint) 0%, var(--mint-700) 100%);
  position: relative; box-shadow: 0 2px 8px rgba(94, 210, 156, .35);
}
.logo__mark::after {
  content: ""; position: absolute; inset: 6px 6px auto 6px; height: 2px; border-radius: 2px;
  background: rgba(7, 11, 10, .55); box-shadow: 0 4px 0 rgba(7, 11, 10, .55), 0 8px 0 rgba(7, 11, 10, .3);
}
.logo--lg .logo__mark { width: 30px; height: 30px; border-radius: 9px; }
.logo--lg .logo__mark::after { inset: 8px 8px auto 8px; box-shadow: 0 5px 0 rgba(7,11,10,.55), 0 10px 0 rgba(7,11,10,.3); }
.logo--lg .logo__text { font-size: 19px; }

/* ---------------------------------------------------------------- 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 14px; border-radius: 9px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font-size: 13.5px; font-weight: 550; white-space: nowrap;
  transition: background .16s var(--ease), border-color .16s var(--ease), transform .12s var(--ease), box-shadow .16s;
}
.btn:hover { background: var(--surface-3); }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--accent); border-color: transparent; color: #04120c; font-weight: 650; }
[data-theme="dark"] .btn--primary { color: #04120c; }
.btn--primary:hover { background: var(--mint-600); box-shadow: 0 6px 18px -8px rgba(53, 184, 125, .8); }
.btn--danger { background: var(--danger); border-color: transparent; color: #fff; font-weight: 600; }
.btn--danger:hover { filter: brightness(1.06); box-shadow: 0 6px 18px -8px rgba(214, 69, 69, .8); }

/* 收藏星标高亮（金色） */
.btn-icon.is-on { color: #f6b73c; }
.btn-icon.is-on:hover { background: color-mix(in srgb, #f6b73c 16%, transparent); }
/* 危险类图标按钮 */
.btn-icon--danger { color: var(--danger); }
.btn-icon--danger:hover { background: var(--danger-soft); }
.btn--ghost { border-color: transparent; background: transparent; }
.btn--ghost:hover { background: var(--surface-3); }
.btn--block { width: 100%; height: 42px; }
.btn--sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn[disabled] { opacity: .55; pointer-events: none; }
.btn .spinner { width: 14px; height: 14px; border-width: 2px; }

.btn-icon {
  width: 34px; height: 34px; display: inline-grid; place-items: center;
  border-radius: 9px; border: 1px solid transparent; background: transparent; color: var(--text-2);
  transition: background .16s, color .16s;
}
.btn-icon:hover { background: var(--surface-3); color: var(--text); }
.btn-icon svg { width: 17px; height: 17px; }

/* ---------------------------------------------------------------- 表单 */
.field { display: block; }
.field__label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.input {
  width: 100%; height: 42px; padding: 0 13px; border-radius: 9px;
  border: 1px solid var(--border-strong); background: var(--surface);
  transition: border-color .16s, box-shadow .16s;
}
.input::placeholder { color: var(--muted); }
.input:focus { outline: none; border-color: var(--mint-600); box-shadow: 0 0 0 3px var(--accent-soft); }
.input-wrap { position: relative; }
.input-affix {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  border: 0; background: transparent; color: var(--muted); font-size: 12px;
  padding: 5px 8px; border-radius: 6px;
}
.input-affix:hover { color: var(--text); background: var(--surface-3); }
.form { display: grid; gap: 16px; }
.form__error {
  display: flex; gap: 8px; align-items: flex-start;
  padding: 10px 12px; border-radius: 9px; font-size: 13px;
  background: var(--danger-soft); color: var(--danger); border: 1px solid rgba(214, 69, 69, .25);
}
.form__error::before { content: "!"; font-weight: 800; }

/* ---------------------------------------------------------------- 通用件 */
.pill {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px;
  border-radius: 999px; font-size: 11.5px; font-weight: 600; letter-spacing: .01em;
  background: var(--surface-3); color: var(--text-2); white-space: nowrap;
}
.pill--mint { background: var(--accent-soft); color: var(--accent); }
.pill--warn { background: var(--warn-soft); color: var(--warn); }
.pill--danger { background: var(--danger-soft); color: var(--danger); }

kbd {
  font-family: var(--mono); font-size: 11px; padding: 1px 5px; border-radius: 5px;
  border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--muted);
}
.spinner {
  display: inline-block; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--border-strong); border-top-color: var(--accent);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.link-muted { color: var(--muted); font-size: 12.5px; }
.link-muted:hover { color: var(--accent); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ================================================================ 登录页 */
.auth-body { background: var(--bg); }
.auth-shell { display: grid; grid-template-columns: 1.05fr .95fr; min-height: 100vh; }
.auth-brand {
  position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between;
  padding: 46px 52px; background: radial-gradient(120% 90% at 8% 0%, #164a37 0%, #0a1713 46%, #070b0a 100%);
  color: #eaf5ef;
}
.auth-brand__glow {
  position: absolute; width: 520px; height: 520px; right: -180px; bottom: -220px; border-radius: 50%;
  background: radial-gradient(circle, rgba(94,210,156,.34) 0%, rgba(94,210,156,0) 68%);
  filter: blur(6px); pointer-events: none;
}
.auth-brand::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(80% 70% at 20% 10%, #000 30%, transparent 100%);
}
.auth-brand__top { position: relative; z-index: 1; }
.auth-brand .logo__text { color: #f2fbf7; }
.auth-brand__tagline { margin-top: 26px; max-width: 22em; font-size: 25px; line-height: 1.42; font-weight: 600; letter-spacing: -.02em; color: #dff3e9; }
.auth-brand__facts { position: relative; z-index: 1; display: flex; gap: 40px; }
.fact { display: flex; flex-direction: column; gap: 2px; }
.fact__num { font-size: 27px; font-weight: 680; letter-spacing: -.03em; color: var(--mint); font-variant-numeric: tabular-nums; }
.fact__label { font-size: 12px; color: rgba(233, 245, 239, .62); }
.auth-brand__foot { position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; }
.auth-brand__foot .pill { background: rgba(94, 210, 156, .14); color: var(--mint); }
.auth-brand__org { font-size: 12px; color: rgba(233, 245, 239, .55); }

.auth-panel {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 40px 24px; gap: 20px;
}
.auth-card { width: 100%; max-width: 384px; }
.auth-card__head h1 { font-size: 26px; letter-spacing: -.03em; }
.auth-card__head p { margin-top: 8px; color: var(--muted); font-size: 13.5px; }
.auth-card .form { margin-top: 26px; }
.auth-card__foot {
  margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; gap: 12px; font-size: 12.5px; color: var(--muted);
}
.auth-legal { max-width: 384px; font-size: 11.5px; color: var(--muted); text-align: center; }

@media (max-width: 900px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-brand { padding: 30px 26px 34px; gap: 26px; }
  .auth-brand__tagline { font-size: 20px; margin-top: 16px; }
  .auth-brand__facts { gap: 26px; }
  .fact__num { font-size: 22px; }
  .auth-panel { padding: 30px 20px 44px; }
}
