* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --g1: #5B6CFF;
    --g2: #7C4DFF;
    --grad: linear-gradient(135deg, #5B6CFF, #7C4DFF);
    --bg: #f4f6fb;
    --card: #ffffff;
    --line: #e6e9f2;
    --text: #2b2f3a;
    --muted: #8a90a3;
    --ok: #22b573;
    --warn: #f5a623;
    --danger: #e5484d;
}

body {
    font-family: -apple-system, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.6;
}

a { color: var(--g1); text-decoration: none; }
a:hover { opacity: .85; }

/* ---------- 登录页 ---------- */
.login-body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background: var(--grad);
    padding: 24px;
}
.login-bg { position: absolute; inset: 0; pointer-events: none; }
.blob { position: absolute; border-radius: 50%; background: rgba(255,255,255,.14); filter: blur(10px); }
.blob.b1 { width: 340px; height: 340px; top: -120px; left: -80px; }
.blob.b2 { width: 260px; height: 260px; bottom: -100px; right: -60px; background: rgba(255,255,255,.10); }
.blob.b3 { width: 180px; height: 180px; top: 40%; right: 12%; background: rgba(124,77,255,.28); }

.login-wrap { position: relative; width: 100%; max-width: 400px; }
.login-brand { text-align: center; color: #fff; margin-bottom: 24px; }
.login-logo {
    width: 62px; height: 62px; margin: 0 auto 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; font-weight: 700; color: #fff;
    background: rgba(255,255,255,.22);
    border: 1px solid rgba(255,255,255,.4);
    border-radius: 18px;
    backdrop-filter: blur(6px);
}
.login-brand h1 { font-size: 22px; font-weight: 700; letter-spacing: 1px; }
.login-brand p { font-size: 13px; opacity: .85; margin-top: 4px; }

.login-card {
    background: #fff;
    border-radius: 18px;
    padding: 32px;
    box-shadow: 0 24px 70px rgba(20,20,60,.25);
}
.login-card h2 { font-size: 20px; margin-bottom: 4px; }
.login-tip { color: var(--muted); font-size: 13px; margin-bottom: 22px; }

.field { position: relative; display: block; margin-bottom: 16px; }
.field-icon {
    position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
    width: 18px; height: 18px; color: var(--muted);
    display: flex; align-items: center; justify-content: center;
    pointer-events: none;
}
.field-icon svg { width: 100%; height: 100%; }
.field input {
    width: 100%;
    padding: 12px 14px 12px 44px;
    border: 1px solid var(--line);
    border-radius: 10px;
    font-size: 14px;
    transition: border-color .15s, box-shadow .15s;
}
.field input:focus { outline: none; border-color: var(--g1); box-shadow: 0 0 0 3px rgba(91,108,255,.12); }

.login-btn { width: 100%; padding: 13px; font-size: 15px; letter-spacing: 6px; border-radius: 10px; margin-top: 4px; }
.login-foot { text-align: center; color: var(--muted); font-size: 12px; margin-top: 18px; }

.login-copyright { position: relative; margin-top: 22px; color: rgba(255,255,255,.8); font-size: 12px; }

/* ---------- 提示条 ---------- */
.alert { padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; font-size: 13px; }
.alert.ok { background: #e8f8f1; color: var(--ok); }
.alert.error { background: #fdeeee; color: var(--danger); }

/* ---------- 顶部栏 ---------- */
.topbar {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 0 24px;
    height: 56px;
    color: #fff;
    background: var(--grad);
}
.topbar-brand { font-weight: 700; font-size: 16px; }
.topbar-title { font-size: 14px; opacity: .9; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 14px; font-size: 13px; }
.topbar-logout { color: #fff; padding: 4px 12px; border: 1px solid rgba(255,255,255,.5); border-radius: 20px; }
.topbar-logout:hover { opacity: 1; background: rgba(255,255,255,.15); }

/* ---------- 布局 ---------- */
.admin-layout { display: flex; min-height: calc(100vh - 56px); }

.sidebar {
    width: 220px;
    flex-shrink: 0;
    background: #fff;
    border-right: 1px solid var(--line);
    padding: 16px 12px;
}
.nav-section {
    font-size: 12px;
    color: var(--muted);
    margin: 18px 8px 6px;
    letter-spacing: .5px;
}
.nav-empty { padding: 4px 12px; color: var(--muted); font-size: 12px; }
.nav {
    display: block;
    padding: 9px 12px;
    border-radius: 8px;
    color: var(--text);
    font-size: 14px;
}
.nav:hover { background: #f0f2fa; opacity: 1; }
.nav.active { background: var(--grad); color: #fff; }

.proj-nav .sub { display: inline-block; padding: 6px 10px; font-size: 13px; }
.proj-nav .fb { color: var(--muted); font-size: 12px; }
.proj-nav a:hover { background: #f0f2fa; opacity: 1; }
.proj-nav a.active { background: var(--grad); color: #fff; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; vertical-align: middle; }
.dot.on { background: var(--ok); }
.dot.off { background: #c4c9d6; }

/* ---------- 主内容 ---------- */
.admin-main { flex: 1; padding: 24px; min-width: 0; }
.admin-main h1 { font-size: 20px; margin-bottom: 16px; }

.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 24px; }
.stat {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 18px;
}
.stat b { display: block; font-size: 28px; }
.stat span { color: var(--muted); font-size: 13px; }
.stat.warn b { color: var(--warn); }

.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.panel-head h1 { margin: 0; }

.panel {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}
.hint ul { padding-left: 20px; }
.hint li { margin-bottom: 6px; }
code { background: #f0f2fa; padding: 1px 6px; border-radius: 4px; font-size: 12px; }

/* ---------- 表格 ---------- */
.table-wrap { padding: 0; overflow: hidden; }
.table-wrap table { width: 100%; border-collapse: collapse; }
.table-wrap th, .table-wrap td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); font-size: 13px; }
.table-wrap th { background: #f8f9fd; color: var(--muted); font-weight: 600; }
.table-wrap tr:last-child td { border-bottom: none; }
.mono { font-family: Consolas, Menlo, monospace; font-size: 12px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; display: block; }
.empty { text-align: center; color: var(--muted); padding: 30px 0; }
.ops { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; white-space: nowrap; }
.ops form { display: inline; }

/* ---------- 标签 ---------- */
.tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 12px;
    background: #f0f2fa;
    color: var(--muted);
}
.tag.on { background: #e8f8f1; color: var(--ok); }
.tag.off { background: #f0f2fa; color: var(--muted); }
.tag.warn { background: #fff4e3; color: var(--warn); }
.tag.proj { background: #eceeff; color: var(--g1); }

/* ---------- 按钮 ---------- */
.btn-grad {
    display: inline-block;
    border: none;
    background: var(--grad);
    color: #fff;
    padding: 10px 22px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
}
.btn-grad:hover { opacity: .92; }
.btn-grad.sm { padding: 6px 14px; font-size: 13px; }
.btn-plain {
    display: inline-block;
    padding: 9px 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--text);
    background: #fff;
    cursor: pointer;
}
.link-btn { border: none; background: none; color: var(--g1); font-size: 13px; cursor: pointer; }
.link-btn.danger { color: var(--danger); }

/* ---------- 表单 ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 20px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid label { font-size: 13px; color: var(--text); display: block; }
.form-grid input, .form-grid textarea, .form-grid select, .filter select, .reply-form input {
    width: 100%;
    margin-top: 6px;
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
}
.form-grid input:focus, .form-grid textarea:focus, .form-grid select:focus {
    outline: none;
    border-color: var(--g1);
}
.form-grid .check { display: flex; align-items: center; gap: 8px; margin-top: 26px; }
.form-grid .check input { width: auto; margin: 0; }

.filter { display: flex; gap: 10px; }
.filter select { width: auto; min-width: 140px; }
.filter input {
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
}
.filter input:focus { outline: none; border-color: var(--g1); }

/* ---------- 反馈列表 ---------- */
.feedback-item { border-bottom: 1px solid var(--line); padding: 16px 0; }
.feedback-item:last-child { border-bottom: none; }
.feedback-item.done { background: #fbfbfe; }
.fb-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.fb-time { color: var(--muted); font-size: 12px; margin-left: auto; }
.fb-contact, .fb-openid { color: var(--muted); font-size: 12px; margin-top: 2px; }
.fb-content { margin: 8px 0; white-space: pre-wrap; }
.fb-reply { background: #f0f2fa; border-left: 3px solid var(--g1); padding: 8px 12px; margin: 8px 0; border-radius: 0 8px 8px 0; }
.fb-actions { display: flex; align-items: center; gap: 16px; margin-top: 8px; }
.reply-form { display: flex; align-items: center; gap: 10px; flex: 1; flex-wrap: wrap; }
.reply-form input { width: 320px; margin: 0; }
.reply-form .check { display: flex; align-items: center; gap: 6px; font-size: 13px; white-space: nowrap; }
.reply-form .check input { width: auto; }

@media (max-width: 900px) {
    .admin-layout { flex-direction: column; }
    .sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--line); }
    .stats { grid-template-columns: repeat(2, 1fr); }
    .form-grid { grid-template-columns: 1fr; }
}

/* ---------- 仪表盘：趋势图 / 最近动态 ---------- */
.panel-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.panel-title h2 { font-size: 16px; }
.panel-title a { font-size: 13px; }
.legend { display: inline-flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; }
.legend .lg-user { background: var(--g1); }
.legend .lg-fb { background: #ff9f43; }

.chart { display: flex; align-items: flex-end; gap: 8px; height: 160px; padding-top: 10px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; gap: 6px; }
.bar-stack { width: 100%; max-width: 34px; flex: 1; display: flex; flex-direction: column-reverse; justify-content: flex-start; align-items: center; gap: 2px; }
.bar { width: 70%; min-height: 2px; border-radius: 3px 3px 0 0; transition: height .3s; }
.bar.user { background: linear-gradient(180deg, var(--g2), var(--g1)); }
.bar.fb { background: linear-gradient(180deg, #ffb15c, #ff9f43); }
.bar-label { font-size: 11px; color: var(--muted); }

/* 最近动态 / 操作日志列表 */
.log-list { list-style: none; }
.log-list li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.log-list li:last-child { border-bottom: none; }
.log-detail { flex: 1; font-size: 13px; }
.log-time { color: var(--muted); font-size: 12px; white-space: nowrap; }

.muted-tip { color: var(--muted); font-size: 12px; margin-top: 10px; }