/* 小橘记忆 · 同步服务后台
   浅色卡片风格，与 App 的浅灰底 + 白卡片保持一致。
   不引任何外部字体/CDN，断网的内网服务器也能正常渲染。 */

:root {
    --bg: #f4f5f7;
    --surface: #ffffff;
    --line: #e8eaee;
    --line-strong: #d9dde4;
    --text: #141922;
    --muted: #727b8a;
    --brand: #2c6bed;
    --brand-soft: #eaf1ff;
    --green: #0f8558;
    --green-soft: #e6f6ef;
    --red: #d3433a;
    --red-soft: #fdecea;
    --amber: #9a6a10;
    --amber-soft: #fdf4e0;
    --radius: 16px;
    --shadow: 0 1px 2px rgba(20, 25, 34, .04), 0 10px 28px -20px rgba(20, 25, 34, .35);
    --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    font-size: 14px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

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

code {
    font-family: var(--mono);
    font-size: 12px;
    background: #f1f3f6;
    border-radius: 5px;
    padding: 1px 5px;
}

/* ---------------------------------------------------------------- 外壳 */

.shell { display: flex; min-height: 100vh; }

.side {
    position: fixed;
    inset: 0 auto 0 0;
    width: 236px;
    background: var(--surface);
    border-right: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    padding: 20px 14px 16px;
}

.brand { display: flex; align-items: center; gap: 10px; padding: 0 6px 18px; }

.brand-mark {
    width: 34px; height: 34px;
    display: grid; place-items: center;
    border-radius: 10px;
    background: linear-gradient(160deg, #2f6ef0, #1b4fd0);
    color: #fff; font-weight: 700; font-size: 15px;
    box-shadow: 0 6px 14px -8px rgba(44, 107, 237, .9);
}

.brand-mark.lg { width: 46px; height: 46px; border-radius: 14px; font-size: 20px; }

.brand-text strong { display: block; font-size: 14.5px; letter-spacing: .2px; }
.brand-text em { font-style: normal; font-size: 11.5px; color: var(--muted); }

.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }

.nav a {
    display: flex; align-items: center; gap: 10px;
    height: 40px; padding: 0 11px;
    border-radius: 10px;
    color: #414b5a; font-size: 13.5px; font-weight: 500;
    text-decoration: none;
    transition: background .14s ease, color .14s ease;
}

.nav a svg { width: 18px; height: 18px; flex: none; opacity: .8; }
.nav a:hover { background: #f5f6f8; }
.nav a.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.nav a.active svg { opacity: 1; }

.side-foot { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 12px; }

.who { display: flex; align-items: center; gap: 10px; padding: 0 4px 10px; }
.who strong { display: block; font-size: 13px; }
.who em { font-style: normal; font-size: 11.5px; color: var(--muted); }

.avatar {
    width: 30px; height: 30px; border-radius: 9px; flex: none;
    display: grid; place-items: center;
    background: #f1f3f6; color: #4a5566; font-size: 13px; font-weight: 600;
}

.main {
    flex: 1;
    margin-left: 236px;
    padding: 26px 32px 72px;
    max-width: 1360px;
}

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

.topbar h1 { margin: 0; font-size: 20px; font-weight: 650; letter-spacing: -.2px; }
.topbar .sub { margin: 4px 0 0; font-size: 12.5px; color: var(--muted); }
.topbar .sub code { font-size: 11.5px; }

/* ---------------------------------------------------------------- 卡片 */

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

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

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

.count {
    display: inline-block; margin-left: 6px;
    font-size: 11.5px; font-weight: 600; color: var(--muted);
    background: #f1f3f6; border-radius: 999px; padding: 1px 8px;
    vertical-align: 2px;
}

.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; align-items: start; }

.stat { display: flex; flex-direction: column; gap: 2px; padding: 18px 18px 16px; margin-bottom: 0; }
.stat-label { font-size: 12px; color: var(--muted); }
.stat-value { font-size: 27px; font-weight: 660; letter-spacing: -.6px; font-variant-numeric: tabular-nums; }
.stat-hint { font-size: 11.5px; color: var(--muted); }

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

.table { width: 100%; border-collapse: collapse; }

.table th {
    text-align: left; font-size: 11.5px; font-weight: 600; color: var(--muted);
    padding: 8px 12px; border-bottom: 1px solid var(--line); white-space: nowrap;
}

.table td {
    padding: 12px; font-size: 13px;
    border-bottom: 1px solid #f2f3f6;
    vertical-align: middle;
}

.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fafbfc; }

.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .right { text-align: right; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.mono.tiny { font-size: 11.5px; }
.muted { color: var(--muted); }
.tiny { font-size: 11.5px; }
.nowrap { white-space: nowrap; }
.ellipsis { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------------------------------------------------------------- 徽标 */

.badge {
    display: inline-flex; align-items: center;
    padding: 2px 9px; border-radius: 999px;
    font-size: 11.5px; font-weight: 600;
    background: #f1f3f6; color: #5b6575;
    white-space: nowrap;
}

.badge.green { background: var(--green-soft); color: var(--green); }
.badge.red { background: var(--red-soft); color: var(--red); }
.badge.amber { background: var(--amber-soft); color: var(--amber); }

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

.btn {
    display: inline-flex; align-items: center; justify-content: center;
    height: 36px; padding: 0 15px;
    border-radius: 10px; border: 1px solid var(--line-strong);
    background: var(--surface); color: var(--text);
    font-size: 13px; font-weight: 550; font-family: inherit;
    cursor: pointer; text-decoration: none; white-space: nowrap;
    transition: background .14s ease, border-color .14s ease, transform .06s ease;
}

.btn:hover { background: #f7f8fa; text-decoration: none; }
.btn:active { transform: translateY(.5px); }
.btn.sm { height: 30px; padding: 0 11px; font-size: 12.5px; border-radius: 9px; }
.btn.block { width: 100%; }
.btn.primary { background: var(--brand); border-color: transparent; color: #fff; }
.btn.primary:hover { background: #2560dc; }
.btn.danger { background: var(--red); border-color: transparent; color: #fff; }
.btn.danger:hover { background: #bd3a32; }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: #f4f5f7; }
.danger-text { color: var(--red); }
.inline { display: inline-block; margin: 0; }

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

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > span { font-size: 12.5px; font-weight: 600; color: #4a5566; }

.field input[type="text"],
.field input[type="password"],
.field input[type="number"],
.field input[type="search"],
.field textarea,
.inline-form input,
.inline-form select,
.action-block input[type="text"] {
    width: 100%;
    height: 38px; padding: 0 12px;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    background: var(--surface);
    font-family: inherit; font-size: 13.5px; color: var(--text);
    outline: none;
    transition: border-color .14s ease, box-shadow .14s ease;
}

.field textarea { height: auto; min-height: 76px; padding: 10px 12px; line-height: 1.6; resize: vertical; }
.field input[type="file"] { font-size: 12.5px; padding: 9px 0; }

.field input:focus,
.field textarea:focus,
.inline-form input:focus,
.inline-form select:focus,
.action-block input:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(44, 107, 237, .13);
}

.hint { font-style: normal; font-size: 11.5px; color: var(--muted); line-height: 1.6; }

.check { display: flex; align-items: flex-start; gap: 9px; font-size: 13px; margin-bottom: 14px; }
.check input { margin-top: 3px; accent-color: var(--brand); }
.check span { color: #3c4657; }

.stack { display: flex; flex-direction: column; }
.row { display: flex; gap: 12px; }
.row > * { flex: 1; }

.inline-form { display: flex; gap: 8px; align-items: center; }
.inline-form input[type="search"] { width: 200px; height: 34px; font-size: 12.5px; }
.inline-form select { width: auto; height: 34px; font-size: 12.5px; padding: 0 8px; }
.inline-form .btn { height: 34px; }

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

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

.flash {
    padding: 11px 14px; border-radius: 12px; margin-bottom: 14px;
    font-size: 13px; background: var(--green-soft); color: var(--green);
    border: 1px solid rgba(15, 133, 88, .12);
}

.flash.bad { background: var(--red-soft); color: var(--red); border-color: rgba(211, 67, 58, .14); }
.flash.warn { background: var(--amber-soft); color: var(--amber); border-color: rgba(154, 106, 16, .14); }
.flash code { background: rgba(255, 255, 255, .6); }

.notice {
    background: #fafbfc; border-left: 3px solid var(--brand);
    border-radius: 8px; padding: 11px 14px; margin-top: 6px;
}

.notice strong { font-size: 12.5px; }
.notice p { margin: 4px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.7; }

.empty { text-align: center; color: var(--muted); font-size: 13px; padding: 26px 0; }
.empty-state { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 40px 0; }
.empty-state strong { font-size: 15px; }

.hint { font-size: 12px; color: var(--muted); margin: 6px 0 0; line-height: 1.7; }

/* ---------------------------------------------------------------- 详情页 */

.kv { margin: 0; }
.kv > div { display: flex; justify-content: space-between; gap: 18px; padding: 9px 0; border-bottom: 1px dashed #eef0f3; }
.kv > div:last-child { border-bottom: 0; }
.kv dt { font-size: 12.5px; color: var(--muted); flex: none; }
.kv dd { margin: 0; font-size: 13px; text-align: right; word-break: break-all; }

.action-block {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    padding: 13px 0; border-bottom: 1px solid #f2f3f6;
}

.action-block:last-child { border-bottom: 0; padding-bottom: 0; }
.action-text strong { display: block; font-size: 13.5px; }
.action-text span { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; max-width: 330px; line-height: 1.6; }
.action-block.danger .action-text strong { color: var(--red); }
.action-block form { flex: none; }

/* 重置密码那种带输入框的表单要撑开，否则输入框会被挤成一条 */
.action-block form.stack { flex: 1 1 auto; max-width: 460px; }

.action-block .row { width: 100%; }
.action-block .row input { flex: 1 1 auto; }
.action-block .row .btn { flex: 0 0 auto; }

.release-hero {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; padding: 13px 15px; border-radius: 12px;
    background: #fafbfc; border: 1px solid #f0f1f4; margin-bottom: 8px;
}

.release-hero strong { font-size: 21px; font-weight: 660; letter-spacing: -.4px; }
.release-hero span { display: block; font-size: 12px; color: var(--muted); }

.notes { margin: 10px 0 14px; }
.notes > span { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.notes p { margin: 4px 0 0; font-size: 13px; line-height: 1.75; color: #38414f; }

/* ---------------------------------------------------------------- 其它 */

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

.env-grid > div {
    display: flex; flex-direction: column; gap: 3px;
    background: #fafbfc; border-radius: 12px; padding: 11px 13px;
}

.env-grid span { font-size: 11.5px; color: var(--muted); }
.env-grid strong { font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid #f4f5f7; }
.timeline li:last-child { border-bottom: 0; }
.timeline .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--brand); margin-top: 8px; flex: none; }
.timeline strong { font-size: 12.5px; font-weight: 600; margin-right: 5px; }
.timeline span { font-size: 12.5px; }
.timeline em { display: block; font-style: normal; font-size: 11.5px; color: var(--muted); margin-top: 1px; }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 4px 4px 0; }
.pager .muted { font-size: 12px; }
.pager-links { display: flex; gap: 6px; flex-wrap: wrap; }

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

.auth-body {
    min-height: 100vh;
    display: grid; place-items: center;
    padding: 32px 20px;
    background:
        radial-gradient(900px 480px at 12% -10%, #e7efff 0%, rgba(231, 239, 255, 0) 62%),
        radial-gradient(760px 420px at 96% 8%, #eef1f5 0%, rgba(238, 241, 245, 0) 58%),
        var(--bg);
}

.auth-wrap { width: 100%; max-width: 400px; }

.auth-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 22px;
    box-shadow: 0 1px 2px rgba(20, 25, 34, .04), 0 30px 60px -40px rgba(20, 25, 34, .5);
    padding: 30px 28px 24px;
}

.auth-brand { text-align: center; margin-bottom: 20px; }
.auth-brand .brand-mark { margin: 0 auto 14px; }
.auth-brand h1 { margin: 0; font-size: 19px; font-weight: 660; letter-spacing: -.3px; }
.auth-brand p { margin: 5px 0 0; font-size: 12.5px; color: var(--muted); }

.auth-card .btn.primary { height: 42px; font-size: 14px; margin-top: 4px; }

.auth-foot {
    margin: 18px 0 0; padding-top: 14px;
    border-top: 1px solid var(--line);
    font-size: 11.5px; color: var(--muted); line-height: 1.7; text-align: center;
}

/* ---------------------------------------------------------------- 响应式 */

@media (max-width: 860px) {
    .side {
        position: static; width: auto;
        border-right: 0; border-bottom: 1px solid var(--line);
        padding: 14px;
    }
    .shell { flex-direction: column; }
    .nav { flex-direction: row; flex-wrap: wrap; }
    .nav a { height: 36px; padding: 0 10px; }
    .nav a span { font-size: 12.5px; }
    .side-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
    .side-foot .who { padding: 0; }
    .side-foot form { flex: none; }
    .side-foot .btn { width: auto; }
    .main { margin-left: 0; padding: 18px 16px 60px; }
    .topbar { flex-direction: column; }
    .grid-2 { grid-template-columns: 1fr; }
    .table { display: block; overflow-x: auto; white-space: nowrap; }
}

/* 表格里「账号 + 邮箱」两行显示 */
.cell-strong { font-size: 13px; font-weight: 600; line-height: 1.4; }
.cell-sub { font-size: 11.5px; color: var(--muted); line-height: 1.4; }

/* 设置页的分组标题 */
.group-title {
    display: flex; align-items: center; gap: 8px;
    margin: 0 0 12px; font-size: 13px; font-weight: 650; color: #3c4657;
}
.group-title::after { content: ""; flex: 1; height: 1px; background: #f0f2f5; }

/* 设置页的下拉框（和输入框同高同圆角） */
.field select.select {
    width: 100%; height: 38px; padding: 0 10px;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    background: var(--surface);
    font-family: inherit; font-size: 13.5px; color: var(--text);
    outline: none;
}

.field select.select:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(44, 107, 237, .13);
}

/* 部署页的步骤列表 */
.steps { list-style: none; margin: 0; padding: 0; }
.steps li {
    display: flex; gap: 11px; padding: 11px 0;
    border-bottom: 1px solid #f2f3f6; font-size: 13px;
}
.steps li:last-child { border-bottom: 0; }
.steps .icon {
    width: 20px; height: 20px; flex: none; border-radius: 50%;
    display: grid; place-items: center; font-size: 11px; font-weight: 700;
    background: var(--green-soft); color: var(--green); margin-top: 1px;
}
.steps .icon.bad { background: var(--red-soft); color: var(--red); }
.steps .icon.skip { background: #f1f3f6; color: var(--muted); }
.steps strong { display: block; font-size: 13px; }
.steps em { display: block; font-style: normal; font-size: 11.5px; color: var(--muted); margin-top: 2px; line-height: 1.6; word-break: break-all; }

details.optional { margin-top: 4px; }
details.optional summary {
    cursor: pointer; font-size: 12.5px; color: var(--brand);
    padding: 6px 0; user-select: none;
}
