/* ============================================================
   PetContent 设计系统
   基调：暖米背景 + 深松绿主色 + 琥珀强调，传达「天然、可信、有温度」
   ============================================================ */
:root {
  --bg: #faf7f2;
  --bg-deep: #f2ece1;
  --surface: #ffffff;
  --surface-2: #f7f3ea;

  --ink: #1c2321;
  --ink-2: #55635d;
  --ink-3: #8b9993;

  --line: #e9e2d6;
  --line-strong: #d9d0c0;

  --brand: #17604f;
  --brand-2: #2c8a72;
  --brand-deep: #0e352d;
  --brand-soft: #e6f2ee;

  --accent: #dd9538;
  --accent-soft: #fbf0dd;

  --ok: #2f7d5c;
  --ok-soft: #e7f4ee;
  --warn: #b9821f;
  --warn-soft: #fbf2dd;
  --danger: #bc4029;
  --danger-soft: #fbe9e4;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(28, 35, 33, .05);
  --shadow: 0 1px 2px rgba(28, 35, 33, .04), 0 14px 34px -22px rgba(28, 35, 33, .35);
  --font: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-2); }

/* ---------------- 布局 ---------------- */
.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 232px;
  flex: 0 0 232px;
  background: linear-gradient(180deg, #17493e 0%, #0f352d 100%);
  color: rgba(255, 255, 255, .74);
  padding: 22px 14px 18px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 22px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, #e8a94a, #d0762c);
  display: grid; place-items: center;
  font-size: 17px; font-weight: 700; color: #3a220c;
  box-shadow: 0 6px 16px -6px rgba(232, 169, 74, .8);
}
.brand-name { color: #fff; font-weight: 650; font-size: 15px; letter-spacing: .3px; }
.brand-sub { font-size: 11px; color: rgba(255, 255, 255, .45); letter-spacing: .6px; }

.nav-group { margin: 14px 0 6px; padding: 0 10px; font-size: 11px; letter-spacing: 1.4px; color: rgba(255,255,255,.32); }
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; margin: 2px 0;
  border-radius: 9px;
  color: rgba(255, 255, 255, .74);
  font-size: 13.5px;
  position: relative;
  transition: background .15s, color .15s;
}
.nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav a.active { background: rgba(255, 255, 255, .12); color: #fff; font-weight: 600; }
.nav a.active::before {
  content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px;
  width: 3px; border-radius: 0 3px 3px 0; background: var(--accent);
}
.nav .ico { width: 18px; text-align: center; opacity: .85; }

.sidebar-foot { margin-top: 20px; padding: 12px; border-radius: 12px; background: rgba(255,255,255,.05); font-size: 11.5px; line-height: 1.6; color: rgba(255,255,255,.5); }
.dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #6fcf97; margin-right: 6px; }
.dot.off { background: #d98c72; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 30px 14px;
  background: linear-gradient(180deg, rgba(250,247,242,.96), rgba(250,247,242,.82));
  backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 20;
  border-bottom: 1px solid rgba(233, 226, 214, .7);
}
.page-title { font-size: 19px; font-weight: 650; letter-spacing: .2px; }
.page-sub { font-size: 12.5px; color: var(--ink-3); margin-top: 1px; }
.top-actions { display: flex; gap: 8px; align-items: center; }

.content { padding: 22px 30px 48px; max-width: 1360px; width: 100%; }

/* ---------------- 通用 ---------------- */
.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(320px, .9fr); gap: 18px; align-items: start; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}
.card.tight { padding: 14px 16px; }
.card-title { font-size: 14.5px; font-weight: 650; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card-sub { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.card + .card { margin-top: 16px; }

.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.spacer { flex: 1; }
.muted { color: var(--ink-3); }
.small { font-size: 12px; }
.mono { font-variant-numeric: tabular-nums; }

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 15px; border-radius: 10px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink);
  font-family: inherit; font-size: 13px; font-weight: 550; cursor: pointer;
  transition: all .15s ease;
  white-space: nowrap;
}
.btn:hover { border-color: var(--ink-3); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary {
  background: linear-gradient(135deg, #1d7059, #17604f);
  border-color: #17604f; color: #fff;
  box-shadow: 0 6px 16px -8px rgba(23, 96, 79, .9);
}
.btn-primary:hover { background: linear-gradient(135deg, #23836a, #17604f); border-color: #17604f; }
.btn-accent { background: linear-gradient(135deg, #e9a94c, #dd9538); border-color: #dd9538; color: #3d2606; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { color: var(--danger); border-color: #ecc9c0; background: var(--danger-soft); }
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 8px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }

/* ---------------- 标签 / 徽章 ---------------- */
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 9px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--line);
  font-size: 11.5px; color: var(--ink-2);
}
.tag-brand { background: var(--brand-soft); border-color: #cbe4da; color: #17604f; }
.tag-accent { background: var(--accent-soft); border-color: #f0d9b3; color: #8a5c14; }
.tag-ok { background: var(--ok-soft); border-color: #cbe6d9; color: #22694c; }
.tag-warn { background: var(--warn-soft); border-color: #efdcb4; color: #8a5f10; }
.tag-danger { background: var(--danger-soft); border-color: #efc9c0; color: #a33522; }

.badge { font-size: 11px; padding: 1px 7px; border-radius: 6px; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); }
.badge-red { background: var(--danger-soft); color: var(--danger); border-color: #efc9c0; }
.badge-yellow { background: var(--warn-soft); color: var(--warn); border-color: #efdcb4; }
.badge-green { background: var(--ok-soft); color: var(--ok); border-color: #cbe6d9; }

/* ---------------- 统计卡 ---------------- */
.stat { padding: 16px 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); position: relative; overflow: hidden; }
.stat::after { content: ""; position: absolute; right: -30px; top: -30px; width: 90px; height: 90px; border-radius: 50%; background: radial-gradient(circle, rgba(44,138,114,.10), transparent 70%); }
.stat-label { font-size: 12px; color: var(--ink-3); letter-spacing: .3px; }
.stat-value { font-size: 30px; font-weight: 680; line-height: 1.2; margin-top: 4px; font-variant-numeric: tabular-nums; letter-spacing: -.5px; }
.stat-hint { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }
.stat.accent .stat-value { color: var(--accent); }
.stat.danger .stat-value { color: var(--danger); }

/* ---------------- 表格 ---------------- */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-weight: 600; color: var(--ink-3); font-size: 11.5px; letter-spacing: .5px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
td { padding: 10px; border-bottom: 1px solid #f3eee5; vertical-align: top; }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #fbf8f2; }

/* ---------------- 表单 ---------------- */
label.field { display: block; margin-bottom: 12px; }
.field-label { font-size: 12px; color: var(--ink-2); margin-bottom: 5px; display: block; font-weight: 550; }
input[type=text], input[type=password], input[type=number], select, textarea {
  width: 100%; padding: 9px 11px;
  border: 1px solid var(--line-strong); border-radius: 10px;
  background: #fff; color: var(--ink);
  font-family: inherit; font-size: 13px; line-height: 1.6;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand-2);
  box-shadow: 0 0 0 3px rgba(44, 138, 114, .13);
}
textarea { resize: vertical; min-height: 90px; }
textarea.editor { min-height: 460px; font-size: 14px; line-height: 1.9; }
.hint { font-size: 11.5px; color: var(--ink-3); margin-top: 4px; }

/* ---------------- 评分 ---------------- */
.score-ring {
  width: 92px; height: 92px; border-radius: 50%;
  display: grid; place-items: center; position: relative;
  background: conic-gradient(var(--ring-color) calc(var(--pct) * 1%), #efe9de 0);
}
.score-ring::before { content: ""; position: absolute; inset: 8px; border-radius: 50%; background: var(--surface); }
.score-inner { position: relative; text-align: center; line-height: 1.15; }
.score-num { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.score-cap { font-size: 10px; color: var(--ink-3); letter-spacing: .5px; }

.bar { height: 6px; border-radius: 999px; background: #efe9de; overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--brand-2), var(--brand)); }

/* ---------------- 合规问题 ---------------- */
.issue {
  border-left: 3px solid var(--line-strong);
  background: #fff;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
  border: 1px solid var(--line);
  border-left-width: 3px;
}
.issue.red { border-left-color: var(--danger); background: linear-gradient(90deg, var(--danger-soft), #fff 60%); }
.issue.yellow { border-left-color: var(--warn); background: linear-gradient(90deg, var(--warn-soft), #fff 60%); }
.issue-head { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; }
.issue-hit { font-family: ui-monospace, Menlo, Consolas, monospace; background: #fff6f4; border: 1px dashed #e9c3ba; padding: 1px 6px; border-radius: 5px; font-size: 12px; }
.issue-body { font-size: 12px; color: var(--ink-2); margin-top: 3px; }
.issue-fix { font-size: 12px; color: var(--ok); margin-top: 2px; }
.issue-basis { font-size: 11px; color: var(--ink-3); margin-top: 2px; }

/* ---------------- 热点 ---------------- */
.hot-item { display: flex; align-items: center; gap: 12px; padding: 10px 2px; border-bottom: 1px solid #f3eee5; }
.hot-item:last-child { border-bottom: none; }
.hot-rank { width: 22px; text-align: center; font-weight: 700; color: var(--ink-3); font-variant-numeric: tabular-nums; font-size: 12px; }
.hot-rank.top { color: var(--accent); }
.hot-title { flex: 1; min-width: 0; font-size: 13.5px; }
.hot-meta { display: flex; gap: 6px; align-items: center; }
.hot-score { font-variant-numeric: tabular-nums; font-weight: 650; width: 34px; text-align: right; font-size: 13px; }

/* ---------------- 草稿卡 ---------------- */
.draft-card { display: flex; flex-direction: column; height: 100%; }
.draft-excerpt { color: var(--ink-2); font-size: 12.5px; line-height: 1.75; margin: 8px 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------------- 空状态 ---------------- */
.empty { text-align: center; padding: 40px 20px; color: var(--ink-3); }
.empty-icon { font-size: 30px; opacity: .45; margin-bottom: 8px; }
.empty-title { font-size: 14px; color: var(--ink-2); font-weight: 600; }
.empty-hint { font-size: 12.5px; margin-top: 3px; }

/* ---------------- 提示条 ---------------- */
.flash { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 11px; background: var(--brand-soft); border: 1px solid #cbe4da; color: #14584a; font-size: 13px; margin-bottom: 16px; }
.flash.warn { background: var(--warn-soft); border-color: #efdcb4; color: #7d5510; }
.flash.danger { background: var(--danger-soft); border-color: #efc9c0; color: #993323; }

/* ---------------- 分段控件 ---------------- */
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: none; background: transparent; padding: 5px 12px; border-radius: 7px; font-family: inherit; font-size: 12.5px; color: var(--ink-2); cursor: pointer; }
.seg button.on { background: #fff; color: var(--brand); font-weight: 650; box-shadow: var(--shadow-sm); }

/* ---------------- 平台选择 ---------------- */
.platform-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 8px; }
.platform-chip {
  display: flex; align-items: center; gap: 7px;
  padding: 8px 10px; border-radius: 10px;
  border: 1px solid var(--line-strong); background: #fff;
  cursor: pointer; font-size: 12.5px; user-select: none;
  transition: all .12s;
}
.platform-chip:hover { border-color: var(--brand-2); }
.platform-chip input { display: none; }
.platform-chip:has(input:checked) { background: var(--brand-soft); border-color: var(--brand-2); color: var(--brand); font-weight: 600; }
.platform-chip .pf-form { font-size: 10.5px; color: var(--ink-3); }

/* ---------------- 生成结果 ---------------- */
.gen-card { border: 1px solid var(--line); border-radius: 14px; background: #fff; overflow: hidden; }
.gen-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.gen-body { padding: 14px; white-space: pre-wrap; font-size: 13.5px; line-height: 1.9; max-height: 420px; overflow-y: auto; }
.gen-foot { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--line); }

.spinner { width: 14px; height: 14px; border: 2px solid #d9d0c0; border-top-color: var(--brand); border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.toast {
  position: fixed; right: 24px; bottom: 24px; z-index: 100;
  background: #1c2321; color: #fff; padding: 11px 16px; border-radius: 11px;
  font-size: 13px; box-shadow: 0 14px 40px -12px rgba(0,0,0,.5);
  opacity: 0; transform: translateY(8px); transition: all .2s; pointer-events: none;
}
.toast.show { opacity: 1; transform: translateY(0); }

/* ---------------- 登录页 ---------------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(1200px 700px at 20% 10%, #eef6f1, transparent), radial-gradient(900px 600px at 90% 80%, #fbf1de, transparent), var(--bg); }
.login-card { width: 360px; background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 30px; box-shadow: 0 30px 70px -40px rgba(28,35,33,.5); }
.login-logo { width: 46px; height: 46px; border-radius: 14px; background: linear-gradient(135deg, #e8a94a, #d0762c); display: grid; place-items: center; font-size: 22px; margin-bottom: 16px; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 1080px) {
  .split { grid-template-columns: 1fr; }
  .cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .sidebar { display: none; }
  .content { padding: 16px; }
  .topbar { padding: 14px 16px; }
  .cols-2, .cols-3, .cols-4 { grid-template-columns: 1fr; }
}

@media print {
  .sidebar, .topbar, .btn { display: none !important; }
  .content { padding: 0; }
  .card { box-shadow: none; border: none; }
}
