* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f5f7fb; color: #1e293b; line-height: 1.6; padding-bottom: 64px;
}
.screen { max-width: 720px; margin: 0 auto; min-height: 100vh; }
.hidden { display: none !important; }
.muted { color: #94a3b8; }
.small { font-size: 12px; }
.hint { font-size: 11px; color: #94a3b8; margin: 8px 2px; }
.err { color: #dc2626; font-size: 13px; margin-top: 10px; min-height: 18px; }

/* 登录 */
.login-box { max-width: 360px; margin: 15vh auto; padding: 32px 24px; background: #fff;
  border-radius: 18px; box-shadow: 0 10px 40px rgba(15,23,42,.08); text-align: center; }
.login-logo { font-size: 42px; }
.login-box h1 { font-size: 22px; margin: 10px 0 4px; }
.login-box p.muted { margin-bottom: 24px; }
input { width: 100%; padding: 12px 14px; margin-bottom: 12px; border: 1px solid #e2e8f0;
  border-radius: 10px; font-size: 15px; background: #f8fafc; }
button { cursor: pointer; font-family: inherit; }
.primary { width: 100%; padding: 13px; border: none; border-radius: 10px; color: #fff;
  font-size: 15px; font-weight: 700; background: linear-gradient(135deg,#4f46e5,#6366f1); }
.ghost { background: none; border: none; color: #64748b; font-size: 14px; padding: 6px; }

/* 顶栏 */
.topbar { display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; background: linear-gradient(135deg,#4f46e5,#6366f1); color: #fff; }
.brand { font-weight: 700; }
.topbar .ghost { color: #fff; }

/* 筛选 */
.filter-bar { display: flex; gap: 8px; padding: 14px 16px 8px; align-items: center; flex-wrap: wrap; }
.chip { border: 1px solid #e2e8f0; background: #fff; color: #64748b; border-radius: 999px;
  padding: 6px 14px; font-size: 13px; }
.chip.active { background: #eef2ff; color: #4338ca; border-color: #c7d2fe; font-weight: 600; }
.count { margin-left: auto; font-size: 12px; color: #94a3b8; }

/* 文案列表 */
.post-list { padding: 4px 16px; }
.post-card { background: #fff; border: 1px solid #eef2f7; border-radius: 14px;
  padding: 14px; margin-bottom: 12px; box-shadow: 0 2px 10px rgba(15,23,42,.03); cursor: pointer; }
.post-card .date { font-size: 11px; color: #94a3b8; }
.post-card h3 { font-size: 15px; margin: 5px 0 6px; }
.post-card .excerpt { font-size: 12px; color: #64748b; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.metrics { display: flex; gap: 6px; margin-top: 10px; border-top: 1px dashed #e2e8f0; padding-top: 10px; }
.metric { flex: 1; text-align: center; }
.metric .num { font-size: 14px; font-weight: 800; color: #4338ca; }
.metric .lab { font-size: 10px; color: #94a3b8; margin-top: 2px; }
.badge-locked { font-size: 10px; color: #f59e0b; }

/* 详情 */
#detailView { padding: 14px 16px; }
#detailView h2 { font-size: 18px; margin: 10px 0 2px; }
.content-box { background: #fff; border: 1px solid #eef2f7; border-radius: 12px;
  padding: 14px; font-size: 13px; line-height: 1.7; white-space: pre-wrap; margin-top: 12px; }
.sec-title { font-size: 13px; font-weight: 700; color: #475569; margin: 18px 0 10px;
  display: flex; align-items: center; gap: 6px; }
.sec-title::before { content: ""; width: 3px; height: 13px; background: #4f46e5; border-radius: 2px; }
.metric-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.metric-field { background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; padding: 8px 10px; }
.metric-field label { display: block; font-size: 11px; color: #94a3b8; margin-bottom: 4px; }
.metric-field input { margin: 0; padding: 6px 8px; font-size: 15px; font-weight: 700; background: transparent; }

/* 汇总 */
.totals { display: flex; gap: 10px; padding: 0 16px; }
.total-card { flex: 1; background: linear-gradient(135deg,#eef2ff,#e0e7ff); border-radius: 12px;
  padding: 12px; text-align: center; }
.total-card .lab { font-size: 11px; color: #6366f1; }
.total-card .num { font-size: 20px; font-weight: 800; color: #4338ca; }
.table { margin: 0 16px; background: #fff; border: 1px solid #eef2f7; border-radius: 12px; padding: 6px 12px; }
.table-row { display: flex; font-size: 12px; padding: 8px 0; border-bottom: 1px dashed #eef2f7; }
.table-row:last-child { border-bottom: none; }
.table-row.head { color: #94a3b8; font-size: 11px; }
.table-row span { flex: 1; text-align: right; }
.table-row span:first-child { flex: 1.4; text-align: left; }
.table-row .hl { font-weight: 700; color: #4338ca; }

/* 底部 Tab */
.tabbar { position: fixed; bottom: 0; left: 0; right: 0; display: flex; justify-content: space-around;
  background: #fff; border-top: 1px solid #eef2f7; padding: 10px 0; z-index: 10; }
.tab { background: none; border: none; color: #94a3b8; font-size: 14px; }
.tab.active { color: #4f46e5; font-weight: 700; }

/* toast：必须 pointer-events:none，避免吞点击 */
.toast { position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%);
  background: rgba(15,23,42,.92); color: #fff; padding: 10px 18px; border-radius: 999px;
  font-size: 13px; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 999; }
.toast.show { opacity: 1; }

@media (min-width: 600px) {
  .post-list { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .post-card { margin-bottom: 0; }
}
