:root {
    --bg: #f3f6fb;
    --panel: #ffffff;
    --text: #172033;
    --muted: #657084;
    --line: #e1e7f0;
    --primary: #1769e0;
    --primary-dark: #0f4fb0;
    --soft: #eef5ff;
    --success: #16875d;
    --danger: #b42318;
    --shadow: 0 14px 38px rgba(20, 35, 66, .08);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background:
        linear-gradient(180deg, #eaf2ff 0, rgba(234, 242, 255, 0) 260px),
        var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
    font-size: 14px;
}

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

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    height: 64px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 32px;
    background: rgba(255, 255, 255, .92);
    border-bottom: 1px solid rgba(225, 231, 240, .9);
    backdrop-filter: blur(12px);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 800;
    color: #111827;
}

.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: var(--primary);
    color: #fff;
    font-size: 12px;
    letter-spacing: 0;
}

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

.topbar nav a {
    padding: 9px 12px;
    border-radius: 6px;
    color: #344054;
    font-weight: 600;
}

.topbar nav a:hover { background: var(--soft); color: var(--primary); }

.container {
    max-width: 1260px;
    margin: 30px auto 48px;
    padding: 0 22px;
}

.hero,
.panel,
.auth {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.hero {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: end;
    gap: 28px;
    padding: 36px;
}

.panel {
    padding: 24px;
    margin-bottom: 18px;
}

.auth {
    max-width: 440px;
    margin: 70px auto;
    padding: 30px;
}

h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 10px; font-size: 28px; line-height: 1.25; }
h2 { margin-bottom: 6px; font-size: 19px; }
p { margin-bottom: 0; color: var(--muted); line-height: 1.7; }
small { display: block; color: var(--muted); line-height: 1.6; }

.eyebrow {
    margin-bottom: 8px;
    color: var(--primary);
    font-weight: 800;
    letter-spacing: 0;
}

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

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

form { display: grid; gap: 14px; }

label {
    display: grid;
    gap: 7px;
    color: #344054;
    font-size: 13px;
    font-weight: 700;
}

input, select {
    width: 100%;
    height: 38px;
    border: 1px solid #cfd8e6;
    border-radius: 6px;
    padding: 8px 10px;
    background: #fff;
    color: var(--text);
    outline: none;
}

input:focus,
select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(23, 105, 224, .12);
}

.btn,
button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-height: 38px;
    border: 0;
    border-radius: 6px;
    padding: 9px 16px;
    background: var(--primary);
    color: #fff;
    cursor: pointer;
    font-weight: 800;
    white-space: nowrap;
}

.btn:hover,
button:hover { background: var(--primary-dark); }

.btn.secondary {
    background: #eef1f6;
    color: #263244;
}

.btn.secondary:hover { background: #e1e7f0; }

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

.error {
    color: var(--danger);
    background: #fff1f0;
    border: 1px solid #ffd6d1;
    padding: 10px 12px;
    border-radius: 6px;
    margin-bottom: 14px;
}

.stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.stats div {
    min-height: 104px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 18px;
    box-shadow: 0 8px 22px rgba(20, 35, 66, .05);
}

.stats span {
    color: var(--muted);
    font-weight: 700;
}

.stats strong {
    display: block;
    font-size: 24px;
    line-height: 1.25;
}

.stats .daily-usage-card small {
    margin-top: 5px;
    font-size: 11px;
}

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1120px;
    background: #fff;
}

th, td {
    border-bottom: 1px solid var(--line);
    padding: 14px;
    text-align: left;
    vertical-align: top;
}

th {
    background: #f7f9fc;
    color: #475467;
    font-size: 13px;
    font-weight: 800;
}

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

code {
    display: inline-block;
    max-width: 100%;
    padding: 4px 7px;
    border-radius: 6px;
    background: #f0f4f9;
    color: #182230;
    font-family: Consolas, Monaco, monospace;
    overflow-wrap: anywhere;
}

pre {
    margin: 10px 0 0;
    padding: 12px;
    border: 1px solid #dbe4f0;
    border-radius: 8px;
    background: #0f172a;
    overflow-x: auto;
}

pre code {
    display: block;
    padding: 0;
    background: transparent;
    color: #dbeafe;
    line-height: 1.7;
    white-space: pre-wrap;
}

.credential-cell {
    max-width: 270px;
}

.credential-cell small {
    margin-top: 7px;
    overflow-wrap: anywhere;
}

.quota-line {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    min-width: 120px;
    line-height: 1.8;
}

.quota-line span { color: var(--muted); }

.status {
    display: inline-flex;
    align-items: center;
    height: 26px;
    padding: 0 9px;
    border-radius: 999px;
    font-weight: 800;
    font-size: 12px;
}

.status.ok {
    background: #eafaf3;
    color: var(--success);
}

.status.off {
    background: #fff1f0;
    color: var(--danger);
}

.inline-form {
    grid-template-columns: repeat(4, minmax(92px, 1fr)) auto;
    align-items: end;
    gap: 10px;
    min-width: 540px;
}

.inline-form button,
.recharge-form button { height: 38px; }

.recharge-form {
    grid-template-columns: 110px auto;
    gap: 8px;
}

.order-form {
    display: grid;
    min-width: 210px;
    gap: 8px;
}

.order-form label {
    display: grid;
    gap: 4px;
    color: var(--muted);
    font-size: 12px;
}

.order-form input {
    min-width: 0;
}

.order-edit-form {
    display: grid;
    min-width: 160px;
    gap: 6px;
}

.order-edit-form input,
.order-edit-form select {
    min-width: 0;
}

.empty-cell {
    padding: 32px !important;
    text-align: center;
    color: var(--muted);
}

.limit-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: -10px 0 20px;
    padding: 13px 16px;
    border: 1px solid #dbe5f2;
    border-left: 4px solid var(--primary);
    border-radius: 6px;
    background: #fff;
    color: var(--muted);
}

.limit-strip strong {
    color: var(--text);
}

.grid-form {
    grid-template-columns: 1fr 1fr 1.2fr .8fr .8fr auto;
    align-items: end;
    gap: 12px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fbff;
}

.api-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 10px;
    margin-top: 16px;
}

.api-list span {
    display: grid;
    gap: 4px;
    padding: 12px;
    border: 1px solid #dce7f7;
    border-radius: 8px;
    background: #f8fbff;
    color: var(--muted);
}

.api-list b { color: var(--text); }

.credential-panel { overflow: hidden; }

.credential-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.credential-grid div {
    display: grid;
    gap: 8px;
    padding: 16px;
    border: 1px solid #dce7f7;
    border-radius: 8px;
    background: #f8fbff;
}

.credential-grid span,
.example-card span {
    color: #475467;
    font-weight: 800;
}

.credential-grid code {
    font-size: 15px;
}

.example-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.example-card {
    min-width: 0;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfdff;
}

@media (max-width: 920px) {
    .hero,
    .page-title,
    .section-head {
        align-items: flex-start;
        grid-template-columns: 1fr;
        flex-direction: column;
    }

    .stats,
    .credential-grid,
    .example-grid,
    .grid-form {
        grid-template-columns: 1fr;
    }

    .topbar {
        height: auto;
        padding: 14px 18px;
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }

    .container { padding: 0 14px; }
}

/* 登录与注册 */
.auth-page {
    min-height: 100vh;
    background: #f1f5f9;
}

.auth-page .topbar {
    position: relative;
    height: 72px;
    padding: 0 40px;
    box-shadow: none;
}

.auth-page .container {
    max-width: none;
    margin: 0;
    padding: 64px 24px;
}

.auth-shell {
    display: grid;
    grid-template-columns: 320px 460px;
    min-height: 520px;
    max-width: 780px;
    margin: 0 auto;
    overflow: hidden;
    border: 1px solid #dce3ed;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 24px 60px rgba(25, 39, 65, .12);
}

.auth-brand-panel {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 42px 36px;
    background: #172033;
    color: #fff;
}

.auth-brand-panel::after {
    content: "TAOBAO  ·  JD  ·  API";
    color: #96a4b8;
    font-size: 12px;
    font-weight: 700;
}

.auth-brand-panel > div {
    margin-top: 24px;
}

.auth-brand-panel strong {
    display: block;
    margin-bottom: 10px;
    font-size: 22px;
}

.auth-brand-panel p {
    color: #b7c2d0;
}

.auth-logo {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background: #2474e5;
    font-weight: 900;
}

.auth-shell .auth {
    align-self: center;
    width: auto;
    max-width: none;
    margin: 0;
    padding: 48px;
    border: 0;
    box-shadow: none;
}

.auth-heading {
    margin-bottom: 30px;
}

.auth-heading > span {
    display: inline-block;
    margin-bottom: 12px;
    color: var(--primary);
    font-size: 12px;
    font-weight: 800;
}

.auth-heading h1 {
    margin-bottom: 8px;
    font-size: 27px;
}

.auth-shell input {
    height: 44px;
    background: #fff;
}

.auth-submit {
    width: 100%;
    min-height: 44px;
    margin-top: 4px;
}

.auth-switch {
    text-align: center;
    font-size: 13px;
}

.nav-primary {
    background: var(--primary);
    color: #fff !important;
}

/* 管理后台框架 */
.admin-page {
    background: #f4f6f9;
}

.admin-container {
    min-height: 100vh;
}

.admin-shell {
    display: grid;
    grid-template-columns: 236px minmax(0, 1fr);
    min-height: 100vh;
}

.admin-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 20;
    display: flex;
    flex-direction: column;
    width: 236px;
    padding: 24px 16px;
    background: #182230;
    color: #fff;
}

.admin-brand {
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 48px;
    padding: 0 10px 22px;
    border-bottom: 1px solid rgba(255,255,255,.09);
    color: #fff;
}

.admin-brand > span:last-child {
    display: grid;
    gap: 2px;
}

.admin-brand small {
    color: #97a4b5;
    font-size: 11px;
}

.admin-nav {
    display: grid;
    gap: 6px;
    margin-top: 26px;
}

.admin-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 46px;
    padding: 0 12px;
    border-radius: 6px;
    color: #b8c2d0;
    font-weight: 700;
}

.admin-nav a:hover,
.admin-nav a.active {
    background: #27364a;
    color: #fff;
}

.admin-nav a.active {
    box-shadow: inset 3px 0 #3b82f6;
}

.nav-icon {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 6px;
    background: rgba(255,255,255,.08);
    font-size: 12px;
}

.admin-sidebar-foot {
    display: grid;
    gap: 5px;
    margin-top: auto;
    padding: 18px 12px 0;
    border-top: 1px solid rgba(255,255,255,.09);
}

.admin-sidebar-foot span {
    color: #7f8da1;
    font-size: 11px;
}

.admin-sidebar-foot a {
    margin-top: 8px;
    color: #b8c2d0;
    font-size: 13px;
}

.admin-main {
    grid-column: 2;
    min-width: 0;
}

.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 92px;
    padding: 18px 36px;
    border-bottom: 1px solid #e2e7ef;
    background: #fff;
}

.admin-header h1 {
    margin: 2px 0 0;
    font-size: 24px;
}

.admin-header p,
.admin-header > span {
    color: #748094;
    font-size: 12px;
}

.admin-content {
    display: grid;
    gap: 22px;
    max-width: 1500px;
    margin: 0 auto;
    padding: 30px 36px 48px;
}

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

.metric-card {
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 130px;
    padding: 22px;
    border: 1px solid #e0e6ee;
    border-radius: 8px;
    background: #fff;
}

.metric-card > div {
    display: grid;
    gap: 5px;
}

.metric-card small,
.metric-card p {
    color: #768297;
    font-size: 12px;
}

.metric-card strong {
    font-size: 27px;
}

.metric-icon {
    display: grid;
    place-items: center;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    font-weight: 900;
}

.metric-icon.blue { background:#e9f2ff; color:#1769e0; }
.metric-icon.green { background:#e8f7f0; color:#16875d; }
.metric-icon.amber { background:#fff4dd; color:#a15c00; }
.metric-icon.cyan { background:#e6f7fa; color:#087f8c; }

.content-panel {
    padding: 24px;
    border: 1px solid #e0e6ee;
    border-radius: 8px;
    background: #fff;
}

.panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 22px;
}

.panel-heading h2 {
    font-size: 18px;
}

.panel-heading p {
    font-size: 13px;
}

.text-link {
    font-weight: 700;
}

.clean-table {
    border: 0;
}

.clean-table table {
    min-width: 760px;
}

.clean-table th {
    background: #f7f9fc;
}

/* 用户管理 */
.user-list {
    display: grid;
    gap: 18px;
}

.user-row {
    padding: 22px;
    border: 1px solid #e0e6ee;
    border-radius: 8px;
    background: #fbfcfe;
}

.user-summary {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-summary .status { margin-left: 0; }

.permission-button {
    min-height: 34px;
    margin-left: auto;
    padding: 7px 12px;
    font-size: 12px;
}

.user-avatar {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 8px;
    background: #e8f1ff;
    color: #1769e0;
    font-size: 18px;
    font-weight: 900;
}

.user-summary p {
    font-size: 12px;
}

.user-detail-grid {
    display: grid;
    grid-template-columns: minmax(280px, 2fr) repeat(3, minmax(100px, .6fr));
    gap: 12px;
    margin: 20px 0;
}

.key-block,
.mini-stat {
    display: grid;
    gap: 7px;
    padding: 13px 15px;
    border: 1px solid #e4e9f0;
    border-radius: 6px;
    background: #fff;
}

.key-block span,
.mini-stat span {
    color: #778398;
    font-size: 11px;
}

.settings-form {
    grid-template-columns: repeat(4, minmax(140px, 1fr)) auto;
    align-items: end;
    padding-top: 18px;
    border-top: 1px solid #e5eaf1;
}

.settings-form small {
    font-size: 10px;
}

/* 订单 */
.two-column-content {
    grid-template-columns: 330px minmax(0, 1fr);
    align-items: start;
}

.order-create-panel {
    position: sticky;
    top: 20px;
}

.stack-form textarea {
    width: 100%;
    resize: vertical;
    border: 1px solid #cfd8e6;
    border-radius: 6px;
    padding: 10px;
    font: inherit;
}

.form-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.order-cards {
    display: grid;
    gap: 14px;
}

.order-card {
    padding: 18px;
    border: 1px solid #e1e7ef;
    border-radius: 8px;
}

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

.order-card-head > div {
    display: flex;
    align-items: center;
    gap: 12px;
}

.order-metrics {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin: 16px 0;
    padding: 14px;
    background: #f7f9fc;
    border-radius: 6px;
}

.order-metrics div {
    display: grid;
    gap: 5px;
}

.order-metrics span {
    color: #778398;
    font-size: 11px;
}

.order-manage-form {
    grid-template-columns: 150px 110px minmax(160px, 1fr) auto;
    align-items: end;
}

.empty-state {
    padding: 50px;
    text-align: center;
    color: #778398;
}

/* 上游接口 */
.upstream-form {
    grid-template-columns: 1fr 1fr 1.3fr .65fr .8fr 1.1fr auto;
    align-items: end;
}

.module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 14px;
}

.module-card {
    padding: 18px;
    border: 1px solid #e0e6ee;
    border-radius: 8px;
}

.module-card > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.module-card h3 {
    margin: 18px 0 7px;
    font-family: Consolas, monospace;
    font-size: 16px;
}

.module-card footer {
    margin-top: 18px;
    padding-top: 12px;
    border-top: 1px solid #e8ecf2;
    color: #778398;
    font-size: 12px;
}

.platform-tag {
    padding: 4px 7px;
    border-radius: 5px;
    background: #edf3fc;
    color: #31598a;
    font-size: 11px;
    font-weight: 800;
}

.access-label {
    display: inline-flex;
    align-items: center;
    margin-left: 8px;
    padding: 3px 7px;
    border-radius: 5px;
    font-size: 10px;
    font-weight: 800;
}

.access-label.basic {
    background: #e9f7ef;
    color: #147a52;
}

.access-label.special {
    background: #fff3df;
    color: #9b5b07;
}

.permission-content {
    padding-bottom: 100px;
}

.permission-summary {
    display: grid;
    grid-template-columns: .7fr 1.4fr 1.2fr;
    gap: 14px;
}

.permission-summary > div {
    display: grid;
    gap: 7px;
    padding: 16px 18px;
    border: 1px solid #e0e6ee;
    border-radius: 8px;
    background: #fff;
}

.permission-summary span {
    color: #778398;
    font-size: 11px;
}

.permission-panel {
    margin-bottom: 18px;
}

.permission-panel .panel-heading > span {
    color: #778398;
    font-size: 12px;
}

.permission-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.permission-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 190px;
    align-items: center;
    gap: 14px;
    min-height: 76px;
    padding: 13px 14px;
    border: 1px solid #e3e8ef;
    border-radius: 7px;
    background: #fbfcfe;
}

.permission-name {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 9px;
    min-width: 0;
}

.permission-name strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
}

.permission-item select {
    height: 36px;
    font-size: 12px;
}

.permission-savebar {
    position: fixed;
    right: 28px;
    bottom: 22px;
    left: 264px;
    z-index: 15;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    max-width: 1440px;
    margin: 0 auto;
    padding: 14px 18px;
    border: 1px solid #d9e1eb;
    border-radius: 8px;
    background: rgba(255,255,255,.96);
    box-shadow: 0 14px 36px rgba(20,35,66,.14);
    backdrop-filter: blur(10px);
}

.permission-savebar p {
    font-size: 12px;
}

@media (max-width: 1100px) {
    .metric-grid { grid-template-columns: repeat(2, 1fr); }
    .two-column-content { grid-template-columns: 1fr; }
    .order-create-panel { position: static; }
    .settings-form,
    .upstream-form { grid-template-columns: repeat(2, 1fr); }
    .permission-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
    .auth-page .container { padding: 24px 14px; }
    .auth-shell { grid-template-columns: 1fr; min-height: 0; }
    .auth-brand-panel { min-height: 170px; padding: 28px; }
    .auth-shell .auth { padding: 30px 26px; }
    .admin-shell { display: block; }
    .admin-sidebar { position: relative; width: 100%; min-height: auto; }
    .admin-nav { grid-template-columns: repeat(2, 1fr); }
    .admin-sidebar-foot { display: none; }
    .admin-main { width: 100%; }
    .admin-header { padding: 18px; }
    .admin-content { padding: 20px 14px 36px; }
    .metric-grid,
    .user-detail-grid,
    .order-metrics,
    .settings-form,
    .upstream-form,
    .order-manage-form { grid-template-columns: 1fr; }
    .form-pair { grid-template-columns: 1fr; }
    .permission-summary { grid-template-columns: 1fr; }
    .permission-item { grid-template-columns: 1fr; }
    .permission-savebar { left: 14px; right: 14px; bottom: 12px; }
}

/* 客户控制台与在线测试 */
.customer-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 18px;
    padding: 5px;
    border: 1px solid #dfe6ef;
    border-radius: 7px;
    background: #fff;
}

.customer-tabs a {
    padding: 9px 16px;
    border-radius: 5px;
    color: #596579;
    font-weight: 700;
}

.customer-tabs a:hover,
.customer-tabs a.active {
    background: #eaf2ff;
    color: #1769e0;
}

.tester-usage {
    display: grid;
    gap: 4px;
    min-width: 150px;
    padding: 12px 16px;
    border: 1px solid #dce4ef;
    border-radius: 7px;
    background: #fff;
}

.tester-usage span {
    color: #778398;
    font-size: 11px;
}

.tester-layout {
    display: grid;
    grid-template-columns: minmax(360px, .85fr) minmax(520px, 1.4fr);
    gap: 18px;
}

.tester-panel {
    min-width: 0;
    padding: 24px;
    border: 1px solid #dfe6ef;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(20, 35, 66, .05);
}

.tester-panel-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 22px;
    padding-bottom: 18px;
    border-bottom: 1px solid #e7ebf1;
}

.tester-panel-head h2 {
    margin-bottom: 3px;
}

.tester-panel-head p {
    font-size: 12px;
}

.step-number {
    display: grid;
    place-items: center;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    border-radius: 7px;
    background: #1769e0;
    color: #fff;
    font-weight: 900;
}

.result-step {
    background: #16875d;
}

.tester-form select,
.tester-form input {
    height: 43px;
}

.tester-form textarea {
    width: 100%;
    min-height: 190px;
    resize: vertical;
    border: 1px solid #cfd8e6;
    border-radius: 6px;
    padding: 12px;
    background: #f9fbfd;
    color: #182230;
    font-family: Consolas, Monaco, monospace;
    line-height: 1.7;
    outline: none;
}

.tester-form textarea:focus {
    border-color: #1769e0;
    box-shadow: 0 0 0 3px rgba(23,105,224,.12);
}

.api-description {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: -4px;
    padding: 11px 13px;
    border-left: 3px solid #1769e0;
    background: #f1f6fd;
    color: #596579;
    font-size: 12px;
}

.api-description strong {
    color: #263244;
}

.tester-actions {
    display: flex;
    gap: 10px;
}

.tester-actions button:first-child {
    flex: 1;
}

.tester-actions button:disabled {
    cursor: wait;
    opacity: .65;
}

.result-meta {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 14px;
}

.result-meta div {
    display: grid;
    gap: 5px;
    padding: 12px;
    border: 1px solid #e2e7ee;
    border-radius: 6px;
    background: #f8fafc;
}

.result-meta span {
    color: #7a8597;
    font-size: 11px;
}

.result-meta strong {
    font-size: 13px;
}

.result-meta .success { color: #16875d; }
.result-meta .failed { color: #b42318; }
.result-meta .pending { color: #a15c00; }

.request-preview {
    display: grid;
    gap: 7px;
    margin-bottom: 12px;
}

.request-preview span {
    color: #667085;
    font-size: 11px;
    font-weight: 700;
}

.request-preview code {
    display: block;
    padding: 9px 11px;
}

.result-output {
    height: 410px;
    margin: 0;
    background: #111827;
}

.result-output code {
    height: 100%;
    overflow: auto;
    white-space: pre;
    color: #d8e3f2;
}

.copy-result {
    margin-top: 12px;
}

.content-guide {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-top: 18px;
}

.content-guide div {
    padding: 17px;
    border: 1px solid #dfe6ef;
    border-radius: 7px;
    background: #fff;
}

.content-guide p {
    margin-top: 7px;
    font-size: 12px;
}

@media (max-width: 980px) {
    .tester-layout { grid-template-columns: 1fr; }
}

/* 客户详情、日志与流水 */
.action-group { display:flex; gap:7px; flex-wrap:wrap; }
.customer-save-button[hidden] { display:none; }
.customer-inline-form .inline-edit-input:read-only { border-color:transparent; background:transparent; }
.amount-in { color:#16875d; }
.amount-out { color:#b42318; }
.detail-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px; }
.detail-grid .content-panel { margin:0; }
.detail-wide { grid-column:1/-1; }
.detail-list { display:grid; grid-template-columns:140px 1fr; gap:0; margin:18px 0 0; }
.detail-list dt,.detail-list dd { margin:0; padding:12px 0; border-bottom:1px solid #edf0f4; }
.detail-list dt { color:#667085; }
.log-code { overflow:auto; min-height:100px; padding:16px; border-radius:6px; background:#101828; color:#e7edf7; white-space:pre-wrap; word-break:break-word; }
.security-form { display:grid; gap:18px; }
.security-form > label:not(.setting-switch) { display:grid; gap:8px; color:#344054; font-weight:600; }
.security-form textarea { resize:vertical; }
.setting-switch { display:flex; justify-content:space-between; align-items:center; gap:24px; padding:16px; border:1px solid #dbe3ee; border-radius:7px; }
.setting-switch > span:first-child { display:grid; gap:4px; }
.setting-switch small { color:#667085; font-weight:400; }
.permission-search { justify-content:flex-start; }
.permission-search input { max-width:500px; }

@media (max-width: 760px) {
    .detail-grid { grid-template-columns:1fr; }
    .detail-wide { grid-column:auto; }
    .detail-list { grid-template-columns:1fr; }
    .detail-list dt { padding-bottom:0; border-bottom:0; }
}

@media (max-width: 620px) {
    .result-meta,
    .content-guide { grid-template-columns: 1fr; }
    .tester-panel { padding: 18px; }
    .result-output { height: 330px; }
    .tester-actions { flex-direction: column; }
}

/* 通用列表工具栏与分页 */
.list-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
    padding: 12px;
    border: 1px solid #e1e7ef;
    border-radius: 7px;
    background: #f8fafc;
}

.search-box {
    display: flex;
    flex: 1;
    max-width: 560px;
    gap: 8px;
}

.search-box input {
    flex: 1;
}

.search-box button,
.search-box .btn {
    min-height: 38px;
}

.list-toolbar > label {
    display: flex;
    align-items: center;
    grid-template-columns: none;
    gap: 8px;
    white-space: nowrap;
}

.list-toolbar > label select {
    width: 100px;
}

.pagination-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 18px;
    color: #6f7b8f;
    font-size: 12px;
}

.pagination {
    display: flex;
    align-items: center;
    gap: 5px;
}

.pagination a,
.page-ellipsis {
    display: grid;
    place-items: center;
    min-width: 34px;
    height: 34px;
    padding: 0 9px;
    border: 1px solid #dce3ec;
    border-radius: 5px;
    background: #fff;
    color: #4d596c;
    font-weight: 700;
}

.pagination a:hover,
.pagination a.active {
    border-color: #1769e0;
    background: #1769e0;
    color: #fff;
}

.pagination a.disabled {
    pointer-events: none;
    opacity: .42;
}

.page-ellipsis {
    border-color: transparent;
    background: transparent;
}

/* 紧凑管理列表 */
.compact-table table {
    min-width: 1120px;
}

.compact-table th,
.compact-table td {
    padding: 11px 12px;
    vertical-align: middle;
}

.customer-table {
    table-layout: fixed;
}

.customer-table th:nth-child(1) { width: 165px; }
.customer-table th:nth-child(2) { width: 225px; }
.customer-table th:nth-child(3) { width: 145px; }
.customer-table th:nth-child(4) { width: 130px; }
.customer-table th:nth-child(5) { width: 250px; }
.customer-table th:nth-child(6) { width: 125px; }
.customer-table th:nth-child(7) { width: 100px; }

.compact-user {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.compact-user .user-avatar {
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    font-size: 14px;
}

.compact-user > div {
    min-width: 0;
}

.compact-user strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.single-line-code {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.quota-compact {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    font-size: 12px;
}

.quota-compact span {
    color: #7a8597;
}

.quota-compact strong {
    color: #172033;
}

.compact-settings {
    display: grid;
    grid-template-columns: 100px 100px 100px 110px 68px;
    align-items: end;
    gap: 8px;
}

.compact-settings label {
    gap: 4px;
    font-size: 10px;
}

.compact-settings input,
.compact-settings select,
.compact-settings button {
    height: 34px;
    min-height: 34px;
}

.table-action {
    min-height: 34px;
    padding: 7px 10px;
    font-size: 12px;
}

.create-order-inline {
    grid-template-columns: minmax(230px, 1.5fr) .7fr .6fr .8fr 1fr auto;
    align-items: end;
}

.order-table {
    min-width: 1040px !important;
}

.order-table th:nth-child(1) { width: 250px; }
.order-table th:nth-child(2) { width: 190px; }
.order-table th:nth-child(3) { width: 115px; }
.order-table th:nth-child(4) { width: 95px; }

.table-secondary {
    display: block;
    margin-top: 5px;
    font-size: 12px;
}

.compact-order-settings {
    display: grid;
    grid-template-columns: 140px 90px minmax(150px, 1fr) 66px;
    align-items: center;
    gap: 7px;
}

.compact-order-settings input,
.compact-order-settings select,
.compact-order-settings button {
    height: 34px;
    min-height: 34px;
}

.api-config-table {
    min-width: 1180px !important;
}

.api-config-table th:nth-child(1) { width: 80px; }
.api-config-table th:nth-child(2) { width: 190px; }
.api-config-table th:nth-child(3) { width: 290px; }
.api-config-table th:nth-child(4) { width: 95px; }
.api-config-table th:nth-child(5) { width: 140px; }
.api-config-table th:nth-child(6) { width: 110px; }
.api-config-table th:nth-child(7) { width: 150px; }

.api-config-table input,
.api-config-table select {
    height: 34px;
}

.small-number-input {
    min-width: 70px;
}

.api-row-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.api-row-actions form {
    display: block;
}

.api-row-actions button {
    min-height: 34px;
    padding: 7px 11px;
    font-size: 12px;
}

@media (min-width: 1200px) {
    .api-config-table {
        width:100%;
        min-width:100% !important;
        table-layout:auto;
    }
    .api-config-table th:nth-child(n) {
        width:auto;
    }
    .api-config-table th:nth-child(1) { width:7%; }
    .api-config-table th:nth-child(2) { width:14%; }
    .api-config-table th:nth-child(3) { width:25%; }
    .api-config-table th:nth-child(4) { width:9%; }
    .api-config-table th:nth-child(5) { width:10%; }
    .api-config-table th:nth-child(6) { width:11%; }
    .api-config-table th:nth-child(7) { width:11%; }
    .api-config-table th:nth-child(8) { width:13%; }
}

.danger-button {
    background: #fff1f0;
    color: #b42318;
}

.danger-button:hover {
    background: #b42318;
    color: #fff;
}

.record-count {
    color: #6f7b8f;
    font-size: 12px;
}

.customer-order-table table {
    min-width: 1120px;
}

.customer-order-table th:nth-child(1) { width: 210px; }
.customer-order-table th:nth-child(2),
.customer-order-table th:nth-child(3),
.customer-order-table th:nth-child(4) { width: 115px; }
.customer-order-table th:nth-child(5),
.customer-order-table th:nth-child(6) { width: 165px; }
.customer-order-table th:nth-child(7) { width: 100px; }

.customer-tabs {
    overflow-x: auto;
    white-space: nowrap;
}

/* 开发文档 */
.docs-layout {
    display: grid;
    grid-template-columns: 210px minmax(0, 1fr);
    align-items: start;
    gap: 20px;
}

.docs-nav {
    position: sticky;
    top: 88px;
    display: grid;
    gap: 5px;
    padding: 18px;
    border: 1px solid #dfe6ef;
    border-radius: 8px;
    background: #fff;
}

.docs-nav strong {
    margin-bottom: 9px;
}

.docs-nav a {
    padding: 8px 10px;
    border-radius: 5px;
    color: #596579;
}

.docs-nav a:hover {
    background: #edf4ff;
    color: #1769e0;
}

.docs-content {
    display: grid;
    gap: 18px;
    min-width: 0;
}

.docs-section {
    position: relative;
    scroll-margin-top: 90px;
    padding: 26px;
    border: 1px solid #dfe6ef;
    border-radius: 8px;
    background: #fff;
}

.docs-index {
    position: absolute;
    top: 25px;
    right: 25px;
    color: #c5ceda;
    font-size: 22px;
    font-weight: 900;
}

.docs-section h2 {
    margin-bottom: 9px;
}

.endpoint-box {
    display: grid;
    gap: 8px;
    margin-top: 18px;
    padding: 15px;
    border: 1px solid #d9e4f2;
    border-radius: 7px;
    background: #f6f9fd;
}

.endpoint-box span {
    color: #778398;
    font-size: 11px;
}

.docs-note {
    margin-top: 14px;
    padding: 12px 14px;
    border-left: 3px solid #d58b16;
    background: #fff9ec;
    color: #76521b;
    font-size: 12px;
}

.docs-credential-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 18px;
}

.docs-credential-grid div {
    display: grid;
    gap: 7px;
    min-width: 0;
    padding: 14px;
    border: 1px solid #e1e7ef;
    border-radius: 7px;
    background: #f9fbfd;
}

.docs-credential-grid span {
    color: #778398;
    font-size: 11px;
}

.docs-credential-grid code {
    overflow-wrap: anywhere;
}

.docs-table-wrap {
    margin-top: 18px;
    overflow-x: auto;
    border: 1px solid #e1e7ef;
    border-radius: 7px;
}

.docs-table {
    min-width: 620px;
}

.code-tabs {
    display: flex;
    gap: 5px;
    margin-top: 20px;
    padding: 5px;
    border-radius: 6px;
    background: #eef2f7;
}

.code-tabs button {
    min-height: 34px;
    padding: 7px 15px;
    background: transparent;
    color: #566276;
}

.code-tabs button:hover,
.code-tabs button.active {
    background: #fff;
    color: #1769e0;
    box-shadow: 0 2px 8px rgba(20,35,66,.08);
}

.code-sample {
    display: none;
}

.code-sample.active {
    display: block;
}

.code-sample pre {
    max-height: 430px;
    margin-top: 10px;
}

.response-codes {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 9px;
    margin-top: 16px;
}

.response-codes div {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border: 1px solid #e1e7ef;
    border-radius: 6px;
}

.docs-api-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    margin-top: 18px;
}

.docs-api-grid div {
    display: grid;
    gap: 6px;
    min-width: 0;
    padding: 12px;
    border: 1px solid #e1e7ef;
    border-radius: 6px;
}

.docs-api-grid span {
    color: #667085;
    font-size: 12px;
}

@media (max-width: 1100px) {
    .create-order-inline { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 820px) {
    .list-toolbar,
    .pagination-wrap { align-items: stretch; flex-direction: column; }
    .search-box { max-width: none; }
    .pagination { flex-wrap: wrap; }
    .docs-layout { grid-template-columns: 1fr; }
    .docs-nav { position: static; grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 620px) {
    .search-box { flex-wrap: wrap; }
    .search-box input { flex-basis: 100%; }
    .create-order-inline,
    .docs-credential-grid,
    .response-codes,
    .docs-api-grid { grid-template-columns: 1fr; }
    .docs-nav { grid-template-columns: repeat(2, 1fr); }
    .docs-section { padding: 20px 16px; }
    .code-tabs { overflow-x: auto; }
}

/* 平台折叠接口权限 */
.permission-content-simple {
    padding-bottom: 48px;
}

.platform-accordions {
    display: grid;
    gap: 12px;
}

.platform-accordion {
    overflow: hidden;
    border: 1px solid #dfe5ed;
    border-radius: 8px;
    background: #fff;
}

.platform-accordion summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 64px;
    padding: 14px 18px;
    cursor: pointer;
    list-style: none;
    color: #758196;
}

.platform-accordion summary::-webkit-details-marker {
    display: none;
}

.platform-accordion summary::after {
    content: "展开";
    padding: 5px 9px;
    border-radius: 5px;
    background: #eef2f7;
    color: #4f5c70;
    font-size: 11px;
    font-weight: 800;
}

.platform-accordion[open] summary {
    border-bottom: 1px solid #e5eaf1;
}

.platform-accordion[open] summary::after {
    content: "收起";
}

.platform-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.platform-title strong {
    color: #172033;
    font-size: 16px;
}

.switch-permission-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    padding: 8px 18px;
}

.switch-permission-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-height: 64px;
    padding: 11px 8px;
    border-bottom: 1px solid #edf0f4;
}

.switch-permission-item:nth-last-child(-n+2) {
    border-bottom: 0;
}

.switch-permission-list .permission-name {
    grid-template-columns: minmax(120px, auto) minmax(0, 1fr);
}

.permission-state {
    display: flex;
    align-items: center;
    gap: 7px;
    flex: 0 0 auto;
}

.state-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.state-dot.on {
    background: #1aa36f;
    box-shadow: 0 0 0 3px #e3f7ef;
}

.state-dot.off {
    background: #aab3c1;
    box-shadow: 0 0 0 3px #eef1f5;
}

.state-text {
    min-width: 42px;
    color: #6f7b8f;
    font-size: 11px;
}

.ios-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 26px;
    cursor: pointer;
}

.ios-switch input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.ios-switch > span {
    position: absolute;
    inset: 0;
    border-radius: 13px;
    background: #c9d0da;
    transition: background .18s ease;
}

.ios-switch > span::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,.22);
    transition: transform .18s ease;
}

.ios-switch input:checked + span {
    background: #21b66f;
}

.ios-switch input:checked + span::after {
    transform: translateX(18px);
}

.ios-switch input:focus-visible + span {
    outline: 3px solid rgba(23,105,224,.2);
}

.permission-name mark {
    padding: 1px 2px;
    border-radius: 3px;
    background: #fff0a8;
    color: #6e4d00;
}

.save-toast {
    position: fixed;
    right: 28px;
    bottom: 24px;
    z-index: 50;
    padding: 11px 16px;
    border-radius: 7px;
    background: #16875d;
    color: #fff;
    box-shadow: 0 12px 30px rgba(20,35,66,.2);
    opacity: 0;
    pointer-events: none;
    transform: translateY(12px);
    transition: opacity .18s ease, transform .18s ease;
}

.save-toast.show {
    opacity: 1;
    transform: translateY(0);
}

.save-toast.failed {
    background: #b42318;
}

/* 接口列表按需编辑 */
.inline-edit-input {
    border-color: transparent;
    background: transparent;
    cursor: text;
}

.inline-edit-input:hover {
    border-color: #d5deea;
    background: #f8fafc;
}

.inline-edit-input:focus {
    border-color: #1769e0;
    background: #fff;
}

.inline-select-trigger {
    justify-content: flex-start;
    width: 100%;
    min-height: 34px;
    padding: 7px 10px;
    background: transparent;
    color: #344054;
    font-size: 12px;
}

.inline-select-trigger:hover {
    background: #eef3f8;
}

/* 系统设置、验证码与公告 */
.success-message { margin-bottom:16px; padding:12px 14px; border:1px solid #b7e3cf; border-radius:7px; background:#ecf9f3; color:#117653; }
.captcha-row { display:grid; grid-template-columns:minmax(0,1fr) 180px; gap:10px; align-items:center; }
.captcha-image { width:180px; height:58px; border:1px solid #cbd6e4; border-radius:7px; cursor:pointer; user-select:none; }
.settings-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px; }
.settings-card { display:grid; align-content:start; gap:16px; margin:0; }
.settings-card > label:not(.setting-switch), .announcement-form > label:not(.setting-switch) { display:grid; gap:7px; color:#344054; font-weight:600; }
.form-note { padding:11px 13px; border-left:3px solid #1769e0; background:#f2f7fd; font-size:12px; }
.admin-settings-form .form-note { margin-top:20px; margin-bottom:2px; }
.settings-actions { grid-column:1/-1; display:flex; justify-content:flex-end; }
.announcement-form { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:15px; }
.announcement-form .wide-field { grid-column:1/-1; }
.announcement-form textarea { width:100%; resize:vertical; }
.announcement-admin-list { display:grid; gap:12px; }
.announcement-admin-item { padding:15px; border:1px solid #dfe6ef; border-radius:8px; }
.announcement-admin-item > summary { display:flex; justify-content:space-between; gap:16px; cursor:pointer; }
.announcement-admin-item > summary span:first-child { display:grid; gap:5px; }
.announcement-admin-item > summary small { color:#667085; }
.announcement-admin-item[open] > summary { margin-bottom:18px; padding-bottom:14px; border-bottom:1px solid #e7ebf1; }
.announcement-admin-item > form:last-child { margin-top:10px; }
.announcement-bar { display:grid; gap:0; margin-bottom:18px; overflow:hidden; border:1px solid #d9e5f4; border-radius:8px; background:#fff; }
.announcement-bar-title { display:flex; justify-content:space-between; padding:12px 16px; background:#edf5ff; color:#175da8; }
.announcement-bar-item { display:flex; align-items:flex-start; justify-content:space-between; gap:18px; padding:15px 16px; border-top:1px solid #e8edf3; }
.announcement-bar-item p { margin:7px 0; color:#4f5d71; line-height:1.7; }
.announcement-bar-item small { color:#8a94a4; }
.announcement-bar-item.is-read { opacity:.62; }
.announcement-read { flex:0 0 auto; min-height:34px; padding:7px 12px; }
.announcement-modal { position:fixed; inset:0; z-index:1000; display:grid; place-items:center; padding:20px; background:rgba(13,24,43,.62); backdrop-filter:blur(3px); }
.announcement-modal-card { width:min(560px,100%); padding:28px; border-radius:12px; background:#fff; box-shadow:0 30px 80px rgba(0,0,0,.28); }
.announcement-modal-card h2 { margin:8px 0 14px; }
.announcement-modal-content { max-height:45vh; overflow:auto; margin-bottom:14px; color:#465268; line-height:1.8; white-space:pre-wrap; }
.announcement-modal-card small { display:block; margin-bottom:18px; color:#8a94a4; }
.announcement-modal-close { width:100%; }
.announcement-modal[hidden] { display:none; }

/* 与既有管理后台统一的新页面 */
.admin-settings-form { display:grid; gap:18px; }
.admin-settings-form .content-panel,
.announcement-standard-form { margin:0; }
.standard-form-grid {
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:16px;
}
.standard-form-grid > label {
    display:grid;
    align-content:start;
    gap:7px;
    color:#344054;
    font-size:12px;
    font-weight:700;
}
.standard-form-grid .wide-field { grid-column:1/-1; }
.standard-form-grid textarea {
    width:100%;
    min-height:128px;
    resize:vertical;
}
.settings-switch-list {
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:12px;
}
.settings-switch-list .setting-switch,
.announcement-options .setting-switch {
    min-height:76px;
    background:#fbfcfe;
}
.settings-account-type {
    margin-top:16px;
    padding-top:16px;
    border-top:1px solid #e8edf3;
}
.admin-form-actions {
    display:flex;
    justify-content:flex-end;
    margin-top:16px;
}
.admin-form-actions button,
.record-actions button {
    min-width:112px;
}
.announcement-standard-form { display:block; }
.announcement-options {
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:12px;
    margin-top:16px;
}
.announcement-records {
    overflow:hidden;
    border:1px solid #e1e7ef;
    border-radius:7px;
}
.announcement-record {
    border-bottom:1px solid #e8edf3;
    background:#fff;
}
.announcement-record:last-child { border-bottom:0; }
.announcement-record-row,
.announcement-record > summary {
    display:grid;
    grid-template-columns:minmax(250px,1fr) 82px 120px 80px;
    align-items:center;
    gap:16px;
    padding:16px 18px;
    cursor:pointer;
    list-style:none;
}
.announcement-record-row {
    display:grid;
    grid-template-columns:minmax(250px,1fr) 82px 120px 110px;
    align-items:center;
    gap:16px;
    padding:18px 22px;
}
.announcement-record > summary::-webkit-details-marker { display:none; }
.announcement-record > summary:hover { background:#f8fafc; }
.announcement-record[open] > summary { background:#f4f8fd; border-bottom:1px solid #dfe7f1; }
.announcement-record-main { display:grid; gap:5px; min-width:0; }
.announcement-record-main strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.announcement-record-main small { color:#7b8798; font-size:11px; }
.record-edit-form { padding:20px 18px 10px; }
.record-actions { display:flex; justify-content:flex-end; margin-top:16px; }
.record-delete-form { display:flex; justify-content:flex-end; padding:0 18px 18px; }
.standalone-empty { padding:70px 20px; text-align:center; color:#8a94a4; }
.admin-modal {
    position:fixed;
    inset:0;
    z-index:1000;
    display:grid;
    place-items:center;
    padding:28px;
    background:rgba(13,24,43,.64);
    backdrop-filter:blur(4px);
}
.admin-modal[hidden] { display:none; }
.admin-modal-card {
    width:min(980px,100%);
    max-height:calc(100vh - 56px);
    overflow:auto;
    padding:28px;
    border-radius:10px;
    background:#fff;
    box-shadow:0 30px 90px rgba(0,0,0,.3);
}
.admin-modal-header {
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:20px;
    margin-bottom:24px;
    padding-bottom:18px;
    border-bottom:1px solid #e5eaf1;
}
.admin-modal-header p { margin-bottom:3px; font-size:12px; }
.admin-modal-header h2 { margin:0; font-size:23px; }
.admin-modal-x {
    width:38px;
    min-height:38px;
    padding:0;
    border-radius:50%;
    background:#eef2f7;
    color:#596579;
    font-size:24px;
    font-weight:400;
}
.admin-modal-x:hover { background:#e2e8f0; color:#172033; }
.admin-modal-actions {
    display:flex;
    justify-content:space-between;
    gap:12px;
    margin-top:20px;
}
.admin-modal-actions button { min-width:120px; min-height:44px; }

.profile-grid {
    display:grid;
    grid-template-columns:minmax(0,.85fr) minmax(420px,1.15fr);
    gap:24px;
}
.profile-card { margin:0; }
.profile-details { display:grid; gap:0; margin:8px 0 24px; }
.profile-details > div {
    display:grid;
    grid-template-columns:120px minmax(0,1fr);
    gap:18px;
    padding:15px 0;
    border-bottom:1px solid #e8edf3;
}
.profile-details dt { color:#788497; }
.profile-details dd { margin:0; color:#202c3d; font-weight:700; word-break:break-all; }
.profile-logout { width:100%; min-height:44px; }
.profile-card form input { height:46px; }
.profile-card form button { min-height:44px; margin-top:5px; }

/* 客户端左侧公告栏 */
.customer-with-announcements {
    display:grid;
    grid-template-columns:230px minmax(0,1fr);
    align-items:start;
    gap:18px;
}
.customer-page-content { min-width:0; }
.customer-announcement-sidebar {
    position:sticky;
    top:20px;
    overflow:hidden;
    border:1px solid #dfe6ef;
    border-radius:8px;
    background:#fff;
    box-shadow:0 8px 24px rgba(20,35,66,.05);
}
.customer-announcement-head {
    display:flex;
    align-items:center;
    justify-content:space-between;
    padding:14px;
    border-bottom:1px solid #e5ebf2;
    background:#f7faff;
}
.customer-announcement-head > div { display:flex; align-items:center; gap:9px; }
.customer-announcement-head > span {
    min-width:24px;
    padding:3px 7px;
    border-radius:12px;
    background:#e7f0fd;
    color:#1769e0;
    font-size:11px;
    text-align:center;
}
.announcement-bell {
    display:grid;
    place-items:center;
    width:28px;
    height:28px;
    border-radius:6px;
    background:#1769e0;
    color:#fff;
    font-size:12px;
    font-weight:800;
}
.customer-announcement-list {
    max-height:calc(100vh - 190px);
    overflow:auto;
}
.customer-announcement-item {
    position:relative;
    display:grid;
    grid-template-columns:8px minmax(0,1fr);
    align-items:start;
    gap:9px;
    width:100%;
    min-height:0;
    padding:13px 14px;
    border:0;
    border-bottom:1px solid #edf0f4;
    border-radius:0;
    background:#fff;
    color:#263244;
    text-align:left;
}
.customer-announcement-item:hover { background:#f3f7fc; color:#1769e0; }
.customer-announcement-item > span:last-child { display:grid; gap:6px; min-width:0; }
.customer-announcement-item strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:12px; }
.customer-announcement-item small { color:#8b96a6; font-size:10px; font-weight:400; }
.announcement-unread-dot {
    width:7px;
    height:7px;
    margin-top:5px;
    border-radius:50%;
    background:#1769e0;
    box-shadow:0 0 0 3px #e8f1ff;
}
.customer-announcement-item.is-read .announcement-unread-dot { background:#bbc3ce; box-shadow:none; }
.customer-announcement-item.is-read strong { color:#7c8797; font-weight:600; }
.customer-announcement-empty { padding:30px 12px; color:#909aaa; font-size:12px; text-align:center; }
.announcement-detail-close { width:100%; }
.password-field {
    position:relative;
    display:block;
}
.password-field input { padding-right:48px; }
.password-field button {
    position:absolute;
    top:5px;
    right:5px;
    width:34px;
    min-height:34px;
    padding:0;
    border:1px solid #d5deea;
    background:#f4f7fb;
    color:#536174;
    font-size:12px;
    font-weight:800;
}
.password-field button:hover,
.password-field button.is-visible {
    border-color:#1769e0;
    background:#eaf2ff;
    color:#1769e0;
}
.operation-notice {
    margin:0;
    box-shadow:0 6px 18px rgba(20,35,66,.05);
}
.customer-table {
    width:100%;
    min-width:1420px;
    table-layout:auto;
}
.customer-table th:nth-child(1) { width:15%; }
.customer-table th:nth-child(2) { width:20%; }
.customer-table th:nth-child(3) { width:11%; }
.customer-table th:nth-child(4) { width:10%; }
.customer-table th:nth-child(5) { width:15%; }
.customer-table th:nth-child(6) { width:10%; }
.customer-table th:nth-child(7) { width:19%; }
.customer-table td { vertical-align:middle; }
.table-field {
    display:grid;
    gap:5px;
    min-width:0;
}
.table-field > span {
    color:#7b8798;
    font-size:10px;
    font-weight:600;
    white-space:nowrap;
}
.admin-table-input {
    width:100%;
    min-width:78px;
    height:38px;
    padding:7px 9px;
    border:1px solid #d5deea;
    background:#fff;
}
.rate-fields {
    display:grid;
    grid-template-columns:repeat(2,minmax(72px,1fr));
    gap:8px;
}
.customer-actions {
    display:grid;
    grid-template-columns:repeat(2,minmax(78px,1fr));
    gap:7px;
}
.customer-actions form { display:block; }
.customer-actions .table-action {
    width:100%;
    min-height:36px;
    padding:7px 9px;
    white-space:nowrap;
}
.customer-action-neutral {
    border:1px solid #dce4ed !important;
    background:#eef2f6 !important;
    color:#344054 !important;
}
.customer-action-neutral:hover {
    border-color:#c7d2df !important;
    background:#e3e9f0 !important;
}
.customer-save-action:disabled,
button[data-dirty-submit]:disabled,
button[data-announcement-save]:disabled {
    border:1px solid #dce3eb;
    background:#e9edf2;
    color:#98a2b3;
    cursor:not-allowed;
    opacity:1;
}
.customer-save-action.is-dirty,
button[data-dirty-submit].is-dirty,
button[data-announcement-save].is-dirty {
    border-color:#1769e0;
    background:#1769e0;
    color:#fff;
    cursor:pointer;
}
.customer-clear-action {
    border:1px solid #ffd8d4 !important;
    background:#fff0ee !important;
    color:#c83228 !important;
}
.customer-clear-action:hover {
    background:#c83228 !important;
    color:#fff !important;
}

/* 宽屏页面：扩大内容占比和基础视觉尺寸 */
html {
    min-height:100%;
    background:#f3f6fb;
}
body {
    min-height:100vh;
    background:#f3f6fb;
    background-image:none;
}
.auth-page,
.admin-page {
    min-height:100vh;
    background:#f3f6fb;
}
.container {
    width:calc(100% - 64px);
    max-width:1840px;
    margin:34px auto 56px;
    padding:0;
}
.container:not(.admin-container) {
    min-height:calc(100vh - 154px);
}
.customer-with-announcements {
    min-height:calc(100vh - 154px);
}
.customer-tabs {
    display:none;
}
.topbar nav {
    align-self:stretch;
    gap:4px;
}
.topbar nav a {
    position:relative;
    display:flex;
    align-items:center;
    padding:0 15px;
    border-radius:0;
    color:#596579;
}
.topbar nav a:hover {
    background:#f4f8fd;
}
.topbar nav a.active {
    background:#eef5ff;
    color:#1769e0;
}
.topbar nav a.active::after {
    content:"";
    position:absolute;
    right:12px;
    bottom:0;
    left:12px;
    height:3px;
    border-radius:3px 3px 0 0;
    background:#1769e0;
}
.topbar nav .customer-logout-link {
    margin-left:8px;
    color:#7a8597;
}
.customer-with-announcements {
    grid-template-columns:280px minmax(0,1fr);
    gap:26px;
}
.customer-announcement-head { padding:17px 18px; }
.customer-announcement-item { padding:16px 18px; }
.customer-announcement-item strong { font-size:14px; }
.customer-announcement-item small { font-size:11px; }
.customer-page-content .page-title h1 { font-size:32px; }
.customer-page-content .panel { padding:30px; margin-bottom:22px; }
.customer-page-content .stats { gap:18px; }
.customer-page-content .stats > div { min-height:112px; padding:22px; }
.customer-page-content .stats strong { font-size:25px; }
.customer-page-content .customer-tabs { margin-bottom:22px; padding:7px; }
.customer-page-content .customer-tabs a { padding:11px 19px; }
.auth-shell {
    grid-template-columns:360px 540px;
    max-width:900px;
    min-height:570px;
}
.auth-brand-panel { padding:48px 42px; }
.auth-shell .auth { padding:52px 56px; }
.auth-heading h1 { font-size:31px; }
.auth-shell input { height:48px; font-size:14px; }
.auth-submit { min-height:48px; font-size:14px; }

.admin-content {
    width:100%;
    max-width:none;
    gap:26px;
    padding:34px 44px 58px;
}
.admin-header { min-height:100px; padding:20px 44px; }
.admin-header h1 { font-size:28px; }
.content-panel { padding:30px; }
.panel-heading { margin-bottom:26px; }
.panel-heading h2 { font-size:21px; }
.panel-heading p { font-size:14px; }
.standard-form-grid { gap:20px; }
.standard-form-grid > label,
.settings-card > label,
.announcement-standard-form label { font-size:14px; }
.standard-form-grid input,
.standard-form-grid select,
.password-field input { height:46px; padding:10px 13px; font-size:14px; }
.standard-form-grid textarea { min-height:160px; padding:13px; font-size:14px; line-height:1.7; }
.settings-switch-list,
.announcement-options { gap:16px; }
.settings-switch-list .setting-switch,
.announcement-options .setting-switch { min-height:88px; padding:19px; }
.announcement-record > summary { min-height:76px; padding:18px 22px; }
.announcement-record-main strong { font-size:15px; }
.admin-form-actions button,
.record-actions button { min-height:44px; padding:10px 22px; font-size:14px; }

@media (max-width: 760px) {
    .settings-grid, .announcement-form { grid-template-columns:1fr; }
    .settings-actions, .announcement-form .wide-field { grid-column:auto; }
    .captcha-row { grid-template-columns:1fr; }
    .announcement-bar-item { flex-direction:column; }
    .standard-form-grid,
    .settings-switch-list,
    .announcement-options { grid-template-columns:1fr; }
    .standard-form-grid .wide-field { grid-column:auto; }
    .announcement-record > summary { grid-template-columns:1fr auto; }
    .announcement-record-row { grid-template-columns:1fr auto; }
    .announcement-record-row .platform-tag { display:none; }
    .announcement-record > summary .platform-tag,
    .announcement-record > summary .text-link { display:none; }
    .customer-with-announcements { grid-template-columns:1fr; }
    .customer-announcement-sidebar { position:static; }
    .customer-announcement-list { display:flex; max-height:none; overflow-x:auto; }
    .customer-announcement-item { flex:0 0 210px; border-right:1px solid #edf0f4; border-bottom:0; }
    .container { width:auto; margin:20px auto 36px; padding:0 14px; }
    .admin-content { padding:20px 14px 36px; }
    .auth-shell { grid-template-columns:1fr; max-width:520px; min-height:0; }
    .auth-brand-panel { display:none; }
    .auth-shell .auth { padding:32px 24px; }
    .admin-modal { padding:12px; }
    .admin-modal-card { max-height:calc(100vh - 24px); padding:20px 16px; }
    .profile-grid { grid-template-columns:1fr; }
    .profile-details > div { grid-template-columns:1fr; gap:5px; }
}

@media (min-width: 1900px) {
    .container { max-width:none; width:calc(100% - 96px); }
    .customer-with-announcements { grid-template-columns:310px minmax(0,1fr); gap:32px; }
    .admin-content { padding-left:54px; padding-right:54px; }
}

.state-trigger::before {
    content: "";
    width: 7px;
    height: 7px;
    margin-right: 7px;
    border-radius: 50%;
}

.state-trigger.is-on::before {
    background: #1aa36f;
}

.state-trigger.is-off::before {
    background: #9da7b6;
}

.editable-api-row.is-editing {
    background: #f5f9ff;
}

.api-save-button[hidden] {
    display: none;
}

@media (max-width: 980px) {
    .switch-permission-list { grid-template-columns: 1fr; }
    .switch-permission-item:nth-last-child(-n+2) { border-bottom: 1px solid #edf0f4; }
    .switch-permission-item:last-child { border-bottom: 0; }
}
