@charset "UTF-8";
/* =============================================================================
 * JXPhotos 数据接口平台 · 统一样式表
 * 门户 / 客户控制台 / 管理后台共用；浅色 + 深色两套主题（html[data-theme]）
 * ========================================================================== */

:root {
    --bg: #f5f7fa;
    --bg-soft: #eef2f7;
    --surface: #ffffff;
    --surface-2: #fafbfd;
    --border: #e2e8f0;
    --border-strong: #cbd5e1;
    --text: #101828;
    --text-soft: #475467;
    --muted: #667085;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --accent-soft: #eff4ff;
    --ok: #047857;
    --ok-soft: #ecfdf5;
    --warn: #b45309;
    --warn-soft: #fffbeb;
    --danger: #b42318;
    --danger-soft: #fef3f2;
    --radius: 10px;
    --radius-sm: 6px;
    --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .1);
    --shadow-lg: 0 4px 12px rgba(16, 24, 40, .08), 0 2px 4px rgba(16, 24, 40, .06);
    --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

html[data-theme="dark"] {
    --bg: #0e131a;
    --bg-soft: #131a23;
    --surface: #161d27;
    --surface-2: #1b232e;
    --border: #26303d;
    --border-strong: #38434f;
    --text: #e8edf3;
    --text-soft: #b6c2d1;
    --muted: #8c99a8;
    --accent: #60a5fa;
    --accent-hover: #93c5fd;
    --accent-soft: #1b2a41;
    --ok: #4ade80;
    --ok-soft: #10261c;
    --warn: #fbbf24;
    --warn-soft: #2a2110;
    --danger: #f87171;
    --danger-soft: #2b1516;
    --shadow: none;
    --shadow-lg: none;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
        "Microsoft YaHei", "Noto Sans SC", Roboto, Helvetica, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.65;
}

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

h1, h2, h3, h4 { margin: 0 0 .6em; line-height: 1.3; font-weight: 700; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }

.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.container--narrow { max-width: 720px; }
.container--wide { max-width: 1320px; }

.muted { color: var(--muted); }
.soft { color: var(--text-soft); }
.small { font-size: .85rem; }
.mono { font-family: var(--mono); font-size: .86rem; }
.nowrap { white-space: nowrap; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.mt0 { margin-top: 0; }
.mt1 { margin-top: 8px; }
.mt2 { margin-top: 16px; }
.mt3 { margin-top: 24px; }
.mt4 { margin-top: 32px; }
.mb0 { margin-bottom: 0; }
.mb1 { margin-bottom: 8px; }
.mb2 { margin-bottom: 16px; }
.mb3 { margin-bottom: 24px; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.gap1 { gap: 8px; }
.gap2 { gap: 16px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.hidden { display: none; }
.break-all { word-break: break-all; }

/* ------------------------------------------------------------------ 站点头部 */
.site-header {
    position: sticky;
    top: 0;
    z-index: 30;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}
.site-header__inner {
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 60px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--text); }
.brand:hover { text-decoration: none; color: var(--text); }
.brand__mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .02em;
}
.brand__text { font-size: 1rem; }
.brand__sub { display: block; font-size: .72rem; font-weight: 400; color: var(--muted); }
.site-nav { display: flex; align-items: center; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.site-nav a {
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    color: var(--text-soft);
    font-size: .92rem;
}
.site-nav a:hover { background: var(--bg-soft); color: var(--text); text-decoration: none; }
.site-nav a.is-active { color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.theme-toggle {
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-soft);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    font-size: .85rem;
    cursor: pointer;
}
.theme-toggle:hover { border-color: var(--border-strong); color: var(--text); }

.site-footer {
    margin-top: 56px;
    padding: 28px 0 36px;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: .86rem;
}
.site-footer__links { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 8px; }

main { padding: 32px 0 8px; }

/* ------------------------------------------------------------------ 通用块 */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}
.card--flush { padding: 0; overflow: hidden; }
.card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}
.card__head h2, .card__head h3 { margin: 0; }
.card__body { padding: 20px; }
.card__foot { padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface-2); }

.hero {
    background: linear-gradient(180deg, var(--accent-soft), transparent);
    border-bottom: 1px solid var(--border);
    padding: 48px 0 40px;
}
.hero h1 { font-size: 2.05rem; }
.hero__lead { font-size: 1.06rem; color: var(--text-soft); max-width: 760px; }
.hero__actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 20px; }
.hero__meta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }

.grid { display: grid; gap: 18px; }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }

.stat {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
}
.stat__label { font-size: .82rem; color: var(--muted); margin-bottom: 4px; }
.stat__value { font-size: 1.4rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat__value small { font-size: .8rem; font-weight: 400; color: var(--muted); }

/* --------------------------------------------------------------- 按钮 / 表单 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--text);
    font-size: .92rem;
    font-family: inherit;
    line-height: 1.4;
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s;
}
.btn:hover { background: var(--bg-soft); text-decoration: none; color: var(--text); }
.btn--primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.btn--danger { color: var(--danger); border-color: var(--danger); background: transparent; }
.btn--danger:hover { background: var(--danger-soft); color: var(--danger); }
.btn--ghost { border-color: transparent; background: transparent; color: var(--text-soft); }
.btn--ghost:hover { background: var(--bg-soft); }
.btn--sm { padding: 5px 10px; font-size: .85rem; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

form.inline { display: inline; }

.field { margin-bottom: 16px; }
.field > label {
    display: block;
    margin-bottom: 6px;
    font-size: .9rem;
    font-weight: 600;
}
.field .req { color: var(--danger); margin-left: 2px; }
.field .hint { margin-top: 4px; font-size: .82rem; color: var(--muted); }
input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="url"], select, textarea {
    width: 100%;
    padding: 8px 11px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font-family: inherit;
    font-size: .94rem;
    line-height: 1.5;
}
input[readonly] { background: var(--bg-soft); color: var(--text-soft); }
textarea { min-height: 92px; resize: vertical; font-family: var(--mono); font-size: .88rem; }
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .14);
}
.checkbox { display: flex; align-items: flex-start; gap: 8px; font-size: .92rem; }
.checkbox input { width: auto; margin-top: 4px; }
.form-row { display: flex; gap: 14px; flex-wrap: wrap; }
.form-row > .field { flex: 1 1 240px; }
.field-error { color: var(--danger); font-size: .84rem; margin-top: 4px; }

/* 邮箱验证码 / 图形验证码（注册与控制台验证邮箱共用） */
.field-inline { display: flex; align-items: flex-start; gap: 8px; }
.field-inline input[type="text"] { flex: 1 1 auto; min-width: 0; }
.field-inline .btn { flex: 0 0 auto; white-space: nowrap; }
.captcha-img {
    display: block;
    flex: 0 0 auto;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: #fff;
    cursor: pointer;
}
.field .hint--error { color: var(--danger); }

/* --------------------------------------------------------------- 提示条 */
.alert {
    padding: 11px 14px;
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius-sm);
    background: var(--surface);
    margin-bottom: 18px;
    font-size: .92rem;
}
.alert--ok { border-left-color: var(--ok); background: var(--ok-soft); color: var(--ok); }
.alert--error { border-left-color: var(--danger); background: var(--danger-soft); color: var(--danger); }
.alert--warn { border-left-color: var(--warn); background: var(--warn-soft); color: var(--warn); }
.alert--info { border-left-color: var(--accent); background: var(--accent-soft); color: var(--text-soft); }
.alert ul { margin: 6px 0 0; padding-left: 18px; }

/* --------------------------------------------------------------- 表格 */
.table-wrap { width: 100%; overflow-x: auto; }
table.data {
    width: 100%;
    border-collapse: collapse;
    font-size: .9rem;
}
table.data th, table.data td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
}
table.data th {
    background: var(--surface-2);
    color: var(--muted);
    font-size: .8rem;
    font-weight: 600;
    white-space: nowrap;
}
table.data tbody tr:hover td { background: var(--surface-2); }
table.data td.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
table.data td.actions { white-space: nowrap; }
table.data tr.row--pending td { background: var(--warn-soft); }
table.empty td { color: var(--muted); text-align: center; padding: 26px 12px; }

/* --------------------------------------------------------------- 徽标 */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid var(--border-strong);
    background: var(--surface-2);
    color: var(--muted);
    font-size: .78rem;
    white-space: nowrap;
}
.badge--ok { border-color: var(--ok); color: var(--ok); background: var(--ok-soft); }
.badge--warn { border-color: var(--warn); color: var(--warn); background: var(--warn-soft); }
.badge--danger { border-color: var(--danger); color: var(--danger); background: var(--danger-soft); }
.badge--info { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

/* --------------------------------------------------------------- 定义列表 */
.kv { display: grid; grid-template-columns: minmax(120px, 200px) 1fr; gap: 8px 16px; margin: 0; font-size: .92rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-all; }

/* --------------------------------------------------------------- 代码 */
pre.code, .code-block {
    margin: 0 0 16px;
    padding: 14px 16px;
    background: #0f172a;
    color: #e2e8f0;
    border-radius: var(--radius-sm);
    overflow-x: auto;
    font-family: var(--mono);
    font-size: .84rem;
    line-height: 1.6;
}
pre.code .cm { color: #94a3b8; }
code.inline {
    padding: 1px 6px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg-soft);
    font-family: var(--mono);
    font-size: .85em;
}
.secret-box {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--bg-soft);
    font-family: var(--mono);
    font-size: .88rem;
    word-break: break-all;
}

/* --------------------------------------------------------------- 分页 / 标签 */
.pagination { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; flex-wrap: wrap; }
.tabs a {
    padding: 8px 14px;
    border-bottom: 2px solid transparent;
    color: var(--text-soft);
    font-size: .93rem;
}
.tabs a:hover { text-decoration: none; color: var(--text); }
.tabs a.is-active { border-bottom-color: var(--accent); color: var(--accent); font-weight: 600; }

.section-title { margin: 32px 0 16px; }

/* --------------------------------------------------------------- 接口文档 */
.docs-layout { display: grid; grid-template-columns: 220px 1fr; gap: 32px; align-items: start; }
.docs-side { position: sticky; top: 84px; font-size: .9rem; }
.docs-side ol { list-style: none; margin: 0; padding: 0; }
.docs-side li { margin-bottom: 2px; }
.docs-side a { display: block; padding: 5px 10px; border-radius: var(--radius-sm); color: var(--text-soft); }
.docs-side a:hover { background: var(--bg-soft); color: var(--text); text-decoration: none; }
.docs-side .docs-side__title { font-weight: 600; color: var(--muted); font-size: .78rem; padding: 12px 10px 4px; }
.endpoint { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.endpoint .method {
    padding: 2px 9px;
    border-radius: 4px;
    background: var(--ok-soft);
    color: var(--ok);
    border: 1px solid var(--ok);
    font-family: var(--mono);
    font-size: .8rem;
    font-weight: 700;
}
.endpoint .path { font-family: var(--mono); font-size: .95rem; word-break: break-all; }
.param-table td:first-child { font-family: var(--mono); white-space: nowrap; }
.field-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 4px 16px; font-size: .88rem; }
.field-list li { font-family: var(--mono); color: var(--text-soft); }

/* --------------------------------------------------------------- 认证页 */
.auth-wrap { max-width: 460px; margin: 48px auto; }
.auth-wrap--wide { max-width: 620px; }
.auth-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow-lg); }
.auth-card h1 { font-size: 1.35rem; margin-bottom: 4px; }
.auth-foot { margin-top: 18px; text-align: center; font-size: .9rem; color: var(--muted); }

/* --------------------------------------------------------------- 管理后台 */
.admin-body { background: var(--bg); }
.admin-layout { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.admin-sidebar {
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 18px 0;
}
.admin-sidebar__brand { display: flex; align-items: center; gap: 10px; padding: 0 18px 16px; border-bottom: 1px solid var(--border); margin-bottom: 12px; }
.admin-sidebar__brand a { color: var(--text); font-weight: 700; display: flex; align-items: center; gap: 10px; }
.admin-sidebar__brand a:hover { text-decoration: none; }
.admin-nav { display: flex; flex-direction: column; gap: 2px; padding: 0 10px; }
.admin-nav__label { padding: 12px 8px 4px; font-size: .74rem; color: var(--muted); letter-spacing: .05em; }
.admin-nav__link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    color: var(--text-soft);
    font-size: .92rem;
}
.admin-nav__link:hover { background: var(--bg-soft); color: var(--text); text-decoration: none; }
.admin-nav__link.is-active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.admin-nav__count {
    padding: 0 7px;
    border-radius: 999px;
    background: var(--danger);
    color: #fff;
    font-size: .74rem;
    font-weight: 700;
}
.admin-main { min-width: 0; display: flex; flex-direction: column; }
.admin-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding: 14px 28px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}
.admin-topbar__title { font-weight: 700; }
.admin-content { padding: 24px 28px 48px; }
.crumb { font-size: .85rem; color: var(--muted); }

@media (max-width: 900px) {
    .admin-layout { grid-template-columns: 1fr; }
    .admin-sidebar { border-right: none; border-bottom: 1px solid var(--border); }
    .admin-nav { flex-direction: row; flex-wrap: wrap; }
    .admin-nav__label { display: none; }
    .admin-content { padding: 18px 16px 40px; }
    .docs-layout { grid-template-columns: 1fr; }
    .docs-side { position: static; }
    .hero { padding: 32px 0 28px; }
    .hero h1 { font-size: 1.6rem; }
    .kv { grid-template-columns: 1fr; gap: 2px 0; }
    .kv dt { margin-top: 8px; }
}

@media print {
    .site-header, .site-footer, .admin-sidebar, .admin-topbar { display: none; }
}
