:root {
  --bg: #f3f1ed;
  --panel: #fffdf9;
  --panel-2: #f8f5f0;
  --ink: #211e1c;
  --ink-2: #655f59;
  --ink-3: #96908a;
  --line: #e4ded6;
  --line-strong: #d5cdc3;
  --accent: #9b5a73;
  --accent-strong: #7f405b;
  --accent-soft: #f3e7ec;
  --gold: #b68f51;
  --gold-soft: #f5ead5;
  --green: #39745a;
  --green-soft: #e7f1eb;
  --red: #a84e4b;
  --red-soft: #f7e8e7;
  --amber: #a6742e;
  --blue: #456f9a;
  --sidebar: #211e1c;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(33, 30, 28, .04), 0 14px 34px rgba(68, 55, 43, .06);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { min-width: 320px; background: var(--bg); }
body {
  min-width: 320px; background: var(--bg); color: var(--ink); font-size: 14px; line-height: 1.6;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}
#app { min-height: 100vh; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(155, 90, 115, .22); outline-offset: 2px;
}

.eyebrow, .section-kicker {
  color: var(--accent); font-size: 10px; line-height: 1.2; font-weight: 800; letter-spacing: .18em; text-transform: uppercase;
}

/* 登录 */
.login-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 32px;
  background:
    radial-gradient(circle at 12% 16%, rgba(155, 90, 115, .12), transparent 32%),
    radial-gradient(circle at 88% 84%, rgba(182, 143, 81, .12), transparent 34%),
    #eeeae4;
}
.login-shell {
  width: min(1080px, 100%); min-height: 650px; display: grid; grid-template-columns: 1.08fr .92fr;
  overflow: hidden; border: 1px solid rgba(255,255,255,.7); border-radius: 28px;
  background: var(--panel); box-shadow: 0 28px 90px rgba(44, 35, 29, .16);
}
.login-story {
  position: relative; padding: 58px; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden;
  color: #f9f5ef; background:
    radial-gradient(circle at 80% 18%, rgba(182,143,81,.24), transparent 28%),
    linear-gradient(145deg, #2a2522 0%, #1b1917 100%);
}
.login-story::after {
  content: ""; position: absolute; right: -110px; bottom: -125px; width: 380px; height: 380px;
  border: 1px solid rgba(255,255,255,.12); border-radius: 50%; box-shadow: 0 0 0 54px rgba(255,255,255,.025), 0 0 0 108px rgba(255,255,255,.018);
}
.brand-mark, .brand-monogram {
  display: grid; place-items: center; flex: 0 0 auto; background: var(--accent); color: #fff; font-weight: 800; letter-spacing: -.04em;
}
.brand-mark { width: 48px; height: 48px; border-radius: 14px; box-shadow: 0 10px 25px rgba(155,90,115,.28); }
.login-story .eyebrow { color: #d9bd8c; margin-bottom: 18px; }
.login-story h1 { max-width: 460px; font-size: clamp(36px, 4.4vw, 56px); line-height: 1.16; letter-spacing: -.045em; font-weight: 650; }
.login-story p { max-width: 430px; margin-top: 24px; color: rgba(249,245,239,.62); font-size: 15px; line-height: 1.9; }
.login-proof { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.login-proof div { padding-top: 16px; border-top: 1px solid rgba(255,255,255,.14); }
.login-proof strong, .login-proof span { display: block; }
.login-proof strong { color: #e1c598; font-size: 18px; }
.login-proof span { margin-top: 3px; color: rgba(255,255,255,.5); font-size: 12px; }
.login-card { align-self: center; width: 100%; padding: 56px 58px; }
.login-brand { margin-bottom: 34px; }
.login-brand .logo { margin: 10px 0 8px; font-size: 30px; line-height: 1.2; font-weight: 700; letter-spacing: -.035em; }
.login-brand .sub { color: var(--ink-3); font-size: 13px; }
.login-field { margin-bottom: 18px; }
.login-field input { padding: 13px 14px; }
.login-submit { width: 100%; justify-content: space-between; margin-top: 8px; padding: 13px 17px; }
.login-submit span { font-size: 18px; }
.login-foot { margin-top: 22px; text-align: center; color: var(--ink-3); font-size: 11px; letter-spacing: .04em; }
.guest-return { display: block; margin-top: 18px; text-align: center; color: var(--ink-2); font-size: 12px; text-decoration: none; }
.guest-return:hover { color: var(--accent-strong); }

/* 主框架 */
.layout { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 20; width: 252px; display: flex; flex-direction: column;
  color: #fff; background: var(--sidebar); border-right: 1px solid rgba(255,255,255,.04);
}
.sidebar .brand { height: 96px; padding: 24px 22px; display: flex; align-items: center; gap: 13px; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand-monogram { width: 36px; height: 36px; border-radius: 11px; font-size: 12px; }
.sidebar .brand .logo { color: #fff; font-size: 15px; line-height: 1.2; font-weight: 650; letter-spacing: .06em; }
.sidebar .brand .sub { margin-top: 4px; color: rgba(255,255,255,.34); font-size: 8px; letter-spacing: .16em; }
.nav { flex: 1; padding: 20px 14px; overflow-y: auto; }
.nav a {
  min-height: 44px; display: flex; align-items: center; gap: 12px; margin-bottom: 5px; padding: 0 13px;
  color: rgba(255,255,255,.58); text-decoration: none; border-radius: 11px; font-size: 13px; transition: .16s ease;
}
.nav a:hover { color: rgba(255,255,255,.9); background: rgba(255,255,255,.055); }
.nav a.active { color: #fff; background: linear-gradient(100deg, rgba(155,90,115,.42), rgba(155,90,115,.16)); box-shadow: inset 3px 0 var(--accent); }
.nav svg { width: 18px; height: 18px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.user-box { min-height: 84px; display: flex; align-items: center; gap: 11px; padding: 16px 18px; border-top: 1px solid rgba(255,255,255,.08); }
.avatar { width: 35px; height: 35px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; color: #f3dce5; background: rgba(155,90,115,.3); font-size: 13px; font-weight: 700; }
.user-meta { min-width: 0; flex: 1; }
.user-box .name { color: rgba(255,255,255,.9); font-size: 12px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-box .role { color: rgba(255,255,255,.34); font-size: 10px; }
.user-box button { width: 28px; height: 28px; border: 0; border-radius: 8px; color: rgba(255,255,255,.35); background: transparent; }
.user-box button:hover { color: #fff; background: rgba(255,255,255,.08); }
.guest-box { padding: 16px 18px 18px; border-top: 1px solid rgba(255,255,255,.08); }
.guest-state { display: flex; align-items: center; gap: 10px; margin-bottom: 13px; }
.guest-state strong, .guest-state small { display: block; }
.guest-state strong { color: rgba(255,255,255,.9); font-size: 12px; }
.guest-state small { margin-top: 1px; color: rgba(255,255,255,.38); font-size: 10px; }
.guest-dot { width: 9px; height: 9px; border-radius: 50%; background: #d9bd8c; box-shadow: 0 0 0 4px rgba(217,189,140,.12); }
.guest-login { width: 100%; color: #fff; border-color: rgba(255,255,255,.16); background: rgba(255,255,255,.07); }
.guest-login:hover { color: #fff; border-color: rgba(255,255,255,.35); background: rgba(255,255,255,.12); }
.main { min-width: 0; margin-left: 252px; padding: 40px clamp(26px, 4vw, 58px) 72px; }
.main > * { width: min(1380px, 100%); margin-left: auto; margin-right: auto; }

/* 页面标题与指标 */
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.page-title { margin-top: 8px; font-size: clamp(27px, 3vw, 38px); line-height: 1.15; font-weight: 680; letter-spacing: -.04em; }
.page-desc { margin-top: 9px; color: var(--ink-2); font-size: 13px; }
.readonly-note { display: inline-flex; align-items: center; gap: 8px; margin-top: 13px; color: var(--ink-3); font-size: 11px; }
.readonly-note span { padding: 2px 8px; border-radius: 999px; color: var(--accent-strong); background: var(--accent-soft); font-weight: 700; letter-spacing: .04em; }
.period-badge { min-width: 214px; padding: 10px 14px; text-align: right; border-left: 1px solid var(--line-strong); }
.period-badge span, .period-badge strong { display: block; }
.period-badge span { color: var(--ink-3); font-size: 10px; letter-spacing: .08em; }
.period-badge strong { margin-top: 2px; font-size: 12px; font-weight: 600; }
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi-card { position: relative; min-height: 140px; padding: 22px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow); }
.kpi-card::after { content: ""; position: absolute; right: -25px; bottom: -35px; width: 96px; height: 96px; border: 18px solid var(--tone, var(--accent-soft)); border-radius: 50%; opacity: .78; }
.kpi-card > * { position: relative; z-index: 1; display: block; }
.kpi-card > span { color: var(--ink-2); font-size: 12px; }
.kpi-card strong { margin: 9px 0 6px; font-size: clamp(27px, 2.7vw, 38px); line-height: 1; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.kpi-card small { color: var(--ink-3); font-size: 10px; }
.kpi-card.accent-2 { --tone: #e4ecf4; }
.kpi-card.accent-3 { --tone: #e2eee7; }
.kpi-card.accent-4 { --tone: var(--gold-soft); }
.kpi-card.skeleton { color: transparent; }

/* 卡片和控件 */
.card { margin-bottom: 18px; padding: 22px 24px; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow); }
.card h3 { margin-bottom: 15px; display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 15px; }
.card h3 .hint { color: var(--ink-3); font-size: 11px; font-weight: 400; }
.card-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 19px; }
.card-heading h2 { margin-top: 6px; font-size: 18px; line-height: 1.2; letter-spacing: -.02em; }
.card-heading > span { font-size: 11px; }
.board-card { padding: 24px 0 8px; }
.board-card > .card-heading, .board-card > .filters { margin-left: 24px; margin-right: 24px; }
.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin-bottom: 18px; }
.filters-panel { padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: var(--panel-2); }
.filters label { display: grid; gap: 5px; color: var(--ink-2); font-size: 11px; }
input, select, textarea {
  min-height: 38px; border: 1px solid var(--line-strong); border-radius: 9px; background: #fff; color: var(--ink); transition: .15s ease;
}
input, textarea { padding: 8px 11px; }
select { padding: 7px 30px 7px 10px; }
input::placeholder, textarea::placeholder { color: #b7b0a9; }
input:hover, select:hover, textarea:hover { border-color: #c3b8ad; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px rgba(155,90,115,.10); }
.btn { min-height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 7px 15px; border: 1px solid var(--line-strong); border-radius: 9px; background: #fff; color: var(--ink); font-size: 12px; font-weight: 620; transition: .15s ease; }
.btn:hover { color: var(--accent-strong); border-color: var(--accent); transform: translateY(-1px); }
.btn.primary { color: #fff; border-color: var(--ink); background: var(--ink); box-shadow: 0 7px 17px rgba(33,30,28,.13); }
.btn.primary:hover { color: #fff; border-color: var(--accent-strong); background: var(--accent-strong); }
.btn.small { min-height: 30px; padding: 4px 10px; font-size: 11px; }
.btn.danger:hover { color: var(--red); border-color: var(--red); background: var(--red-soft); }
.btn:disabled { cursor: not-allowed; opacity: .48; transform: none; }
.button-row { display: flex; flex-wrap: wrap; gap: 10px; }

/* 表格 */
.table-scroll { width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; scrollbar-width: thin; }
table { width: 100%; min-width: 760px; border-collapse: collapse; }
th { padding: 10px 13px; text-align: left; color: var(--ink-3); border-bottom: 1px solid var(--line); font-size: 10px; font-weight: 750; letter-spacing: .05em; white-space: nowrap; }
td { padding: 14px 13px; border-bottom: 1px solid #eee9e3; font-size: 12px; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: #faf7f2; }
.tag { display: inline-flex; align-items: center; min-height: 24px; padding: 2px 9px; border-radius: 999px; background: var(--panel-2); color: var(--ink-2); font-size: 10px; white-space: nowrap; }
.tag.lib-original { color: var(--green); background: var(--green-soft); }
.tag.lib-influencer { color: var(--accent-strong); background: var(--accent-soft); }
.tag.platform { color: #655889; background: #eeebf4; }
.tag.status-策划中 { color: var(--amber); background: #fbf0dd; }
.tag.status-已拍摄 { color: var(--blue); background: #e9f0f6; }
.tag.status-已发布 { color: var(--green); background: var(--green-soft); }
.badge-ok { color: var(--green); font-weight: 700; }
.badge-fail { color: var(--red); font-weight: 700; }
.badge-skip { color: var(--amber); font-weight: 700; }
.rank-num { width: 28px; height: 28px; display: inline-grid; place-items: center; border-radius: 9px; background: #eeeae5; color: var(--ink-2); font-size: 11px; font-weight: 800; }
.rank-1 { color: #7a551b; background: var(--gold-soft); }
.rank-2 { color: #62656a; background: #e9eaec; }
.rank-3 { color: #8b5b43; background: #f0dfd5; }
.num { font-variant-numeric: tabular-nums; font-weight: 680; }
.muted { color: var(--ink-3); }
.reason { color: var(--red); font-size: 11px; }

/* 表单与次级控件 */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
.form-grid .full { grid-column: 1 / -1; }
.field label { display: block; margin-bottom: 6px; color: var(--ink-2); font-size: 11px; font-weight: 620; }
.field label .req { color: var(--red); }
.field input, .field select, .field textarea { width: 100%; }
.field textarea { min-height: 84px; resize: vertical; }
.field .tip { margin-top: 6px; color: var(--ink-3); font-size: 10px; }
.tabs { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 16px; }
.tabs button, .chips button { border: 1px solid var(--line); border-radius: 999px; background: var(--panel); color: var(--ink-2); font-size: 11px; }
.tabs button { padding: 8px 16px; }
.chips { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 16px; }
.chips button { padding: 5px 12px; }
.tabs button.active { color: #fff; border-color: var(--ink); background: var(--ink); }
.chips button.active { color: var(--accent-strong); border-color: #dabac6; background: var(--accent-soft); }
.empty { padding: 50px 18px; text-align: center; color: var(--ink-3); }
.empty .icon { margin-bottom: 8px; font-size: 30px; filter: grayscale(.35); }
.section-title { margin: 24px 0 13px; padding-left: 10px; border-left: 3px solid var(--accent); font-size: 13px; font-weight: 700; }
.link-row { display: flex; align-items: center; gap: 8px; }
.link-row input { flex: 1; }
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px 24px; }
.kv .k { color: var(--ink-3); font-size: 10px; }
.kv .v { margin-top: 3px; font-size: 13px; word-break: break-word; }
.status-dot { display: inline-flex; align-items: center; gap: 7px; color: var(--ink-3); font-size: 11px; }
.status-dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); }
.status-dot.ok { color: var(--green); }
.status-dot.ok::before { background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }
.security-notice { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; padding: 14px 17px; border: 1px solid #e2c99e; border-radius: 12px; color: #76531f; background: #fbf2df; }
.security-notice strong { white-space: nowrap; font-size: 12px; }
.security-notice span { color: #8d6e3d; font-size: 11px; }

/* 反馈与弹窗 */
#toast { position: fixed; top: 22px; left: 50%; z-index: 100; transform: translateX(-50%); }
.toast-item { min-width: 220px; margin-bottom: 8px; padding: 11px 16px; border-radius: 11px; color: #fff; background: var(--ink); box-shadow: 0 14px 35px rgba(33,30,28,.2); font-size: 12px; text-align: center; animation: slideDown .22s ease; }
.toast-item.error { background: var(--red); }
.toast-item.success { background: var(--green); }
@keyframes slideDown { from { opacity: 0; transform: translateY(-7px); } to { opacity: 1; transform: translateY(0); } }
.modal-mask { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 18px; background: rgba(22,19,17,.52); backdrop-filter: blur(4px); }
.modal { width: min(480px, 100%); max-height: 88vh; overflow-y: auto; padding: 27px; border: 1px solid rgba(255,255,255,.7); border-radius: 18px; background: var(--panel); box-shadow: 0 28px 70px rgba(20,18,16,.25); }
.modal h3 { margin-bottom: 19px; font-size: 17px; }
.modal .actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 20px; }

/* 图表与账号 */
.chart-legend { display: flex; flex-wrap: wrap; gap: 5px 16px; margin-top: 8px; color: var(--ink-2); font-size: 10px; }
.chart-legend .lg-item { white-space: nowrap; }
.chart-legend .dot { width: 9px; height: 9px; display: inline-block; margin-right: 5px; border-radius: 3px; vertical-align: -1px; }
.ip-group { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin: 6px 0 12px; }
.ip-group .ip-name { min-width: 78px; margin-right: 3px; color: var(--ink); font-size: 11px; font-weight: 750; }
.chip-check { display: inline-flex; align-items: center; padding: 5px 11px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink-2); cursor: pointer; font-size: 10px; user-select: none; }
.chip-check.on { color: var(--accent-strong); border-color: #d5abbc; background: var(--accent-soft); font-weight: 680; }

@media (max-width: 1100px) {
  .sidebar { width: 220px; }
  .main { margin-left: 220px; padding-left: 28px; padding-right: 28px; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  .layout { display: block; }
  .sidebar { position: sticky; top: 0; width: 100%; height: 64px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; }
  .sidebar .brand { width: auto; height: 64px; padding: 12px 14px; border: 0; }
  .sidebar .brand > div:last-child { display: none; }
  .nav { display: flex; align-items: center; gap: 4px; height: 64px; padding: 8px 4px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { min-width: max-content; min-height: 42px; margin: 0; padding: 0 10px; gap: 7px; }
  .nav a.active { box-shadow: inset 0 -2px var(--accent); }
  .user-box { min-height: 64px; padding: 10px 12px; border-top: 0; border-left: 1px solid rgba(255,255,255,.08); }
  .user-box .avatar, .user-meta { display: none; }
  .main { margin-left: 0; padding: 28px 20px 58px; }
  .page-header { align-items: flex-start; }
  .period-badge { display: none; }
  .login-shell { min-height: auto; grid-template-columns: 1fr; }
  .login-story { min-height: 270px; padding: 34px; }
  .login-story h1 { font-size: 34px; }
  .login-story p { display: none; }
  .login-proof { margin-top: 35px; }
  .login-card { padding: 42px 34px; }
}

@media (max-width: 560px) {
  .login-wrap { padding: 14px; }
  .login-shell { border-radius: 20px; }
  .login-story { min-height: 218px; padding: 26px; }
  .login-story h1 { font-size: 29px; }
  .login-proof { display: none; }
  .login-card { padding: 34px 24px; }
  .login-brand .logo { font-size: 26px; }
  .brand-monogram { width: 34px; height: 34px; }
  .nav a { padding: 0 9px; }
  .nav a span { display: none; }
  .main { padding: 24px 14px 54px; }
  .page-header { display: block; margin-bottom: 21px; }
  .page-header > .btn { width: 100%; margin-top: 17px; }
  .page-title { font-size: 29px; }
  .kpi-grid { gap: 9px; }
  .kpi-card { min-height: 122px; padding: 17px; }
  .kpi-card strong { font-size: 27px; }
  .card { padding: 18px; border-radius: 14px; }
  .board-card { padding-left: 0; padding-right: 0; }
  .board-card > .card-heading, .board-card > .filters { margin-left: 16px; margin-right: 16px; }
  .card-heading { align-items: flex-start; }
  .card-heading > span { display: none; }
  .filters { align-items: stretch; }
  .filters label { min-width: calc(50% - 6px); flex: 1; }
  .filters label select, .filters label input { width: 100%; }
  .filters > .btn { flex: 1; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .full { grid-column: auto; }
  .link-row { align-items: stretch; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
