/* ============================================================
   SaaS 防投诉防封平台 全局样式
   主色 #165DFF 深海蓝 | 辅色 #c97a4f 柔和赭红 | 底色 #fafafa
   ============================================================ */

:root {
    --c-bg:        #fafafa;
    --c-surface:   #ffffff;
    --c-border:    #ececec;
    --c-text:      #1a1f2c;
    --c-muted:     #6b7280;
    --c-primary:   #165DFF;
    --c-primary-h: #2f6dff;
    --c-primary-d: #0e4fd8;
    --c-accent:    #c97a4f;
    --c-ok:        #2ba471;
    --c-no:        #d34440;
    --c-warn:      #c9851b;
    --shadow:      0 4px 18px rgba(22, 93, 255, 0.06);
    --shadow-hover:0 8px 28px rgba(22, 93, 255, 0.12);
    --radius:      10px;
    --radius-sm:   6px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    background: var(--c-bg);
    color: var(--c-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, .hero-title, .section-title, .auth-title, .pay-title, .brand-name {
    font-family: Georgia, "Times New Roman", serif;
    font-weight: 600;
    letter-spacing: .5px;
}
a { color: var(--c-primary); text-decoration: none; }
a:hover { color: var(--c-primary-d); }
code, .mono { font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace; font-size: 12.5px; }
.muted { color: var(--c-muted); }
.muted-sm { color: var(--c-muted); font-size: 12.5px; }
.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 9px 18px; border-radius: var(--radius-sm);
    border: 1px solid transparent; cursor: pointer;
    font-size: 14px; line-height: 1; transition: all .18s ease;
    text-decoration: none; user-select: none;
    background: var(--c-surface); color: var(--c-text);
}
.btn-primary { background: var(--c-primary); color: #fff; }
.btn-primary:hover { background: var(--c-primary-h); color: #fff; transform: translateY(-1px); box-shadow: 0 6px 14px rgba(22, 93, 255, 0.25); }
.btn-ghost { background: transparent; color: var(--c-primary); border: 1px solid var(--c-border); }
.btn-ghost:hover { border-color: var(--c-primary); background: rgba(22, 93, 255, 0.04); transform: translateY(-1px); }
.btn-sm { padding: 6px 12px; font-size: 12.5px; }
.btn-block { width: 100%; }

/* ---------- Hero (首页) ---------- */
.hero {
    padding: 80px 20px 60px;
    text-align: center;
    background:
        radial-gradient(circle at 20% 0%, rgba(22, 93, 255, 0.06), transparent 50%),
        radial-gradient(circle at 90% 30%, rgba(201, 122, 79, 0.05), transparent 55%),
        var(--c-bg);
}
.hero-inner { max-width: 760px; margin: 0 auto; }
.hero-title { font-size: 38px; margin: 0 0 14px; color: var(--c-text); }
.hero-sub { font-size: 16px; color: var(--c-muted); margin: 0 0 30px; }
.hero-cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
@media (max-width: 640px) { .hero-title { font-size: 28px; } .hero { padding: 56px 20px 40px; } }

/* ---------- Section ---------- */
.systems, .features { padding: 60px 0; }
.section-title { font-size: 26px; margin: 0 0 6px; text-align: center; }
.section-desc { color: var(--c-muted); text-align: center; margin: 0 0 36px; }

/* ---------- Cards ---------- */
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 820px) { .cards { grid-template-columns: 1fr; } }
.card {
    background: var(--c-surface); border: 1px solid var(--c-border);
    border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow);
    transition: all .2s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); border-color: rgba(22, 93, 255, .2); }
.card-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.card-head h3 { margin: 0; font-size: 19px; }
.card-icon {
    width: 44px; height: 44px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-family: Georgia, serif; font-size: 20px;
    flex-shrink: 0;
}
.card-icon-a { background: linear-gradient(135deg, #165DFF, #2f6dff); }
.card-icon-b { background: linear-gradient(135deg, #c97a4f, #d99463); }
.card-list { list-style: none; padding: 0; margin: 0 0 24px; }
.card-list li { padding: 8px 0; border-bottom: 1px dashed var(--c-border); color: var(--c-text); }
.card-list li::before { content: "✓"; color: var(--c-primary); margin-right: 10px; }
.card-price { font-size: 28px; color: var(--c-text); margin-bottom: 16px; font-family: Georgia, serif; }
.card-price .unit { font-size: 14px; color: var(--c-muted); }
.card-actions { display: flex; gap: 10px; }

/* ---------- Features grid ---------- */
.features-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
@media (max-width: 820px) { .features-grid { grid-template-columns: 1fr 1fr; } }
.feature { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); padding: 22px; }
.feature .ft-no { font-family: Georgia, serif; font-size: 22px; color: var(--c-primary); margin-bottom: 8px; }
.feature h4 { margin: 0 0 6px; font-size: 16px; }
.feature p { margin: 0; color: var(--c-muted); font-size: 13px; }

/* ---------- Footer ---------- */
.footer { padding: 30px 0; border-top: 1px solid var(--c-border); text-align: center; color: var(--c-muted); }
.footer-brand { font-family: Georgia, serif; color: var(--c-text); margin-right: 12px; }

/* ---------- Auth (登录/注册) ---------- */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 40px 20px; }
.auth-card {
    background: var(--c-surface); border: 1px solid var(--c-border);
    border-radius: var(--radius); padding: 36px; width: 100%; max-width: 380px;
    box-shadow: var(--shadow);
}
.auth-brand { display: flex; align-items: center; gap: 10px; justify-content: center; margin-bottom: 18px; }
.brand-logo {
    width: 36px; height: 36px; border-radius: 10px;
    background: linear-gradient(135deg, var(--c-primary), #2f6dff);
    color: #fff; font-family: Georgia, serif; font-size: 18px;
    display: flex; align-items: center; justify-content: center;
}
.brand-name { font-family: Georgia, serif; font-size: 19px; color: var(--c-text); }
.auth-title { font-size: 22px; margin: 0 0 22px; text-align: center; }
.field { display: block; margin-bottom: 16px; }
.field > span { display: block; margin-bottom: 6px; font-size: 13px; color: var(--c-muted); }
.field input, .field textarea, .field select {
    width: 100%; padding: 10px 12px; border: 1px solid var(--c-border);
    border-radius: var(--radius-sm); background: var(--c-surface);
    font-size: 14px; color: var(--c-text); transition: border-color .15s;
    font-family: inherit;
}
.field input:focus, .field textarea:focus, .field select:focus {
    outline: none; border-color: var(--c-primary); box-shadow: 0 0 0 3px rgba(22, 93, 255, .1);
}
.field textarea { resize: vertical; min-height: 110px; }
.auth-foot { display: flex; justify-content: space-between; margin-top: 14px; font-size: 12.5px; }

/* ---------- Alerts ---------- */
.alert { padding: 10px 14px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 13px; }
.alert-error   { background: rgba(211, 68, 64, .08); color: var(--c-no); border: 1px solid rgba(211, 68, 64, .2); }
.alert-success { background: rgba(43, 164, 113, .08); color: var(--c-ok); border: 1px solid rgba(43, 164, 113, .2); }

/* ---------- Layout (侧边栏布局) ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
    width: 230px; background: var(--c-surface); border-right: 1px solid var(--c-border);
    padding: 22px 0; position: sticky; top: 0; height: 100vh; overflow-y: auto;
    flex-shrink: 0;
}
.sidebar .brand { display: flex; align-items: center; gap: 10px; padding: 0 22px 22px; border-bottom: 1px solid var(--c-border); margin-bottom: 14px; }
.sidebar nav ul { list-style: none; padding: 0; margin: 0; }
.sidebar nav li a {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 22px; color: var(--c-text); font-size: 14px;
    border-left: 3px solid transparent; transition: all .15s;
}
.sidebar nav li a:hover { background: rgba(22, 93, 255, .04); color: var(--c-primary); }
.sidebar nav li.active a { background: rgba(22, 93, 255, .08); color: var(--c-primary); border-left-color: var(--c-primary); }
.sidebar nav li.disabled a { color: var(--c-muted); cursor: not-allowed; opacity: .65; }
.sidebar .ico {
    width: 24px; height: 24px; border-radius: 6px;
    background: rgba(22, 93, 255, .08); color: var(--c-primary);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 13px; font-family: Georgia, serif; flex-shrink: 0;
}
.sidebar .badge { margin-left: auto; font-size: 10.5px; padding: 2px 6px; border-radius: 8px; }
.badge.ok { background: rgba(43, 164, 113, .12); color: var(--c-ok); }
.badge.no { background: rgba(211, 68, 64, .1); color: var(--c-no); }

.main { flex: 1; min-width: 0; }
.topbar {
    height: 56px; background: var(--c-surface); border-bottom: 1px solid var(--c-border);
    display: flex; align-items: center; padding: 0 24px;
    position: sticky; top: 0; z-index: 10;
}
.topbar .hello { font-size: 13px; color: var(--c-muted); }
.content { padding: 24px; }

@media (max-width: 720px) {
    .layout { flex-direction: column; }
    .sidebar { width: 100%; height: auto; position: relative; }
    .sidebar nav ul { display: flex; flex-wrap: wrap; padding: 8px; }
    .sidebar nav li a { padding: 8px 12px; border-left: none; border-bottom: 2px solid transparent; }
    .sidebar nav li.active a { border-left: none; border-bottom-color: var(--c-primary); }
    .content { padding: 16px; }
}

/* ---------- Page head ---------- */
.page-head { margin-bottom: 18px; }
.page-head h2 { margin: 0 0 4px; font-size: 20px; }
.page-head .muted { margin: 0; }

/* ---------- Overview grid ---------- */
.overview-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 18px; }
@media (max-width: 720px) { .overview-grid { grid-template-columns: 1fr; } }
.stat-card { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.stat-card.stat-a { border-top: 3px solid var(--c-primary); }
.stat-card.stat-b { border-top: 3px solid var(--c-accent); }
.stat-name { font-size: 15px; color: var(--c-text); margin-bottom: 10px; }
.stat-tag { display: inline-block; padding: 2px 10px; border-radius: 10px; font-size: 12px; margin-bottom: 8px; }
.tag-ok { background: rgba(43, 164, 113, .12); color: var(--c-ok); }
.tag-no { background: rgba(211, 68, 64, .1); color: var(--c-no); }
.stat-val { font-size: 15px; color: var(--c-text); margin-bottom: 4px; }
.stat-sub { color: var(--c-muted); font-size: 13px; margin-bottom: 12px; }

/* ---------- Panel ---------- */
.panel { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); padding: 20px; margin-bottom: 18px; }
.panel-head { margin-bottom: 16px; padding-bottom: 10px; border-bottom: 1px solid var(--c-border); }
.panel-head h3 { margin: 0; font-size: 16px; }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.form-actions { display: flex; gap: 10px; margin-top: 16px; }

/* Switch */
.switch { display: inline-flex; align-items: center; cursor: pointer; user-select: none; }
.switch input { display: none; }
.switch span {
    width: 38px; height: 22px; border-radius: 20px; background: #d8dde6;
    position: relative; transition: background .18s;
}
.switch span::after {
    content: ""; position: absolute; top: 2px; left: 2px;
    width: 18px; height: 18px; border-radius: 50%; background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0, .2); transition: transform .18s;
}
.switch input:checked + span { background: var(--c-primary); }
.switch input:checked + span::after { transform: translateX(16px); }

/* ---------- Tables ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th, .table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--c-border); }
.table th { background: rgba(22, 93, 255, .03); color: var(--c-muted); font-weight: 500; font-size: 12.5px; }
.table tr:hover td { background: rgba(22, 93, 255, .025); }
.table .empty { text-align: center; color: var(--c-muted); padding: 28px 0; }
.ellipsis { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inline-form { display: inline; }
.link { background: none; border: none; color: var(--c-primary); cursor: pointer; padding: 0; font-size: 13px; margin-right: 8px; }
.link-danger { color: var(--c-no); }

/* ---------- Pagination ---------- */
.pagination { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.pagination a { padding: 5px 10px; border: 1px solid var(--c-border); border-radius: 4px; color: var(--c-text); font-size: 12.5px; }
.pagination a.cur { background: var(--c-primary); color: #fff; border-color: var(--c-primary); }

/* ---------- Quick links ---------- */
.quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 640px) { .quick-grid { grid-template-columns: 1fr; } }
.quick-link {
    display: block; padding: 12px 14px; border: 1px solid var(--c-border);
    border-radius: var(--radius-sm); color: var(--c-text); transition: all .15s;
}
.quick-link:hover { border-color: var(--c-primary); color: var(--c-primary); background: rgba(22, 93, 255, .03); }

/* ---------- Callout ---------- */
.callout { background: rgba(22, 93, 255, .04); border: 1px solid rgba(22, 93, 255, .15); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 18px; font-size: 13px; }
.cb-url { display: inline-block; margin: 4px 8px 4px 0; padding: 4px 8px; background: var(--c-surface); border-radius: 4px; border: 1px solid var(--c-border); }
.tutorial { margin: 0; padding-left: 18px; }
.tutorial li { padding: 6px 0; color: var(--c-text); }
.tips { margin: 0; padding-left: 18px; }
.tips li { padding: 6px 0; }
.tips code { background: rgba(22, 93, 255, .06); padding: 1px 6px; border-radius: 3px; }

/* ---------- Pay ---------- */
.pay-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 40px 20px; background: var(--c-bg); }
.pay-card { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); padding: 36px; max-width: 380px; width: 100%; text-align: center; box-shadow: var(--shadow); }
.pay-title { font-size: 20px; margin: 0 0 12px; }
.pay-amount { font-size: 32px; color: var(--c-primary); font-family: Georgia, serif; margin-bottom: 6px; }
.pay-desc { color: var(--c-muted); margin-bottom: 18px; }
.pay-qr { margin: 0 auto 16px; width: 240px; height: 240px; border: 1px solid var(--c-border); border-radius: var(--radius-sm); overflow: hidden; }
.pay-order { font-size: 12px; color: var(--c-muted); margin-bottom: 12px; word-break: break-all; }
.pay-tips { font-size: 12.5px; color: var(--c-muted); margin-bottom: 18px; }
.pay-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.pay-status { margin: 12px 0 18px; }

/* ---------- H5 (移动端) ---------- */
.h5-page { max-width: 480px; margin: 0 auto; min-height: 100vh; background: var(--c-surface); }
.h5-hero { text-align: center; padding: 40px 20px 24px; background: linear-gradient(180deg, rgba(22, 93, 255, .08), transparent); }
.h5-hero-ico {
    width: 60px; height: 60px; border-radius: 50%;
    background: linear-gradient(135deg, var(--c-primary), #2f6dff);
    color: #fff; font-size: 30px; font-family: Georgia, serif;
    display: flex; align-items: center; justify-content: center; margin: 0 auto 16px;
}
.h5-hero-title { font-size: 22px; margin: 0 0 6px; }
.h5-hero-sub { color: var(--c-muted); font-size: 13px; margin: 0; }
.h5-form { padding: 20px; }
.h5-field { margin-bottom: 18px; }
.h5-field label { display: block; font-size: 13px; color: var(--c-muted); margin-bottom: 8px; }
.h5-field input, .h5-field textarea {
    width: 100%; padding: 12px 14px; border: 1px solid var(--c-border);
    border-radius: var(--radius-sm); font-size: 14px; background: var(--c-surface);
    font-family: inherit; color: var(--c-text);
}
.h5-field input:focus, .h5-field textarea:focus { outline: none; border-color: var(--c-primary); box-shadow: 0 0 0 3px rgba(22, 93, 255, .1); }
.h5-submit {
    width: 100%; padding: 13px; border-radius: var(--radius-sm);
    background: var(--c-primary); color: #fff; border: none; font-size: 15px;
    cursor: pointer; transition: background .18s;
}
.h5-submit:hover { background: var(--c-primary-h); }
.h5-tip { font-size: 12px; color: var(--c-muted); text-align: center; margin-top: 12px; }
.h5-success { padding: 60px 20px; text-align: center; }
.h5-success-ico {
    width: 70px; height: 70px; border-radius: 50%;
    background: linear-gradient(135deg, var(--c-ok), #34b782);
    color: #fff; font-size: 36px; display: flex; align-items: center; justify-content: center;
    margin: 0 auto 16px;
}
.h5-success h2 { margin: 0 0 8px; font-size: 20px; }
.h5-success p { margin: 0; color: var(--c-muted); font-size: 13px; }
.h5-fail { text-align: center; padding: 80px 20px; }
.h5-fail-ico {
    width: 60px; height: 60px; border-radius: 50%;
    background: rgba(211, 68, 64, .1); color: var(--c-no);
    font-size: 30px; font-family: Georgia, serif;
    display: flex; align-items: center; justify-content: center; margin: 0 auto 16px;
}
.h5-fail p { color: var(--c-muted); }

/* ---------- Page back / sub current ---------- */
.page-back { margin-bottom: 14px; }
.sub-current { font-size: 13px; color: var(--c-text); margin-bottom: 14px; padding: 10px 12px; background: rgba(22, 93, 255, .03); border-radius: var(--radius-sm); border-left: 3px solid var(--c-primary); }
.sub-current .tag { margin-left: 4px; }

/* ---------- Stats grid / trend chart ---------- */
.stats-grid { display:grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap:14px; margin-bottom:18px; }
.stat-tile { background:#fff; border:1px solid var(--c-border); border-radius:var(--radius-sm); padding:18px 16px; text-align:center; transition:transform .15s, box-shadow .15s; }
.stat-tile:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(22, 93, 255, .06); }
.stat-num { font-size: 28px; font-weight:600; color: var(--c-primary); font-family: Georgia, serif; line-height:1.2; }
.stat-label { font-size: 12px; color: var(--c-muted); margin-top:6px; }
.stat-num.text-warn { color: var(--c-warn, #d97706); }
.stat-num.text-danger { color: var(--c-danger, #dc2626); }

.trend-chart { display:flex; align-items:flex-end; gap:4px; height:180px; padding:10px 6px 4px; overflow-x:auto; }
.trend-chart-wide { height:160px; }
.trend-col { flex:0 0 28px; display:flex; flex-direction:column; align-items:center; height:100%; justify-content:flex-end; }
.trend-bars { display:flex; gap:2px; align-items:flex-end; height:140px; }
.bar { width:8px; border-radius:2px 2px 0 0; }
.bar-a { background: var(--c-primary); }
.bar-b { background: var(--c-accent); }
.trend-label { font-size:10px; color: var(--c-muted); margin-top:6px; }
.trend-num { font-size:10px; color: var(--c-text); }

.legend { font-size: 12px; color: var(--c-muted); display:flex; gap:8px; align-items:center; }
.dot { display:inline-block; width:8px; height:8px; border-radius:50%; margin-right:2px; vertical-align:middle; }
.dot-a { background: var(--c-primary); }
.dot-b { background: var(--c-accent); }

/* ---------- Tab bar ---------- */
.tab-bar { display:flex; gap:4px; margin-bottom:14px; border-bottom:1px solid var(--c-border); }
.tab { padding:8px 16px; font-size:13px; color: var(--c-muted); border-bottom:2px solid transparent; cursor:pointer; }
.tab.cur { color: var(--c-primary); border-bottom-color: var(--c-primary); font-weight:500; }

/* ---------- Messages ---------- */
.unread-row { background: rgba(22, 93, 255, .02); }
.unread-row strong { color: var(--c-primary); }
.msg-content { color: var(--c-muted); font-size:12px; line-height:1.5; }

/* ---------- Badge warn ---------- */
.badge.warn { background: var(--c-warn, #f59e0b); color:#fff; }
.tag.tag-warn { background: var(--c-warn, #f59e0b); color:#fff; }
.tag.tag-info { background: #e2e8f0; color: var(--c-text); }

/* ---------- Mini list / two cols ---------- */
.two-cols { display:grid; grid-template-columns: 1fr 1fr; gap:20px; }
.mini-h { font-size:13px; color: var(--c-text); margin-bottom:8px; }
.mini-list { list-style:none; padding:0; margin:0; font-size:12px; }
.mini-list li { padding:6px 0; border-bottom:1px dashed var(--c-border); }
.muted-sm { font-size:12px; color: var(--c-muted); }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; }

/* ---------- Ellipsis / danger link ---------- */
.ellipsis { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:300px; }
.link-danger { color: var(--c-danger, #dc2626) !important; }

/* ---------- Page head badge ---------- */
.page-head .badge { display:inline-block; margin-left:8px; vertical-align:middle; }

/* ---------- Admin stats (legacy, 兼容旧标记) ---------- */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 18px; }
@media (max-width: 720px) { .stats-grid { grid-template-columns: 1fr 1fr; } }
.stat-tile { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); padding: 18px; text-align: center; box-shadow: var(--shadow); }
.stat-num { font-family: Georgia, serif; font-size: 26px; color: var(--c-primary); margin-bottom: 4px; }
.stat-label { color: var(--c-muted); font-size: 12.5px; }
