/* ============================================================
   GD UI GeekHome tokens 1.0 + 极客悬赏 Demo 组件样式
   OKLCH 为准；Hex 语义见 references/ui-kit.md
   ============================================================ */
:root {
  color-scheme: light;
  --background: oklch(0.985 0.012 65);
  --foreground: oklch(0.22 0.02 30);
  --card: oklch(1 0 0);
  --card-foreground: oklch(0.22 0.02 30);
  --popover: oklch(1 0 0);
  --popover-foreground: oklch(0.22 0.02 30);
  --primary: oklch(0.66 0.22 18);
  --primary-strong: oklch(0.56 0.22 18);
  --primary-foreground: oklch(0.99 0.005 60);
  --secondary: oklch(0.94 0.03 55);
  --secondary-foreground: oklch(0.30 0.06 30);
  --muted: oklch(0.96 0.015 65);
  --muted-foreground: oklch(0.50 0.02 40);
  --accent: oklch(0.90 0.08 45);
  --accent-foreground: oklch(0.30 0.08 25);
  --destructive: oklch(0.60 0.24 28);
  --destructive-foreground: oklch(0.99 0 0);
  --border: oklch(0.90 0.02 50);
  --input: oklch(0.93 0.018 55);
  --ring: oklch(0.66 0.22 18);
  --peach: oklch(0.86 0.12 45);
  --mint: oklch(0.84 0.08 165);
  --lemon: oklch(0.92 0.12 95);
  --sky: oklch(0.82 0.08 230);
  --radius: 16px;
  --shadow-soft: 0 2px 12px -4px oklch(0.70 0.18 25 / 0.18);
  --shadow-pop: 0 12px 32px -12px oklch(0.65 0.22 25 / 0.32);
  --gradient-warm: linear-gradient(135deg, oklch(0.72 0.18 35), oklch(0.66 0.22 18));
  --gh-motion-fast: 120ms;
  --gh-motion-base: 180ms;
  --gh-motion-slow: 240ms;
  --gh-ease-standard: cubic-bezier(0.2, 0.8, 0.2, 1);
}
[data-theme="dark"] {
  color-scheme: dark;
  --background: oklch(0.18 0.015 30);
  --foreground: oklch(0.96 0.01 60);
  --card: oklch(0.22 0.02 30);
  --card-foreground: oklch(0.96 0.01 60);
  --popover: oklch(0.22 0.02 30);
  --popover-foreground: oklch(0.96 0.01 60);
  --primary: oklch(0.72 0.22 22);
  --primary-strong: oklch(0.67 0.22 22);
  --primary-foreground: oklch(0.16 0.02 30);
  --secondary: oklch(0.28 0.03 30);
  --secondary-foreground: oklch(0.96 0.01 60);
  --muted: oklch(0.26 0.02 30);
  --muted-foreground: oklch(0.70 0.02 50);
  --accent: oklch(0.32 0.06 30);
  --accent-foreground: oklch(0.96 0.01 60);
  --destructive: oklch(0.65 0.22 28);
  --destructive-foreground: oklch(0.99 0 0);
  --border: oklch(1 0 0 / 12%);
  --input: oklch(1 0 0 / 14%);
  --ring: oklch(0.72 0.22 22);
  --peach: oklch(0.70 0.14 45);
  --mint: oklch(0.70 0.10 165);
  --lemon: oklch(0.78 0.14 95);
  --sky: oklch(0.70 0.10 230);
}

/* ===== 基础 ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: "Plus Jakarta Sans", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  background: var(--background);
  color: var(--foreground);
  font-size: 14px;
  line-height: 1.6;
  transition: background-color var(--gh-motion-base) var(--gh-ease-standard), color var(--gh-motion-base) var(--gh-ease-standard);
}
.gh-interactive {
  transition:
    color var(--gh-motion-fast) var(--gh-ease-standard),
    background-color var(--gh-motion-fast) var(--gh-ease-standard),
    border-color var(--gh-motion-fast) var(--gh-ease-standard),
    transform var(--gh-motion-base) var(--gh-ease-standard),
    box-shadow var(--gh-motion-base) var(--gh-ease-standard);
}
.gh-focus-ring:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  .gh-interactive { transition-duration: 0.01ms; }
  .task-card:hover { transform: none; }
}
.tabular { font-variant-numeric: tabular-nums; }

/* ===== 顶栏 ===== */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in oklab, var(--background) 90%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid color-mix(in oklab, var(--border) 60%, transparent);
}
.topbar-inner {
  max-width: 1152px; margin: 0 auto; height: 60px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 24px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; letter-spacing: -0.01em; text-decoration: none; color: inherit; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px;
  background: var(--gradient-warm);
  display: grid; place-items: center; color: #fff; flex-shrink: 0;
}
.nav-links { display: flex; gap: 4px; }
.nav-links a {
  height: 36px; display: inline-flex; align-items: center; padding: 0 14px;
  border-radius: 12px; font-size: 14px; font-weight: 500;
  color: var(--muted-foreground); text-decoration: none;
}
.nav-links a:hover { background: var(--muted); color: var(--foreground); }
.nav-links a.active { background: var(--primary-strong); color: #fff; }
.topbar-right { display: flex; align-items: center; gap: 10px; }

/* ===== 按钮 ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 16px; border-radius: 14px;
  font-size: 14px; font-weight: 600; font-family: inherit;
  border: 1px solid transparent; cursor: pointer; text-decoration: none;
}
.btn svg { width: 16px; height: 16px; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; pointer-events: none; }
.btn-primary { background: var(--primary-strong); color: #fff; box-shadow: var(--shadow-soft); }
.btn-primary:hover { background: color-mix(in oklab, var(--primary-strong) 90%, black); }
.btn-secondary { background: var(--secondary); color: var(--secondary-foreground); }
.btn-secondary:hover { background: color-mix(in oklab, var(--secondary) 80%, transparent); }
.btn-outline { background: var(--card); border-color: var(--input); color: var(--foreground); }
.btn-outline:hover { background: color-mix(in oklab, var(--accent) 60%, transparent); }
.btn-ghost { background: transparent; color: var(--muted-foreground); }
.btn-ghost:hover { background: color-mix(in oklab, var(--accent) 60%, transparent); color: var(--foreground); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 12px; }
.btn-lg { height: 40px; padding: 0 20px; }
.btn-block { width: 100%; }
.icon-btn {
  width: 36px; height: 36px; padding: 0; border-radius: 12px;
  display: inline-grid; place-items: center;
  background: transparent; border: 1px solid var(--input); color: var(--muted-foreground); cursor: pointer;
}
.icon-btn:hover { background: var(--muted); color: var(--foreground); }
.avatar {
  width: 34px; height: 34px; border-radius: 999px; flex-shrink: 0;
  display: grid; place-items: center; color: #fff; font-size: 13px; font-weight: 600;
}

/* ===== 页面骨架 ===== */
.page { max-width: 1152px; margin: 0 auto; padding: 20px 24px 64px; }
.panel {
  background: var(--card);
  border: 1px solid color-mix(in oklab, var(--border) 60%, transparent);
  border-radius: 24px; padding: 24px;
}

/* ===== Hero ===== */
.hero {
  position: relative; overflow: hidden;
  border-radius: 24px; padding: 32px 32px 36px;
  /* 白字压在深一档的暖色上，保证 AA 对比度 */
  background: linear-gradient(135deg, oklch(0.63 0.19 35), oklch(0.54 0.21 18));
  color: var(--primary-foreground);
  margin-bottom: 24px;
}
.hero::after {
  content: ""; position: absolute; right: -80px; bottom: -90px;
  width: 260px; height: 260px; border-radius: 50%;
  background: rgba(255,255,255,0.15); filter: blur(24px);
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: 999px; padding: 5px 12px;
  background: rgba(255,255,255,0.2); backdrop-filter: blur(4px);
  font-size: 12px; font-weight: 600;
}
.hero h1 { font-size: 28px; line-height: 1.25; letter-spacing: -0.02em; margin-top: 14px; font-weight: 700; }
.hero p { margin-top: 8px; font-size: 14px; opacity: 0.92; max-width: 520px; }
.hero .btn { margin-top: 18px; background: #fff; color: var(--primary-strong); }
.hero .btn:hover { background: rgba(255,255,255,0.9); }

/* ===== 工具条 ===== */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.toolbar-title h2 { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }
.toolbar-title p { font-size: 12px; color: var(--muted-foreground); margin-top: 2px; }
.toolbar-right { display: flex; align-items: center; gap: 10px; }
.search-box {
  display: flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 12px; width: 240px;
  background: var(--card); border: 1px solid var(--input); border-radius: 14px;
}
.search-box:focus-within { border-color: transparent; outline: 2px solid var(--ring); outline-offset: 2px; }
.search-box svg { width: 15px; height: 15px; color: var(--muted-foreground); flex-shrink: 0; }
.search-box input {
  border: none; outline: none; background: transparent; width: 100%;
  font-size: 13px; font-family: inherit; color: var(--foreground);
}
.search-box input::placeholder { color: var(--muted-foreground); }

/* ===== 筛选 Chips ===== */
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 20px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0;
  height: 32px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--card);
  font-size: 13px; font-weight: 600; font-family: inherit; color: var(--foreground); cursor: pointer;
}
.chip:hover { border-color: color-mix(in oklab, var(--primary) 40%, transparent); }
.chip[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: var(--primary-foreground); }
.chip .count {
  min-width: 20px; text-align: center; border-radius: 999px; padding: 1px 6px;
  font-size: 11px; font-weight: 600; background: var(--muted); color: var(--muted-foreground);
}
.chip[aria-pressed="true"] .count { background: rgba(255,255,255,0.25); color: inherit; }

/* ===== 任务卡片 ===== */
.grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.task-card {
  display: flex; flex-direction: column; gap: 12px; height: 100%; min-width: 0;
  border-radius: 24px; padding: 20px;
  background: var(--card);
  border: 1px solid color-mix(in oklab, var(--border) 60%, transparent);
  cursor: pointer; text-decoration: none; color: inherit;
}
.task-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in oklab, var(--primary) 40%, transparent);
  box-shadow: var(--shadow-pop);
}
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tag-cat {
  display: inline-flex; align-items: center; gap: 5px;
  border-radius: 999px; padding: 3px 10px;
  font-size: 12px; font-weight: 600;
  background: var(--secondary); color: var(--secondary-foreground);
}
.badge { border-radius: 999px; padding: 3px 10px; font-size: 11px; font-weight: 600; border: 1px solid; }
.badge-open { border-color: rgba(16,185,129,0.3); background: rgba(16,185,129,0.1); color: #047857; }
.badge-doing { border-color: rgba(245,158,11,0.3); background: rgba(245,158,11,0.1); color: #B45309; }
.badge-review { border-color: rgba(139,92,246,0.3); background: rgba(139,92,246,0.1); color: #6D28D9; }
[data-theme="dark"] .badge-open { color: #6EE7B7; }
[data-theme="dark"] .badge-doing { color: #FCD34D; }
[data-theme="dark"] .badge-review { color: #C4B5FD; }
.task-title { font-size: 16px; font-weight: 600; line-height: 1.4; letter-spacing: -0.01em; }
.task-desc {
  font-size: 13px; line-height: 1.6; color: var(--muted-foreground);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.bounty { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 700; color: #B45309; }
[data-theme="dark"] .bounty { color: var(--lemon); }
.bounty svg { width: 16px; height: 16px; }
.deadline { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 500; color: var(--muted-foreground); }
.deadline.urgent { color: var(--destructive); }
.deadline svg { width: 13px; height: 13px; }
.card-divider { height: 1px; margin-top: auto; background: color-mix(in oklab, var(--border) 55%, transparent); }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.publisher { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted-foreground); }
.publisher .avatar { width: 24px; height: 24px; font-size: 11px; }
.link-detail { font-size: 12px; font-weight: 600; color: var(--primary-strong); }
[data-theme="dark"] .link-detail { color: var(--primary); }
.task-card:hover .link-detail { text-decoration: underline; }

/* ===== 空状态 ===== */
.empty {
  display: none; min-height: 260px; place-items: center; text-align: center;
  border: 1px dashed var(--border); border-radius: 24px;
  background: color-mix(in oklab, var(--card) 60%, transparent); padding: 32px;
}
.empty.show { display: grid; }
.empty-icon { width: 44px; height: 44px; margin: 0 auto; color: color-mix(in oklab, var(--muted-foreground) 60%, transparent); }
.empty h3 { margin-top: 14px; font-size: 16px; font-weight: 600; }
.empty p { margin-top: 4px; font-size: 14px; color: var(--muted-foreground); }
.empty .btn { margin-top: 18px; }

/* ===== 分页与页脚 ===== */
.pager { display: flex; align-items: center; justify-content: space-between; margin-top: 24px; font-size: 12px; color: var(--muted-foreground); }
.footer { margin-top: 48px; text-align: center; font-size: 12px; color: var(--muted-foreground); }

/* ===== Toast ===== */
.toast {
  position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%) translateY(16px);
  background: var(--foreground); color: var(--background);
  border-radius: 14px; padding: 10px 18px; font-size: 13px; font-weight: 500;
  opacity: 0; pointer-events: none; z-index: 50;
  transition: opacity var(--gh-motion-base) var(--gh-ease-standard), transform var(--gh-motion-base) var(--gh-ease-standard);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===== 详情页 ===== */
.breadcrumb { font-size: 12px; color: var(--muted-foreground); margin-bottom: 16px; }
.breadcrumb a { color: var(--muted-foreground); text-decoration: none; }
.breadcrumb a:hover { color: var(--primary-strong); text-decoration: underline; }
.detail-layout { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 1024px) { .detail-layout { grid-template-columns: minmax(0, 1fr) 340px; } }
.detail-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.detail-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.detail-title-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.detail-title { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.35; }
.meta-text { font-size: 13px; color: var(--muted-foreground); }
.divider { height: 1px; background: color-mix(in oklab, var(--border) 55%, transparent); }
.section-title { font-size: 15px; font-weight: 600; margin: 20px 0 8px; }
.section-title:first-child { margin-top: 0; }
.body-text { font-size: 14px; line-height: 1.7; color: var(--foreground); max-width: 72ch; }
.body-text + .body-text { margin-top: 8px; }
.standards { display: flex; flex-direction: column; gap: 6px; font-size: 14px; line-height: 1.7; }
.file-chip {
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: 12px; padding: 8px 12px;
  background: var(--muted); font-size: 12px; color: var(--foreground);
  border: 1px solid transparent; cursor: pointer;
}
.file-chip:hover { border-color: color-mix(in oklab, var(--primary) 40%, transparent); }
.file-chip svg { width: 14px; height: 14px; color: var(--muted-foreground); }
.files-row { display: flex; flex-wrap: wrap; gap: 8px; }
.comment { display: flex; gap: 12px; }
.comment + .comment { margin-top: 16px; }
.comment-body { flex: 1; min-width: 0; }
.comment-meta { font-size: 12px; color: var(--muted-foreground); }
.comment-text { font-size: 14px; line-height: 1.6; margin-top: 2px; }
.comment-input-row { display: flex; gap: 12px; margin-top: 20px; align-items: center; }
.comment-input-row .btn { min-width: 76px; flex-shrink: 0; }
.input {
  height: 36px; width: 100%; padding: 0 14px;
  border-radius: 14px; border: 1px solid var(--input);
  background: var(--card); color: var(--foreground);
  font-size: 14px; font-family: inherit;
}
.input::placeholder { color: var(--muted-foreground); }
.input:focus { outline: 2px solid var(--ring); outline-offset: 2px; border-color: transparent; }
.input.error { border-color: var(--destructive); }
.input.error:focus { outline-color: var(--destructive); }
.textarea {
  width: 100%; min-height: 110px; padding: 10px 14px; resize: vertical;
  border-radius: 14px; border: 1px solid var(--input);
  background: var(--card); color: var(--foreground);
  font-size: 14px; line-height: 1.6; font-family: inherit;
}
.textarea::placeholder { color: var(--muted-foreground); }
.textarea:focus { outline: 2px solid var(--ring); outline-offset: 2px; border-color: transparent; }

/* 悬赏侧栏 */
.bounty-label { font-size: 13px; color: var(--muted-foreground); }
.bounty-big { display: flex; align-items: baseline; gap: 6px; margin-top: 6px; }
.bounty-big .num { font-size: 32px; font-weight: 700; color: #B45309; line-height: 1; }
.bounty-big .unit { font-size: 14px; font-weight: 600; color: #B45309; }
[data-theme="dark"] .bounty-big .num,
[data-theme="dark"] .bounty-big .unit { color: var(--lemon); }
.kv-row { display: flex; align-items: center; justify-content: space-between; font-size: 13px; }
.kv-row .k { color: var(--muted-foreground); }
.kv-row .v { font-weight: 600; }
.kv-row .v.urgent { color: var(--destructive); }
.claim-hint { font-size: 11px; color: var(--muted-foreground); text-align: center; }
.timeline { display: flex; flex-direction: column; gap: 12px; }
.tl-item { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.tl-dot { width: 10px; height: 10px; border-radius: 999px; flex-shrink: 0; }
.tl-dot.done { background: #10B981; }
.tl-dot.current { background: var(--primary); box-shadow: 0 0 0 4px color-mix(in oklab, var(--primary) 20%, transparent); }
.tl-dot.todo { background: var(--border); }
.tl-item.current { color: var(--primary-strong); font-weight: 600; }
[data-theme="dark"] .tl-item.current { color: var(--primary); }
.tl-item.todo { color: var(--muted-foreground); }
.publisher-card { display: flex; align-items: center; gap: 12px; }
.publisher-card .avatar { width: 40px; height: 40px; font-size: 16px; }
.publisher-card .name { font-size: 14px; font-weight: 600; }
.publisher-card .dept { font-size: 12px; color: var(--muted-foreground); }

/* ===== 发布表单页 ===== */
.form-wrap { max-width: 720px; margin: 0 auto; }
.form-banner {
  display: flex; align-items: center; gap: 10px;
  border-radius: 14px; padding: 12px 14px;
  background: rgba(245,158,11,0.1); border: 1px solid rgba(245,158,11,0.25);
  color: #B45309; font-size: 13px;
}
[data-theme="dark"] .form-banner { color: #FCD34D; }
.form-banner svg { width: 16px; height: 16px; flex-shrink: 0; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field + .field, .form-banner + .field, .field + .form-row, .form-row + .field { margin-top: 16px; }
.field label { font-size: 13px; font-weight: 600; }
.field label .req { color: var(--destructive); margin-left: 2px; }
.help-text { font-size: 12px; color: var(--muted-foreground); }
.error-text { font-size: 12px; color: var(--destructive); display: none; }
.error-text.show { display: flex; align-items: center; gap: 4px; }
.form-row { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .form-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.input-suffix { position: relative; }
.input-suffix .suffix {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  font-size: 13px; color: var(--muted-foreground); pointer-events: none;
}
.upload-box {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  height: 76px; border-radius: 14px; cursor: pointer;
  border: 1.5px dashed color-mix(in oklab, var(--muted-foreground) 45%, transparent);
  background: color-mix(in oklab, var(--muted) 60%, transparent);
  font-size: 13px; color: var(--muted-foreground);
}
.upload-box:hover { border-color: var(--primary); color: var(--foreground); }
.upload-box svg { width: 18px; height: 18px; }
.form-footer { display: flex; justify-content: flex-end; gap: 12px; margin-top: 24px; }

@media (max-width: 767px) {
  .nav-links { display: none; }
  .topbar-inner, .page { padding-left: 12px; padding-right: 12px; }
  .hero { padding: 24px 20px 28px; }
  .hero h1 { font-size: 22px; }
  .search-box { width: 100%; }
  .toolbar-right { width: 100%; }
  .topbar-right .btn-primary { padding: 0 12px; }
  .detail-title { font-size: 18px; }
  .panel { padding: 16px; }
}

/* ===== 登录页（口令） ===== */
.login-body { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card {
  width: 100%; max-width: 400px;
  background: var(--card); border: 1px solid color-mix(in oklab, var(--border) 60%, transparent);
  border-radius: 24px; padding: 36px 32px;
  box-shadow: var(--shadow-soft);
  display: flex; flex-direction: column; gap: 16px; text-align: center;
}
.login-brand { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.login-brand .brand-mark { width: 48px; height: 48px; border-radius: 14px; }
.login-brand .brand-mark svg { width: 24px; height: 24px; }
.login-title { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
.login-sub { font-size: 13px; color: var(--muted-foreground); }
.login-form { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.login-form .input { height: 44px; text-align: center; letter-spacing: 0.05em; }
.login-form .input:focus {
  outline: none;
  border-color: color-mix(in oklab, var(--foreground) 28%, transparent);
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--foreground) 8%, transparent);
}
.login-form .btn { height: 44px; }
.login-error {
  display: none; font-size: 12px; color: var(--destructive);
  align-items: center; justify-content: center; gap: 4px;
}
.login-error.show { display: flex; }
.login-note { font-size: 12px; color: var(--muted-foreground); }
.login-hero-tag {
  display: inline-flex; align-items: center; gap: 6px; align-self: center;
  border-radius: 999px; padding: 5px 12px;
  background: var(--secondary); color: var(--secondary-foreground);
  font-size: 12px; font-weight: 600;
}

/* ===== 圈子标签 ===== */
.circle-tag {
  display: inline-flex; align-items: center;
  border-radius: 999px; padding: 3px 10px;
  font-size: 11px; font-weight: 500;
  background: var(--muted); color: var(--muted-foreground);
  border: 1px solid color-mix(in oklab, var(--border) 60%, transparent);
}
.card-top .tags-left { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

/* ===== 商城 ===== */
.balance-card {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  border-radius: 24px; padding: 20px 24px; margin-bottom: 20px;
  background: var(--card); border: 1px solid color-mix(in oklab, var(--border) 60%, transparent);
}
.balance-left { display: flex; align-items: center; gap: 14px; }
.balance-icon {
  width: 44px; height: 44px; border-radius: 14px; flex-shrink: 0;
  display: grid; place-items: center;
  background: rgba(254,228,132,0.35);
}
.balance-icon svg { width: 22px; height: 22px; }
.balance-num { font-size: 26px; font-weight: 700; color: #B45309; line-height: 1.1; }
[data-theme="dark"] .balance-num { color: var(--lemon); }
.balance-label { font-size: 12px; color: var(--muted-foreground); }
.balance-rate { font-size: 12px; color: var(--muted-foreground); text-align: right; line-height: 1.7; }
.product-card {
  display: flex; flex-direction: column; gap: 10px;
  border-radius: 20px; padding: 16px;
  background: var(--card);
  border: 1px solid color-mix(in oklab, var(--border) 60%, transparent);
}
.product-thumb {
  aspect-ratio: 4 / 3; border-radius: 14px;
  display: grid; place-items: center; font-size: 40px;
}
.thumb-peach { background: color-mix(in oklab, var(--peach) 30%, transparent); }
.thumb-mint { background: color-mix(in oklab, var(--mint) 30%, transparent); }
.thumb-lemon { background: color-mix(in oklab, var(--lemon) 35%, transparent); }
.thumb-sky { background: color-mix(in oklab, var(--sky) 30%, transparent); }
.product-name { font-size: 15px; font-weight: 600; }
.product-desc {
  font-size: 12px; color: var(--muted-foreground); line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.product-foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; }
.product-price { display: inline-flex; align-items: center; gap: 5px; font-size: 16px; font-weight: 700; color: #B45309; }
[data-theme="dark"] .product-price { color: var(--lemon); }
.product-price svg { width: 16px; height: 16px; }
.product-stock { font-size: 11px; color: var(--muted-foreground); }
.product-meta { display: flex; align-items: center; justify-content: space-between; font-size: 11px; color: var(--muted-foreground); }

/* 兑换确认弹窗 */
.modal-overlay {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(0,0,0,0.45);
  display: none; place-items: center; padding: 24px;
}
.modal-overlay.show { display: grid; }
.modal {
  width: 100%; max-width: 420px;
  background: var(--card); border-radius: 20px; padding: 24px;
  box-shadow: var(--shadow-pop);
  display: flex; flex-direction: column; gap: 14px;
}
.modal h3 { font-size: 18px; font-weight: 600; }
.modal .modal-desc { font-size: 14px; color: var(--muted-foreground); line-height: 1.7; }
.modal .modal-kv { display: flex; justify-content: space-between; font-size: 13px; padding: 4px 0; }
.modal .modal-kv .k { color: var(--muted-foreground); }
.modal .modal-kv .v { font-weight: 600; }
.modal .modal-kv .v.warn { color: var(--destructive); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }

/* 我的兑换 */
.order-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid color-mix(in oklab, var(--border) 55%, transparent);
}
.order-item:last-child { border-bottom: none; }
.order-icon {
  width: 38px; height: 38px; border-radius: 12px; flex-shrink: 0;
  display: grid; place-items: center; font-size: 18px;
}
.order-info { flex: 1; min-width: 0; }
.order-name { font-size: 14px; font-weight: 600; }
.order-sub { font-size: 12px; color: var(--muted-foreground); }
.order-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.order-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px; background: var(--muted); border-radius: 8px; padding: 4px 8px;
}
.empty-orders { padding: 24px 0; text-align: center; font-size: 13px; color: var(--muted-foreground); }

/* ===== 管理后台 ===== */
.admin-shell { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 1000px) { .admin-shell { grid-template-columns: 208px minmax(0, 1fr); } }
.side-card { position: sticky; top: 84px; padding: 12px; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
@media (max-width: 999px) {
  .side-card { position: static; }
  .side-nav { flex-direction: row; flex-wrap: wrap; }
  .side-nav a { border: 1px solid color-mix(in oklab, var(--border) 70%, transparent); }
}
.side-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 12px;
  font-size: 13px; color: var(--muted-foreground); text-decoration: none;
}
.side-nav a svg { width: 15px; height: 15px; flex-shrink: 0; }
.side-nav a:hover { background: var(--muted); color: var(--foreground); }
.side-nav a.on {
  background: color-mix(in oklab, var(--primary) 12%, transparent);
  color: var(--primary-strong); font-weight: 600;
}
[data-theme="dark"] .side-nav a.on { color: var(--primary); }
.side-foot { margin-top: 10px; padding-top: 10px; border-top: 1px solid color-mix(in oklab, var(--border) 55%, transparent); }
.side-foot a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 12px;
  font-size: 13px; color: var(--muted-foreground); text-decoration: none;
}
.side-foot a:hover { background: var(--muted); color: var(--foreground); }
.side-foot a svg { width: 15px; height: 15px; flex-shrink: 0; }
.admin-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.stat-grid { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 780px) { .stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.stat-card {
  padding: 16px; border-radius: 18px; background: var(--card);
  border: 1px solid color-mix(in oklab, var(--border) 60%, transparent);
}
.stat-label { font-size: 12px; color: var(--muted-foreground); }
.stat-val { font-size: 24px; font-weight: 700; line-height: 1.3; letter-spacing: -0.01em; }
.stat-delta { font-size: 11px; color: var(--muted-foreground); }
.stat-delta.up { color: #047857; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tbl { width: 100%; min-width: 620px; border-collapse: collapse; font-size: 13px; }
.tbl td:first-child, .tbl th:first-child { white-space: nowrap; }
.tbl th {
  text-align: left; font-size: 12px; font-weight: 500; color: var(--muted-foreground);
  padding: 0 12px 10px; white-space: nowrap;
  border-bottom: 1px solid color-mix(in oklab, var(--border) 55%, transparent);
}
.tbl td {
  padding: 12px; vertical-align: middle;
  border-bottom: 1px solid color-mix(in oklab, var(--border) 40%, transparent);
}
.tbl tr:last-child td { border-bottom: none; }
.tbl tbody tr:hover { background: color-mix(in oklab, var(--muted) 45%, transparent); }
.tbl .cell-strong { font-weight: 600; }
.tbl .cell-sub { font-size: 12px; color: var(--muted-foreground); }
.tbl .cell-actions { display: flex; gap: 8px; justify-content: flex-end; }
.tbl .num { text-align: right; }
.rule-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 0; border-bottom: 1px solid color-mix(in oklab, var(--border) 45%, transparent);
}
.rule-row:last-of-type { border-bottom: none; }
.rule-label { font-size: 13px; font-weight: 600; }
.rule-desc { font-size: 12px; color: var(--muted-foreground); margin-top: 2px; line-height: 1.6; }
.rate-input { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted-foreground); flex-shrink: 0; }
.rate-input .input { width: 88px; height: 34px; text-align: center; font-weight: 600; appearance: textfield; -moz-appearance: textfield; }
.rate-input .input::-webkit-inner-spin-button,
.rate-input .input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.sync-banner {
  display: flex; align-items: flex-start; gap: 10px;
  border-radius: 14px; padding: 12px 14px; margin-bottom: 4px;
  background: rgba(139,92,246,0.08); border: 1px solid rgba(139,92,246,0.22);
  font-size: 12px; line-height: 1.7; color: #6D28D9;
}
[data-theme="dark"] .sync-banner { color: #C4B5FD; }
.sync-banner svg { width: 15px; height: 15px; flex-shrink: 0; margin-top: 2px; }
.sync-banner strong { font-weight: 700; }

/* ===== 通用弱态徽章 ===== */
.badge-muted { border-color: color-mix(in oklab, var(--border) 80%, transparent); background: var(--muted); color: var(--muted-foreground); }

/* ===== 任务行（圈子任务 / 我的任务） ===== */
.task-row {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 14px 0; border-bottom: 1px solid color-mix(in oklab, var(--border) 45%, transparent);
}
.task-row:last-child { border-bottom: none; }
.tr-main { flex: 1 1 260px; min-width: 0; }
.tr-title { font-size: 14px; font-weight: 600; }
.tr-title a { color: inherit; text-decoration: none; }
.tr-title a:hover { color: var(--primary-strong); text-decoration: underline; }
[data-theme="dark"] .tr-title a:hover { color: var(--primary); }
.tr-meta { margin-top: 3px; font-size: 12px; color: var(--muted-foreground); display: flex; gap: 10px; flex-wrap: wrap; }
.tr-bounty { flex-shrink: 0; font-size: 15px; font-weight: 700; color: #B45309; min-width: 76px; text-align: right; }
.tr-bounty small { font-size: 11px; font-weight: 500; }
[data-theme="dark"] .tr-bounty { color: var(--lemon); }
.tr-side { display: flex; align-items: center; gap: 8px; flex-shrink: 0; margin-left: auto; }

/* ===== 圈子主页 ===== */
.circle-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.circle-mark { width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; font-size: 26px; flex-shrink: 0; }
.circle-name-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.circle-name { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }
.circle-desc { font-size: 13px; color: var(--muted-foreground); margin-top: 4px; max-width: 52ch; }
.circle-side { display: flex; flex-direction: column; align-items: flex-end; gap: 14px; margin-left: auto; }
.circle-meta { display: flex; gap: 26px; flex-wrap: wrap; }
.cm-item .cm-num { font-size: 18px; font-weight: 700; line-height: 1.3; }
.cm-item .cm-label { font-size: 11px; color: var(--muted-foreground); }
.circle-actions { display: flex; gap: 8px; }
@media (max-width: 719px) {
  .circle-side { align-items: flex-start; margin-left: 0; width: 100%; }
}
.member-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.member-pill {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 10px 5px 5px; border-radius: 999px;
  background: var(--muted); font-size: 12px;
}
.member-pill .avatar { width: 22px; height: 22px; font-size: 10px; }
.member-pill .role { font-size: 10px; color: var(--primary-strong); font-weight: 600; }
[data-theme="dark"] .member-pill .role { color: var(--primary); }
.rank-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px dashed color-mix(in oklab, var(--border) 55%, transparent); }
.rank-row:last-child { border-bottom: none; }
.rank-medal { width: 22px; height: 22px; border-radius: 999px; display: grid; place-items: center; font-size: 11px; font-weight: 700; flex-shrink: 0; background: var(--muted); color: var(--muted-foreground); }
.rank-1 { background: #FEE484; color: #92400E; }
.rank-2 { background: #E5E7EB; color: #374151; }
.rank-3 { background: #F6D8B5; color: #7C2D12; }
[data-theme="dark"] .rank-1 { background: #B45309; color: #FEF3C7; }
[data-theme="dark"] .rank-2 { background: #6B7280; color: #F9FAFB; }
[data-theme="dark"] .rank-3 { background: #9A5B24; color: #FDE8D0; }
.rank-name { font-size: 13px; font-weight: 500; }
.rank-coins { margin-left: auto; font-size: 14px; font-weight: 700; color: #B45309; }
[data-theme="dark"] .rank-coins { color: var(--lemon); }

/* ===== 个人中心 ===== */
.profile-card { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.profile-avatar { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; color: #fff; font-size: 26px; font-weight: 700; background: #8B5CF6; flex-shrink: 0; }
.profile-name { font-size: 18px; font-weight: 700; }
.profile-sub { font-size: 12px; color: var(--muted-foreground); margin-top: 3px; }
.profile-tags { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.profile-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.flow-row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 0; border-bottom: 1px solid color-mix(in oklab, var(--border) 45%, transparent);
}
.flow-row:last-child { border-bottom: none; }
.flow-main { flex: 1; min-width: 0; }
.flow-name { font-size: 13px; font-weight: 500; }
.flow-time { font-size: 12px; color: var(--muted-foreground); margin-top: 1px; }
.flow-amt { font-size: 14px; font-weight: 700; flex-shrink: 0; }
.flow-amt.in { color: #047857; }
.flow-amt.out { color: var(--destructive); }
.flow-amt.frozen { color: #B45309; }
[data-theme="dark"] .flow-amt.in { color: #34D399; }
[data-theme="dark"] .flow-amt.frozen { color: var(--lemon); }
.logout-btn { color: var(--destructive); }
.logout-btn:hover { background: color-mix(in oklab, var(--destructive) 10%, transparent); }

/* ===== 圈子成员弹窗 ===== */
.member-modal { max-width: 460px; }
.mm-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mm-head h3 { font-size: 16px; font-weight: 700; }
.mm-search { width: 100%; }
/* 弹窗内输入控件统一用中性聚焦描边，避免主色红被误读为错误态 */
.modal .input:focus, .modal .textarea:focus, .modal .search-box:focus-within {
  outline-color: color-mix(in oklab, var(--foreground) 20%, transparent);
}
.mm-list { display: flex; flex-direction: column; max-height: 300px; overflow-y: auto; }
.mm-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 0; border-bottom: 1px solid color-mix(in oklab, var(--border) 40%, transparent);
}
.mm-row:last-child { border-bottom: none; }
.mm-row.removed { opacity: 0.4; }
.mm-info { flex: 1; min-width: 0; }
.mm-name { font-size: 13px; font-weight: 600; }
.mm-dept { font-size: 12px; color: var(--muted-foreground); }
.mm-invite { display: flex; gap: 10px; }
.mm-invite .input { flex: 1; min-width: 0; }
.mm-more { padding: 10px 0 2px; font-size: 12px; color: var(--muted-foreground); text-align: center; }
