:root{
  --xhs-red:#ff2e4d;
  --xhs-red-dark:#e02640;
  --xhs-pink:#ff6a88;
  --ink:#1f2430;
  --muted:#8a909c;
  --line:#eef0f4;
  --bg:#f6f7fb;
  --card:#ffffff;
  --radius:16px;
  --shadow:0 6px 24px rgba(20,20,40,.06);
  --shadow-lg:0 14px 40px rgba(20,20,40,.10);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
       background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.55;
       -webkit-font-smoothing: antialiased; }

/* ===== 顶栏 ===== */
.topbar { background: linear-gradient(135deg, var(--xhs-red) 0%, #ff5a73 100%);
          color: #fff; display: flex; align-items: center;
          padding: 0 22px; height: 62px; gap: 26px;
          box-shadow: 0 4px 18px rgba(255,46,77,.22); position: sticky; top: 0; z-index: 30; }
.brand { font-weight: 800; font-size: 18px; white-space: nowrap;
         display: flex; align-items: center; gap: 9px; letter-spacing: .3px; }
.brand::before { content: "📕"; font-size: 20px;
                 filter: drop-shadow(0 2px 4px rgba(0,0,0,.15)); }
#nav { display: flex; gap: 6px; }
.nav-btn { background: transparent; border: none; color: #ffe1e6; padding: 9px 15px;
           cursor: pointer; border-radius: 10px; font-size: 14px; transition: .18s; font-weight: 500; }
.nav-btn:hover { background: rgba(255,255,255,.18); color:#fff; }
.nav-btn.active { background: #fff; color: var(--xhs-red); font-weight: 700;
                  box-shadow: 0 4px 12px rgba(0,0,0,.12); }

main { padding: 22px; max-width: 1240px; margin: 0 auto; }
.tab { display: none; animation: fade .25s ease; }
.tab.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(6px);} to { opacity:1; transform:none; } }

/* ===== KPI 卡片 ===== */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap: 16px; margin-bottom: 20px; }
.card { background: var(--card); border-radius: var(--radius); padding: 20px 22px;
        box-shadow: var(--shadow); border: 1px solid var(--line); transition: .2s; position: relative; overflow: hidden; }
.card::after { content: ""; position: absolute; right: -20px; top: -20px; width: 80px; height: 80px;
               border-radius: 50%; background: radial-gradient(circle, rgba(255,46,77,.08), transparent 70%); }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.card .ic { font-size: 22px; width: 40px; height: 40px; border-radius: 12px; display: flex;
            align-items: center; justify-content: center; background: #fff0f3; margin-bottom: 10px; }
.card.red .ic { background: #ffe9ec; }
.card.blue .ic { background: #eaf1ff; }
.card.green .ic { background: #e8f7ee; }
.card.purple .ic { background: #f3e8ff; }
.card .num { font-size: 30px; font-weight: 800; letter-spacing: -.5px; line-height: 1.1; }
.card .lbl { color: var(--muted); margin-top: 6px; font-size: 13px; font-weight: 500; }
.card.green .num { color: #16a34a; }
.card.red .num { color: var(--xhs-red); }
.card.blue .num { color: #2563eb; }
.card.purple .num { color: #7c3aed; }

/* ===== 标签 / 面板 ===== */
.chip { display: inline-block; background: #f3e8ff; color: #6d28d9; border-radius: 999px;
        padding: 5px 13px; margin: 4px 6px 0 0; font-size: 13px; }
.chip b { color: #7c3aed; }

.panel { background: var(--card); border-radius: var(--radius); padding: 22px;
         box-shadow: var(--shadow); border: 1px solid var(--line); margin-bottom: 20px; }
.panel h3 { margin-bottom: 16px; font-size: 15px; font-weight: 700; color: var(--ink);
            display: flex; align-items: center; gap: 9px; }
.panel h3::before { content: ""; width: 4px; height: 16px; border-radius: 3px;
                    background: linear-gradient(var(--xhs-pink), var(--xhs-red)); }

/* ===== 工具栏 / 按钮 ===== */
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.btn { background: #fff; border: 1px solid #e3e6ec; border-radius: 10px; padding: 9px 16px;
       cursor: pointer; font-size: 14px; color: #3a4150; transition: .18s; font-weight: 500; }
.btn:hover { border-color: var(--xhs-red); color: var(--xhs-red); background: #fff5f7; }
.btn.primary { background: linear-gradient(135deg, var(--xhs-pink), var(--xhs-red));
               color: #fff; border-color: transparent; box-shadow: 0 6px 16px rgba(255,46,77,.25); }
.btn.primary:hover { background: linear-gradient(135deg, #ff7a93, var(--xhs-red-dark));
                     color: #fff; transform: translateY(-1px); box-shadow: 0 9px 22px rgba(255,46,77,.32); }
.hint { color: #a0a6b2; font-size: 12.5px; line-height: 1.5; }

/* ===== 表格 ===== */
.table-wrap { background: var(--card); border-radius: var(--radius);
              box-shadow: var(--shadow); border: 1px solid var(--line); overflow: hidden; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; table-layout: fixed; }
th, td { padding: 16px 18px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
th { background: #fafbfc; color: #7a818f; font-weight: 600; font-size: 15px; letter-spacing: .3px; }
tbody tr { transition: .15s; }
tbody tr:hover { background: #fff6f8; }
tbody tr:last-child td { border-bottom: none; }
.num-cell { font-variant-numeric: tabular-nums; font-weight: 600; font-size: 16px; }
.likes { color: var(--xhs-red); }
.collects { color: #2563eb; }
.inc-cell { color: #16a34a; font-size: 14px; }

/* 爆款笔记：固定列宽，确保各列（含标题）都可见 */
#notes-table th:nth-child(1), #notes-table td:nth-child(1) { width: 72px; }   /* 封面 */
#notes-table th:nth-child(2), #notes-table td:nth-child(2) { width: 78px; }   /* ID */
#notes-table th:nth-child(3), #notes-table td:nth-child(3) { width: 260px; }  /* 标题 */
#notes-table th:nth-child(4), #notes-table td:nth-child(4) { width: 130px; }  /* 博主 */
#notes-table th:nth-child(5), #notes-table td:nth-child(5) { width: 92px; }   /* 点赞 */
#notes-table th:nth-child(6), #notes-table td:nth-child(6) { width: 92px; }   /* 收藏 */
#notes-table th:nth-child(7), #notes-table td:nth-child(7) { width: 92px; }   /* 评论 */
#notes-table th:nth-child(8), #notes-table td:nth-child(8) { width: 92px; }   /* 日增赞 */
#notes-table th:nth-child(9), #notes-table td:nth-child(9) { width: 92px; }   /* 日增藏 */
#notes-table th:nth-child(10), #notes-table td:nth-child(10) { width: 92px; } /* 日增评 */
#notes-table th:nth-child(11), #notes-table td:nth-child(11) { width: 110px; } /* 添加人 */
#notes-table th:nth-child(12), #notes-table td:nth-child(12) { width: 150px; } /* 最后同步 */
#notes-table th:nth-child(13), #notes-table td:nth-child(13) { width: 120px; } /* 操作 */

/* 爆款笔记：封面缩略图 + 可点击标题 */
.cover-cell { text-align: center; padding: 9px 6px; overflow: visible; }
.cover-cell img { width: 60px; height: 60px; object-fit: cover; border-radius: 12px; background: #f2f2f2; display: block; margin: 0 auto; box-shadow: 0 2px 6px rgba(0,0,0,.08); }
.cover-ph { display: inline-block; width: 60px; height: 60px; line-height: 60px; border-radius: 12px; background: #f2f2f2; color: #bbb; font-size: 13px; text-align: center; }
.title-cell { overflow: hidden; text-overflow: ellipsis; }
.title-cell a, .title-cell span { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
.note-link { color: var(--xhs-red); text-decoration: none; font-weight: 600; }
.note-link:hover { text-decoration: underline; }

.link-btn { color: #2563eb; cursor: pointer; margin-right: 8px; font-weight: 500; }
.link-btn.danger { color: var(--xhs-red); }

/* 运营团队 */
.op-card { background: var(--card); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 14px;
           box-shadow: var(--shadow); border: 1px solid var(--line); transition: .2s; }
.op-card:hover { box-shadow: var(--shadow-lg); }
.op-head { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.op-name { font-weight: 700; font-size: 16px; }
.op-meta { color: #999; font-size: 12px; }
.badge-off { background: #fee2e2; color: #dc2626; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; margin-left: 6px; }
.btn.warn { background: #fef3c7; color: #b45309; border-color: #fcd34d; }
.btn.warn:hover { background: #fde68a; }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; padding-right: 6px; }
.cur-user { color: #fff; font-size: 14px; font-weight: 600; opacity: .95; white-space: nowrap; }
.btn-logout { background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.55); color: #fff; padding: 6px 14px; border-radius: 9px; font-size: 13px; cursor: pointer; transition: background .15s; }
.btn-logout:hover { background: rgba(255,255,255,.34); }
.warn { color: #b45309; }
.acc-table { margin-top: 12px; }
.acc-block { padding: 11px 0; border-top: 1px dashed #eee; }
.acc-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.acc-name { font-weight: 700; font-size: 14px; }
.acc-link { color: #2563eb; font-size: 13px; }
.acc-stats { color: #999; font-size: 12px; }
.acc-today { display: inline-flex; align-items: center; }
.acc-today input { padding: 7px 9px; border: 1px solid #e3e6ec; border-radius: 8px; font-size: 13px; outline: none; }
.acc-today input:focus { border-color: var(--xhs-red); box-shadow: 0 0 0 3px rgba(255,46,77,.08); }
.acc-daily { margin-top: 8px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.acc-daily-lbl { color: #888; font-size: 12px; }
.day-chip { display: inline-block; padding: 3px 8px; border-radius: 7px; background: #f2f3f5; color: #bcbfc6;
            font-size: 12px; font-variant-numeric: tabular-nums; }
.day-chip.on { background: #e8f7ee; color: #16a34a; font-weight: 700; }

/* 图表 */
.chart svg { width: 100%; height: 240px; }

/* ===== 弹窗 ===== */
.modal { position: fixed; inset: 0; background: rgba(20,20,30,.5); backdrop-filter: blur(3px);
         display: flex; align-items: center; justify-content: center; z-index: 50; animation: fade .2s ease; }
.modal.hidden { display: none; }
.modal-box { background: #fff; border-radius: 18px; width: 480px; max-width: 92vw; max-height: 88vh; overflow: auto;
             box-shadow: 0 24px 60px rgba(20,20,40,.30); }
.modal-head { display: flex; justify-content: space-between; align-items: center;
              padding: 16px 20px; border-bottom: 1px solid var(--line); font-weight: 700; font-size: 15px; }
.modal-head button { background: none; border: none; font-size: 18px; cursor: pointer; color: #9aa0ab; }
.modal-head button:hover { color: var(--xhs-red); }
.modal-body { padding: 20px; }
.field { margin-bottom: 14px; }
.field label { display: block; margin-bottom: 6px; color: #6b7280; font-size: 13px; font-weight: 500; }
.field input, .field textarea, .field select { width: 100%; padding: 10px 12px;
              border: 1px solid #e3e6ec; border-radius: 10px; font-size: 14px; outline: none; transition: .18s; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--xhs-red); box-shadow: 0 0 0 3px rgba(255,46,77,.08); }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 10px; }

.toast { position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%);
         background: rgba(31,36,48,.94); color: #fff; padding: 11px 20px; border-radius: 10px; z-index: 9999;
         box-shadow: 0 8px 24px rgba(0,0,0,.25); font-size: 14px; }
.toast.hidden { display: none; }
#test-result { background: #1e1e1e; color: #5dff8f; padding: 14px; border-radius: 10px;
               margin-top: 14px; white-space: pre-wrap; font-size: 12px; max-height: 220px; overflow: auto; }
textarea { font-family: monospace; }

/* ===== 访问口令遮罩（登录页） ===== */
.login-overlay { position: fixed; inset: 0; z-index: 999;
                 display: flex; align-items: center; justify-content: center; padding: 20px;
                 background:
                   radial-gradient(1100px 600px at 8% -10%, #ffd9e1 0%, transparent 55%),
                   radial-gradient(1000px 700px at 112% 8%, #ffe6cc 0%, transparent 50%),
                   radial-gradient(900px 900px at 50% 120%, #f1d8ff 0%, transparent 55%),
                   linear-gradient(135deg, #fff5f7 0%, #fdeef2 100%);
                 overflow: hidden; }
.login-overlay.hidden { display: none; }
.login-overlay::before, .login-overlay::after { content: ""; position: absolute; border-radius: 50%;
                 background: radial-gradient(circle, rgba(255,46,77,.10), transparent 70%); }
.login-overlay::before { width: 380px; height: 380px; top: -120px; right: -100px; animation: float1 9s ease-in-out infinite; }
.login-overlay::after  { width: 300px; height: 300px; bottom: -120px; left: -80px; animation: float2 11s ease-in-out infinite; }
@keyframes float1 { 0%,100%{ transform: translateY(0);} 50%{ transform: translateY(24px);} }
@keyframes float2 { 0%,100%{ transform: translateY(0);} 50%{ transform: translateY(-22px);} }

.login-card { width: 372px; max-width: 100%; position: relative; z-index: 1;
              background: rgba(255,255,255,.92); backdrop-filter: blur(16px);
              border: 1px solid rgba(255,255,255,.65); border-radius: 26px;
              padding: 34px 34px 30px; text-align: center;
              box-shadow: 0 26px 64px rgba(255,46,77,.18), 0 10px 28px rgba(20,20,40,.10);
              animation: pop .35s cubic-bezier(.2,.8,.3,1.1); }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.97);} to { opacity:1; transform:none; } }

.login-brand { margin-bottom: 18px; }
.login-logo { width: 68px; height: 68px; border-radius: 22px; margin: 0 auto 12px;
              display: flex; align-items: center; justify-content: center; font-size: 34px;
              background: linear-gradient(135deg, var(--xhs-pink), var(--xhs-red));
              box-shadow: 0 12px 26px rgba(255,46,77,.38); }
.login-app { font-weight: 800; font-size: 19px; color: var(--ink); letter-spacing: .3px; }
.login-sub { font-size: 11px; letter-spacing: 2px; color: var(--muted); margin-top: 4px; }

.login-title { font-size: 18px; font-weight: 700; color: var(--ink); margin-top: 6px; }
.login-hint { color: #9aa0ab; font-size: 12.5px; margin: 8px 0 20px; line-height: 1.6; }

.login-field { display: flex; align-items: center; gap: 10px; background: #f6f7fb;
               border: 1.5px solid transparent; border-radius: 12px; padding: 0 14px; margin-bottom: 14px;
               transition: .2s; }
.login-field:focus-within { border-color: var(--xhs-red); background: #fff;
                            box-shadow: 0 0 0 4px rgba(255,46,77,.09); }
.login-field .lf-icon { font-size: 15px; opacity: .65; }
.login-field input { border: none; background: transparent; outline: none; padding: 13px 0; font-size: 15px; flex: 1; color: var(--ink); }
.lf-eye { cursor: pointer; font-size: 13px; opacity: .55; user-select: none; padding-left: 4px; }
.lf-eye:hover { opacity: .9; }
.login-btn:disabled { opacity: .7; cursor: not-allowed; }
.login-err { color: var(--xhs-red); font-size: 13px; min-height: 20px; margin-top: 10px; text-align: center; font-weight: 600; }

.login-btn { width: 100%; padding: 13px; font-size: 15px; font-weight: 700; border: none; border-radius: 12px;
             background: linear-gradient(135deg, var(--xhs-pink), var(--xhs-red)); color: #fff; cursor: pointer;
             box-shadow: 0 12px 26px rgba(255,46,77,.34); transition: .2s; margin-top: 4px; }
.login-btn:hover { transform: translateY(-1px); box-shadow: 0 16px 32px rgba(255,46,77,.42); }
.login-btn:active { transform: translateY(0); }

.login-err { color: var(--xhs-red); font-size: 13px; margin-top: 12px; min-height: 16px; font-weight: 500; }
