:root {
    --green: #07c160;
    --green-dark: #06ad56;
    --ink: #1a1b1e;
    --ink-2: #4b5563;
    --muted: #8b8f97;
    --line: #e8eaed;
    --bg: #f5f6f8;
    --card: #fff;
    --danger: #e34d59;
    --warn: #f0932b;
    --info: #2f7ee5;
    --radius: 10px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
}

body {
    background: var(--bg);
    color: var(--ink);
    font: 14px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--info); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 20px;
}

code {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 12.5px;
    background: #f2f3f5;
    padding: 2px 6px;
    border-radius: 4px;
    color: #333;
    word-break: break-all;
}

.muted { color: var(--muted); font-size: 13px; }

/* ---------------------------------------------------------- 顶部导航 */

.topbar {
    background: #fff;
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 20;
}

.topbar .wrap {
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    font-weight: 600;
    font-size: 15px;
    color: var(--ink);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.brand:hover { text-decoration: none; }

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green);
    display: inline-block;
}

.nav {
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav a {
    color: var(--ink-2);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 14px;
}

.nav a:hover {
    background: #f2f3f5;
    text-decoration: none;
}

.nav a.on {
    color: var(--green-dark);
    background: rgba(7, 193, 96, 0.1);
    font-weight: 500;
}

.nav a.quit { color: var(--muted); }

/* -------------------------------------------------------------- 布局 */

main.wrap { padding-top: 24px; padding-bottom: 40px; }

.page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.page-head h1 {
    font-size: 22px;
    margin: 0 0 4px;
    font-weight: 600;
}

.page-head p { margin: 0; }

.actions { display: flex; gap: 8px; flex-wrap: wrap; }

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px 20px;
    margin-bottom: 16px;
}

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.card-head h2 {
    font-size: 15px;
    margin: 0;
    font-weight: 600;
}

.empty {
    color: var(--muted);
    text-align: center;
    padding: 28px 0;
    margin: 0;
}

/* -------------------------------------------------------------- 按钮 */

.btn {
    display: inline-block;
    padding: 7px 14px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink-2);
    font-size: 13.5px;
    cursor: pointer;
    line-height: 1.4;
    transition: all .15s;
    white-space: nowrap;
}

.btn:hover { border-color: #d5d8dd; background: #fafbfc; text-decoration: none; }

.btn.primary {
    background: var(--green);
    border-color: var(--green);
    color: #fff;
}

.btn.primary:hover { background: var(--green-dark); border-color: var(--green-dark); }

.btn.sm { padding: 4px 10px; font-size: 12.5px; }

.btn.block { width: 100%; text-align: center; }

.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* -------------------------------------------------------------- 表格 */

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}

.table th {
    text-align: left;
    font-weight: 500;
    color: var(--muted);
    font-size: 12.5px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    background: #fafbfc;
    white-space: nowrap;
}

.table td {
    padding: 12px;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}

.table tr:last-child td { border-bottom: 0; }

.table tbody tr:hover { background: #fcfcfd; }

.table .right { text-align: right; white-space: nowrap; }

.acc { display: flex; align-items: center; gap: 8px; }

.avatar {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    object-fit: cover;
    background: #f2f3f5;
}

/* -------------------------------------------------------------- 标签 */

.tag {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 20px;
    font-size: 12px;
    line-height: 1.7;
    white-space: nowrap;
}

.tag.ok { background: rgba(7, 193, 96, .12); color: #059a4c; }
.tag.info { background: rgba(47, 126, 229, .12); color: #1f6bd0; }
.tag.warn { background: rgba(240, 147, 43, .14); color: #cf7a13; }
.tag.danger { background: rgba(227, 77, 89, .12); color: #d13b47; }
.tag.gray { background: #f2f3f5; color: #6b7280; }

/* -------------------------------------------------------------- 统计 */

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.stat {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px 18px;
}

.stat .num {
    font-size: 26px;
    font-weight: 600;
    line-height: 1.2;
}

.stat .num.ok { color: var(--green-dark); }
.stat .num.warn { color: var(--warn); }
.stat .num.danger { color: var(--danger); }

.stat .lab { color: var(--muted); font-size: 12.5px; margin-top: 2px; }

/* -------------------------------------------------------------- 提示 */

.alert {
    border-radius: var(--radius);
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 13.5px;
    border: 1px solid transparent;
}

.alert strong { display: block; margin-bottom: 2px; }
.alert-body { color: var(--ink-2); word-break: break-word; }

.alert.ok { background: #eefaf2; border-color: #cdeedb; color: #05793c; }
.alert.info { background: #eff5fe; border-color: #d3e4fb; color: #1f5fa8; }
.alert.warn { background: #fff8ec; border-color: #fbe3c0; color: #a86a0d; }
.alert.danger { background: #fdeff0; border-color: #f8d5d8; color: #b3303b; }

.flash {
    border-radius: var(--radius);
    padding: 10px 16px;
    margin-bottom: 16px;
    font-size: 13.5px;
}

.flash.ok { background: #eefaf2; color: #05793c; }
.flash.danger { background: #fdeff0; color: #b3303b; }

/* -------------------------------------------------------------- 表单 */

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 4px 18px;
}

.field { display: block; margin-bottom: 16px; }

.field > span {
    display: block;
    font-size: 13px;
    color: var(--ink-2);
    margin-bottom: 6px;
}

.field .req { color: var(--danger); font-style: normal; }

.field input[type=text],
.field input[type=password],
.field select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-size: 13.5px;
    background: #fff;
    color: var(--ink);
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}

.field input:focus,
.field select:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(7, 193, 96, .1);
}

.field em {
    display: block;
    font-style: normal;
    font-size: 12px;
    color: var(--muted);
    margin-top: 4px;
}

.hint { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.hint.ok { color: #059a4c; }
.hint.err { color: var(--danger); }

.inline { display: flex; gap: 8px; align-items: center; }
.inline > input, .inline > code { flex: 1; }

.radios { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 16px; }

.radio {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13.5px;
    cursor: pointer;
}

.radio input { accent-color: var(--green); }

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 4px 0 30px;
}

/* ---------------------------------------------------------- 上传控件 */

.uploader { max-width: 620px; }

.upload-drop {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border: 1px dashed #d5d8dd;
    border-radius: 8px;
    padding: 18px;
    cursor: pointer;
    background: #fafbfc;
    transition: all .15s;
}

.upload-drop:hover { border-color: var(--green); background: #f4fdf8; }

.upload-input { display: none; }

.upload-ico { font-size: 20px; color: var(--muted); line-height: 1; }

.upload-tip { font-size: 12.5px; color: var(--muted); text-align: center; }

.upload-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }

.upload-item {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    background: #f2f3f5;
    border-radius: 6px;
    font-size: 12px;
    max-width: 100%;
}

.upload-item .del {
    cursor: pointer;
    color: var(--muted);
    font-size: 14px;
    line-height: 1;
}

.upload-item .del:hover { color: var(--danger); }

.upload-item .stat { padding: 0; border: 0; background: none; }

.upload-item .stat-ok { color: var(--green-dark); }
.upload-item .stat-err { color: var(--danger); }

/* ------------------------------------------------------------ 键值表 */

.kv-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px 24px;
}

.kv {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 10px;
    border-bottom: 1px dashed var(--line);
    font-size: 13.5px;
}

.kv > span { color: var(--muted); flex: 0 0 auto; }
.kv > b { font-weight: 500; text-align: right; word-break: break-all; }

/* ------------------------------------------------------------ 时间轴 */

.timeline { list-style: none; margin: 0; padding: 0; }

.timeline li {
    position: relative;
    padding: 0 0 14px 20px;
    font-size: 13px;
    color: var(--ink-2);
    border-left: 2px solid var(--line);
    margin-left: 4px;
}

.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }

.timeline li::before {
    content: "";
    position: absolute;
    left: -5px;
    top: 6px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #d5d8dd;
}

.timeline time { color: var(--muted); margin-right: 8px; font-size: 12px; }

/* -------------------------------------------------------------- 其他 */

.link-box { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.link-box input {
    flex: 1;
    min-width: 240px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-size: 12.5px;
    color: var(--ink-2);
    background: #fafbfc;
}

details summary {
    cursor: pointer;
    font-size: 13.5px;
    color: var(--ink-2);
    font-weight: 500;
}

pre.code {
    background: #f7f8fa;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px;
    overflow: auto;
    font-size: 12.5px;
    line-height: 1.55;
    max-height: 460px;
}

.foot {
    border-top: 1px solid var(--line);
    padding: 18px 0 30px;
    color: var(--muted);
    font-size: 12.5px;
    text-align: center;
    background: #fff;
}

/* -------------------------------------------------------------- 登录 */

.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(160deg, #f0fbf4 0%, #f5f6f8 60%);
}

.login-box {
    width: 360px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 30px 28px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, .05);
}

.login-box h1 {
    font-size: 19px;
    margin: 0 0 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.login-box > p { margin: 0 0 20px; }

.login-box .btn.block { margin-top: 6px; }

@media (max-width: 720px) {
    .page-head { flex-direction: column; }
    .table { font-size: 12.5px; }
    .table th, .table td { padding: 9px 8px; }
    .kv { flex-direction: column; gap: 2px; }
    .kv > b { text-align: left; }
}

/* ============================================================== 前台 */

body.front { background: #f7f8fa; }

.f-top {
    background: rgba(255, 255, 255, .94);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 20;
}

.f-top .wrap {
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.f-nav { display: flex; gap: 4px; }

.f-nav a {
    color: var(--ink-2);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 14px;
}

.f-nav a:hover { background: #f2f3f5; text-decoration: none; }

.f-nav a.on {
    color: var(--green-dark);
    background: rgba(7, 193, 96, .1);
    font-weight: 500;
}

.f-main { max-width: 960px; padding-top: 26px; padding-bottom: 50px; }

.f-foot {
    border-top: 1px solid var(--line);
    background: #fff;
    padding: 22px 0;
    text-align: center;
    color: var(--muted);
    font-size: 12.5px;
}

.hero { text-align: center; padding: 38px 0 30px; }

.hero h1 {
    font-size: 32px;
    line-height: 1.36;
    margin: 0 0 12px;
    font-weight: 600;
    letter-spacing: .5px;
}

.hero-sub {
    color: var(--ink-2);
    font-size: 14.5px;
    margin: 0 auto 22px;
    max-width: 580px;
}

.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.btn.lg { padding: 10px 22px; font-size: 14.5px; border-radius: 10px; }

.hero-tips {
    margin-top: 18px;
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
    color: var(--muted);
    font-size: 12.5px;
}

.hero-tips span {
    background: #fff;
    border: 1px solid var(--line);
    padding: 3px 10px;
    border-radius: 20px;
}

.flow {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.flow-item {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px;
}

.flow-item h3 { margin: 10px 0 4px; font-size: 14px; }
.flow-item p { margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.6; }

.flow-num {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(7, 193, 96, .12);
    color: var(--green-dark);
    font-size: 12.5px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

.info-card .card-head { margin-bottom: 10px; }

.dot-list { margin: 0; padding-left: 18px; color: var(--ink-2); font-size: 13.5px; }
.dot-list li { margin: 6px 0; }

.faq details { border-bottom: 1px dashed var(--line); padding: 10px 0; }
.faq details:last-child { border-bottom: 0; }
.faq summary { cursor: pointer; font-size: 13.5px; }
.faq p { color: var(--muted); font-size: 13px; margin: 8px 0 0; }

/* 步骤条 */
.steps { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }

.steps-item {
    flex: 1;
    min-width: 130px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 10px 12px;
    font-size: 13px;
    color: var(--muted);
}

.steps-item i {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #f2f3f5;
    color: var(--muted);
    font-size: 11.5px;
    font-style: normal;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.steps-item.on {
    border-color: var(--green);
    color: var(--ink);
    box-shadow: 0 0 0 3px rgba(7, 193, 96, .08);
}

.steps-item.on i { background: var(--green); color: #fff; }
.steps-item.done i { background: rgba(7, 193, 96, .15); color: var(--green-dark); }

.card.narrow { max-width: 460px; margin: 10px auto 0; }
.card-title { font-size: 18px; margin: 0 0 6px; font-weight: 600; }

.center-actions { display: flex; gap: 10px; justify-content: center; padding: 6px 0 30px; }

/* 筛选与分页 */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }

.filters input[type=text],
.filters select {
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-size: 13px;
    background: #fff;
}

.filters input[type=text] { min-width: 220px; }

.pager { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 14px; }

.field em.err { color: var(--danger); }

@media (max-width: 720px) {
    .hero h1 { font-size: 24px; }
    .hero { padding: 22px 0 18px; }
    .steps-item { min-width: 0; flex: 1 1 45%; font-size: 12.5px; }
    .f-nav a { padding: 6px 8px; font-size: 13px; }
}
