/* ===== 站群矩阵后台 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --bg: #f4f6fa; --card: #fff; --ink: #1c2333; --sub: #7a8299;
  --brand: #2f6bff; --brand-dark: #1e4fd6; --ok: #18a058; --bad: #d64545;
  --line: #e6e9f2; --sidebar: #171c2b;
}
body { font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; background: var(--bg); color: var(--ink); }

/* ---- 登录页 ---- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #171c2b 0%, #25345e 100%); }
.login-card { width: 360px; background: #fff; border-radius: 16px; padding: 40px 36px; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.login-logo { font-size: 40px; color: var(--brand); margin-bottom: 8px; }
.login-card h1 { font-size: 22px; margin-bottom: 4px; }
.login-sub { color: var(--sub); font-size: 13px; margin-bottom: 26px; }
.login-form input { width: 100%; padding: 12px 14px; margin-bottom: 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 15px; outline: none; }
.login-form input:focus { border-color: var(--brand); }
.login-msg { color: var(--bad); font-size: 13px; min-height: 18px; margin-top: 8px; }

/* ---- 布局 ---- */
.app { display: flex; min-height: 100vh; }
.sidebar { width: 200px; background: var(--sidebar); color: #aab; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { color: #fff; font-size: 17px; font-weight: 600; padding: 22px 20px; letter-spacing: .5px; }
.sidebar nav { flex: 1; }
.nav-item { display: block; color: #99a; padding: 13px 20px; text-decoration: none; font-size: 14.5px; cursor: pointer; border-left: 3px solid transparent; }
.nav-item:hover { color: #fff; background: rgba(255,255,255,.05); }
.nav-item.active { color: #fff; background: rgba(47,107,255,.25); border-left-color: var(--brand); }
.sidebar-foot { padding: 16px 20px; font-size: 13px; }
.sidebar-foot a { color: #778; text-decoration: none; }
.sidebar-foot a:hover { color: #fff; }

.main { flex: 1; padding: 28px 32px; max-width: 1200px; }
.page { display: none; }
.page.active { display: block; }
.page-head { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.page-head h2 { font-size: 21px; }
.hint { color: var(--sub); font-size: 13px; }

/* ---- 组件 ---- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; box-shadow: 0 1px 4px rgba(20,30,60,.05); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; margin-bottom: 20px; }
.btn-primary { background: var(--brand); color: #fff; border: none; padding: 10px 18px; border-radius: 8px; font-size: 14px; cursor: pointer; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-primary:disabled { background: #9db6f5; cursor: not-allowed; }
.btn-ghost { background: #fff; color: var(--brand); border: 1px solid var(--brand); padding: 8px 14px; border-radius: 8px; font-size: 13px; cursor: pointer; }
.btn-ghost:hover { background: #f0f4ff; }
.btn-block { width: 100%; margin-top: 10px; }
.stat-summary { display: flex; gap: 16px; margin-bottom: 18px; }
.stat-chip { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px 22px; }
.stat-chip b { font-size: 22px; display: block; }
.stat-chip span { color: var(--sub); font-size: 12.5px; }

.site-name { font-size: 16px; font-weight: 600; margin-bottom: 2px; }
.site-url { color: var(--sub); font-size: 12px; text-decoration: none; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; }
.dot.on { background: var(--ok); } .dot.off { background: var(--bad); }
.site-meta { display: flex; gap: 18px; margin: 12px 0 10px; color: var(--sub); font-size: 12.5px; }
.site-meta b { color: var(--ink); font-size: 15px; }
.post-item { font-size: 13px; padding: 6px 0; border-top: 1px dashed var(--line); }
.post-item a { color: var(--ink); text-decoration: none; }
.post-item a:hover { color: var(--brand); }
.post-item .date { color: var(--sub); font-size: 11.5px; margin-left: 6px; }
.site-actions { margin-top: 10px; display: flex; gap: 8px; }
.site-actions a { font-size: 12px; color: var(--brand); text-decoration: none; border: 1px solid var(--line); padding: 4px 10px; border-radius: 6px; }

/* ---- 编辑器 ---- */
.editor-grid { display: grid; grid-template-columns: 1fr 320px; gap: 16px; align-items: start; }
.ed-title { width: 100%; font-size: 18px; font-weight: 600; border: none; border-bottom: 2px solid var(--line); padding: 10px 2px; outline: none; margin-bottom: 10px; }
.ed-title:focus { border-bottom-color: var(--brand); }
.toolbar { display: flex; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.tb { border: 1px solid var(--line); background: #f8f9fd; border-radius: 6px; padding: 5px 10px; font-size: 12.5px; cursor: pointer; }
.tb:hover { border-color: var(--brand); color: var(--brand); }
.ed-content { width: 100%; height: 420px; border: 1px solid var(--line); border-radius: 8px; padding: 14px; font-size: 14.5px; line-height: 1.7; font-family: inherit; outline: none; resize: vertical; }
.ed-content:focus { border-color: var(--brand); }
.ed-tags { width: 100%; margin-top: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 13.5px; outline: none; }
.editor-right h3 { font-size: 15px; margin-bottom: 12px; }
.target-list label { display: flex; align-items: center; gap: 8px; padding: 7px 0; font-size: 14px; cursor: pointer; border-bottom: 1px dashed var(--line); }
.target-list .catsel { margin-left: auto; max-width: 130px; border: 1px solid var(--line); border-radius: 6px; padding: 3px 4px; font-size: 12px; background: #fff; color: var(--ink); outline: none; flex-shrink: 0; }
.editor-right .row { display: flex; justify-content: space-between; align-items: center; margin: 14px 0; font-size: 13.5px; }
.editor-right select { padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; }
.publish-log { margin-top: 12px; font-size: 13px; line-height: 1.9; max-height: 220px; overflow: auto; }
.publish-log .ok { color: var(--ok); } .publish-log .err { color: var(--bad); }

/* ---- 渠道 ---- */
.chan-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.chan-icon { font-size: 26px; }
.chan-tag { font-size: 11px; padding: 2px 8px; border-radius: 10px; background: #eef2ff; color: var(--brand); }
.chan-tag.manual { background: #fff4e6; color: #c07b12; }
.chan-desc { color: var(--sub); font-size: 12.5px; margin-bottom: 10px; }
.chan-link { display: inline-block; margin-top: 8px; color: var(--brand); text-decoration: none; font-size: 13.5px; }

/* ---- 草稿箱 ---- */
.draft-card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px 20px; margin-bottom: 12px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.draft-title { font-size: 15.5px; font-weight: 600; margin-bottom: 4px; }
.draft-sub { color: var(--sub); font-size: 12.5px; }
.badge { display: inline-block; font-size: 11.5px; padding: 2px 9px; border-radius: 10px; margin-right: 6px; background: #eef2ff; color: var(--brand); }
.badge.done { background: #e6f7ee; color: var(--ok); }
.badge.warn { background: #fff4e6; color: #c07b12; }
.draft-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.draft-actions button, .draft-actions a { font-size: 12.5px; }

/* ---- 设置 ---- */
#page-settings label { display: block; font-size: 13px; color: var(--sub); margin: 12px 0 4px; }
#page-settings input { width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; outline: none; }
#page-settings input:focus { border-color: var(--brand); }
#page-settings .btn-primary { margin-top: 16px; }
#channel-guide ol { margin: 10px 0 4px 22px; line-height: 2; font-size: 13.5px; color: var(--ink); }

.toast { position: fixed; bottom: 24px; right: 24px; background: #222b45; color: #fff; padding: 12px 20px; border-radius: 10px; font-size: 13.5px; box-shadow: 0 8px 30px rgba(0,0,0,.3); display: none; z-index: 99; }
@media (max-width: 900px) { .editor-grid { grid-template-columns: 1fr; } .sidebar { width: 64px; } .brand, .nav-item { text-align: center; padding-left: 8px; padding-right: 8px; } }
