/* ─────────────────────────────────────────────────────────────
   随申办市民云模拟平台 · 统一样式
   设计取向：政务场景的克制风格，蓝为主色，大量留白，不玩花活。
   ───────────────────────────────────────────────────────────── */

:root {
    --blue: #1666c4;
    --blue-dark: #114f9b;
    --blue-light: #eaf2fc;
    --ink: #1f2329;
    --ink-2: #4e5969;
    --ink-3: #86909c;
    --line: #e5e6eb;
    --bg: #f4f6f9;
    --white: #fff;
    --green: #1a9e6a;
    --red: #d93026;
    --orange: #e08a00;
    --radius: 12px;
    --shadow: 0 1px 3px rgba(0, 0, 0, .04), 0 6px 20px rgba(0, 0, 0, .04);
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

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

body {
    background: var(--bg);
    color: var(--ink);
    font: 15px/1.65 -apple-system, BlinkMacSystemFont, "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", sans-serif;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--blue);
    text-decoration: none;
}

code, pre, .mono {
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
    font-size: 13px;
}

/* ─────────── 布局 ─────────── */

.wrap {
    max-width: 760px;
    margin: 0 auto;
    padding: 0 16px 48px;
}

.wrap-wide {
    max-width: 1080px;
}

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

.topbar-inner {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 16px;
    height: 52px;
    display: flex;
    align-items: center;
    gap: 14px;
}

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

.brand-dot {
    width: 22px;
    height: 22px;
    border-radius: 7px;
    background: linear-gradient(135deg, var(--blue), #2b8ae0);
    display: inline-block;
    flex: none;
}

.topnav {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

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

.topnav a:hover {
    background: var(--blue-light);
    color: var(--blue);
}

.topnav a.active {
    background: var(--blue-light);
    color: var(--blue);
    font-weight: 500;
}

/* ─────────── 卡片 ─────────── */

.card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px;
    margin-bottom: 16px;
}

.card-tight {
    padding: 16px;
}

.card h2 {
    margin: 0 0 6px;
    font-size: 17px;
    font-weight: 600;
}

.card .sub {
    margin: 0 0 18px;
    color: var(--ink-3);
    font-size: 13px;
}

/* ─────────── 表单 ─────────── */

.field {
    margin-bottom: 15px;
}

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

.field .hint {
    font-size: 12px;
    color: var(--ink-3);
    margin-top: 5px;
    line-height: 1.6;
}

input[type=text], input[type=password], input[type=number], textarea, select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 9px;
    padding: 11px 13px;
    font-size: 15px;
    font-family: inherit;
    color: var(--ink);
    background: var(--white);
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}

input:focus, textarea:focus, select:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(22, 102, 196, .1);
}

textarea {
    resize: vertical;
    min-height: 88px;
    line-height: 1.6;
}

button {
    font-family: inherit;
    font-size: 15px;
    border: none;
    border-radius: 9px;
    padding: 11px 20px;
    cursor: pointer;
    transition: background .15s, opacity .15s;
}

button:disabled {
    opacity: .55;
    cursor: default;
}

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

.btn-primary:hover:not(:disabled) {
    background: var(--blue-dark);
}

.btn-block {
    width: 100%;
    padding: 13px;
    font-size: 16px;
    font-weight: 500;
}

.btn-ghost {
    background: var(--white);
    color: var(--ink-2);
    border: 1px solid var(--line);
}

.btn-ghost:hover:not(:disabled) {
    border-color: var(--blue);
    color: var(--blue);
}

.btn-danger {
    background: #fdecea;
    color: var(--red);
}

.btn-danger:hover:not(:disabled) {
    background: #fbd9d6;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
    border-radius: 7px;
}

.btn-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* ─────────── 提示 ─────────── */

.alert {
    border-radius: 9px;
    padding: 11px 14px;
    font-size: 14px;
    margin-bottom: 15px;
    line-height: 1.6;
}

.alert-error {
    background: #fdecea;
    color: #a8201a;
}

.alert-ok {
    background: #e8f6ef;
    color: #12703f;
}

.alert-info {
    background: var(--blue-light);
    color: var(--blue-dark);
}

.alert-warn {
    background: #fff6e5;
    color: #8a5a00;
}

.hidden {
    display: none !important;
}

/* ─────────── 徽标 ─────────── */

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

.tag-blue { background: var(--blue-light); color: var(--blue); }
.tag-green { background: #e8f6ef; color: var(--green); }
.tag-red { background: #fdecea; color: var(--red); }
.tag-gray { background: #f2f3f5; color: var(--ink-3); }
.tag-orange { background: #fff6e5; color: var(--orange); }

/* ─────────── 表格 ─────────── */

.table-wrap {
    overflow-x: auto;
    margin: 0 -22px;
    padding: 0 22px;
}

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

th {
    text-align: left;
    font-weight: 500;
    color: var(--ink-3);
    font-size: 12.5px;
    padding: 8px 10px;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}

td {
    padding: 10px;
    border-bottom: 1px solid #f2f3f5;
    vertical-align: top;
}

tr:last-child td {
    border-bottom: none;
}

.mono-cell {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 12.5px;
    color: var(--ink-2);
    word-break: break-all;
}

/* ─────────── 空态 ─────────── */

.empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--ink-3);
    font-size: 14px;
}

.empty-icon {
    font-size: 30px;
    opacity: .35;
    margin-bottom: 10px;
}

/* ─────────── 登录页 ─────────── */

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    background: linear-gradient(160deg, #eef4fc 0%, #f7f9fc 46%, #f4f6f9 100%);
}

.auth-card {
    width: 100%;
    max-width: 392px;
    background: var(--white);
    border-radius: 18px;
    box-shadow: 0 4px 30px rgba(20, 50, 90, .09);
    padding: 32px 28px 26px;
}

.auth-logo {
    width: 46px;
    height: 46px;
    border-radius: 13px;
    background: linear-gradient(135deg, var(--blue), #2b8ae0);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 18px;
}

.auth-title {
    font-size: 21px;
    font-weight: 600;
    margin: 0 0 6px;
}

.auth-sub {
    font-size: 13px;
    color: var(--ink-3);
    margin: 0 0 24px;
}

.auth-foot {
    margin-top: 20px;
    font-size: 12px;
    color: var(--ink-3);
    text-align: center;
    line-height: 1.7;
}

.demo-accounts {
    margin-top: 18px;
    border-top: 1px dashed var(--line);
    padding-top: 14px;
}

.demo-accounts-title {
    font-size: 12px;
    color: var(--ink-3);
    margin-bottom: 8px;
}

.demo-account {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    color: var(--ink-2);
    padding: 5px 8px;
    border-radius: 7px;
    cursor: pointer;
}

.demo-account:hover {
    background: var(--blue-light);
}

.demo-account .mono {
    font-size: 12px;
    color: var(--ink-3);
}

/* ─────────── 授权页 ─────────── */

.consent-scope {
    display: flex;
    gap: 11px;
    padding: 13px 0;
    border-bottom: 1px solid #f2f3f5;
}

.consent-scope:last-of-type {
    border-bottom: none;
}

.consent-scope-icon {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: var(--blue-light);
    color: var(--blue);
    display: flex;
    align-items: center;
    justify-content: center;
    flex: none;
    font-size: 16px;
}

.consent-scope-text b {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 2px;
}

.consent-scope-text span {
    font-size: 12.5px;
    color: var(--ink-3);
    line-height: 1.5;
}

.consent-user {
    display: flex;
    align-items: center;
    gap: 11px;
    background: #fafbfc;
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 6px;
}

.consent-user img {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    flex: none;
}

.consent-user-name {
    font-size: 14px;
    font-weight: 500;
}

.consent-user-meta {
    font-size: 12.5px;
    color: var(--ink-3);
}

/* ─────────── 应用商店（首页） ─────────── */

.store-hero {
    background: linear-gradient(135deg, #1666c4, #2b8ae0);
    color: #fff;
    border-radius: 16px;
    padding: 26px 24px;
    margin-bottom: 18px;
}

.store-hero h1 {
    margin: 0 0 8px;
    font-size: 21px;
    font-weight: 600;
}

.store-hero p {
    margin: 0;
    font-size: 13.5px;
    opacity: .9;
    line-height: 1.7;
}

.app-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
}

.app-item {
    background: var(--white);
    border-radius: 12px;
    padding: 16px 14px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: transform .12s, box-shadow .12s;
    cursor: pointer;
    display: block;
    color: inherit;
}

.app-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, .09);
}

.app-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    margin: 0 auto 10px;
    background: linear-gradient(135deg, var(--blue-light), #dbe8f8);
    color: var(--blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 600;
}

.app-name {
    font-size: 13.5px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-host {
    font-size: 11.5px;
    color: var(--ink-3);
    margin-top: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ─────────── 代码块 ─────────── */

pre.code {
    background: #1e2430;
    color: #d5dae3;
    border-radius: 10px;
    padding: 15px 17px;
    overflow-x: auto;
    line-height: 1.7;
    margin: 12px 0;
    font-size: 12.5px;
}

pre.code .k { color: #7ec7f0; }
pre.code .s { color: #a5d6a7; }
pre.code .c { color: #6b7688; }

code.inline {
    background: #f2f3f5;
    padding: 1px 6px;
    border-radius: 5px;
    font-size: 12.5px;
    color: #b23b3b;
}

/* ─────────── 分段控件 ─────────── */

.tabs {
    display: flex;
    gap: 2px;
    background: #f2f3f5;
    border-radius: 9px;
    padding: 3px;
    margin-bottom: 18px;
}

.tabs button {
    flex: 1;
    background: transparent;
    color: var(--ink-2);
    font-size: 13.5px;
    padding: 8px 10px;
    border-radius: 7px;
}

.tabs button.active {
    background: var(--white);
    color: var(--blue);
    font-weight: 500;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .07);
}

/* ─────────── 键值对 ─────────── */

.kv {
    display: flex;
    padding: 9px 0;
    border-bottom: 1px solid #f2f3f5;
    font-size: 13.5px;
    gap: 12px;
}

.kv:last-child {
    border-bottom: none;
}

.kv dt {
    color: var(--ink-3);
    width: 116px;
    flex: none;
}

.kv dd {
    margin: 0;
    word-break: break-all;
    flex: 1;
}

/* ─────────── 复制按钮 ─────────── */

.copyable {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.copyable:hover {
    color: var(--blue);
}

.copyable .copy-icon {
    font-size: 11px;
    opacity: .5;
}

/* ─────────── 响应式 ─────────── */

@media (max-width: 620px) {
    .card {
        padding: 17px;
        border-radius: 11px;
    }

    .table-wrap {
        margin: 0 -17px;
        padding: 0 17px;
    }

    .auth-card {
        padding: 26px 21px 22px;
    }

    .app-list {
        grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
    }
}