:root {
    color-scheme: dark;
    --background: #141518;
    --surface: #1d1e23;
    --surface-raised: #25272e;
    --ink: #e9ebf1;
    --muted: #9b9fac;
    --line: #34363f;
    --primary: #1677ff;
    --primary-hover: #4096ff;
    --primary-soft: #172b49;
    --danger: #ed646a;
    font-family: Inter, "Segoe UI", "Microsoft YaHei", sans-serif;
    line-height: 1.6;
    color: var(--ink);
    background: var(--background);
}
* { box-sizing: border-box; }
html { scroll-padding-top: 80px; scroll-padding-bottom: calc(100px + env(safe-area-inset-bottom, 0px)); }
body { margin: 0; min-width: 280px; }
.page-platform main { max-width: 760px; }
.platform-login-panel, .platform-token-panel { margin-top: 22px; }
.platform-test { margin-top: 20px; }
.automation-form { margin-top: 22px; }
.platform-login-panel .field > button { align-self: flex-start; margin-top: 10px; }
button:disabled { opacity: .5; cursor: not-allowed; }
altcha-widget {
    display: block;
    --altcha-max-width: 100%;
    --altcha-color-base: #181a1f;
    --altcha-color-base-content: #e9ebf1;
    --altcha-color-primary: #1677ff;
    --altcha-color-neutral: #34363f;
    --altcha-color-neutral-content: #b4bac8;
    --altcha-border-color: #424550;
    --altcha-border-radius: 6px;
}
a { color: #74acff; text-underline-offset: 3px; }
button, input, select, textarea, summary, a { -webkit-tap-highlight-color: transparent; }
.ui-icon { display: block; width: 21px; height: 21px; flex: 0 0 auto; }
.site-bar { position: sticky; top: 0; z-index: 4; background: #1b1c21; border-bottom: 1px solid #30323a; }
.site-bar-inner {
    width: min(100% - 40px, 1120px);
    min-height: 64px;
    margin: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; min-width: 0; color: #f4f6fa; font-size: 17px; font-weight: 650; text-decoration: none; white-space: nowrap; }
.brand-mark { display: grid; place-items: center; width: 32px; height: 34px; border-radius: 9px; background: var(--primary); color: #fff; box-shadow: 0 3px 12px #0d59bb33; }
.brand-mark .ui-icon { width: 22px; height: 22px; }
.account-link { display: flex; align-items: center; gap: 8px; min-width: 0; max-width: 42%; color: #c3c7d0; text-decoration: none; font-size: 13px; }
.account-link > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-avatar { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; color: #8ebcff; background: #24334c; }
.account-avatar .ui-icon { width: 17px; height: 17px; }
main { width: min(100% - 40px, 1120px); margin: 30px auto 0; padding-bottom: calc(114px + env(safe-area-inset-bottom, 0px)); }
.page-query main, .page-ban main, .page-mine main { max-width: 760px; }
main.login-layout { max-width: 420px; margin-top: clamp(40px, 12vh, 100px); }
.page-header, .record-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.page-header { margin-bottom: 22px; }
h1, h2, h3, p, dl, dd { margin: 0; }
h1 { font-size: clamp(23px, 4vw, 28px); font-weight: 650; line-height: 1.35; letter-spacing: -.02em; }
h2 { font-size: 18px; font-weight: 600; margin-bottom: 20px; }
h3 { font-size: 17px; font-weight: 600; }
.mode, .status { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; border-radius: 5px; padding: 3px 9px; font-size: 12px; color: #9ec5ff; background: #172f52; border: 1px solid #264d7c; overflow-wrap: anywhere; }
.mode { color: #b4bac8; background: #24262d; border-color: #3a3d48; white-space: nowrap; }
.mode::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: #67a6ff; }
.panel { min-width: 0; padding: clamp(18px, 3vw, 26px); border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: 0 5px 18px #00000010; }
.field { display: flex; flex-direction: column; min-width: 0; }
label { display: inline-block; margin-bottom: 8px; color: #cfd2dc; font-size: 14px; font-weight: 500; }
.stacked-form { display: flex; flex-direction: column; gap: 18px; }
.stacked-form > button { align-self: flex-start; }
.login-layout .stacked-form { padding: 28px; gap: 22px; }
.login-layout .stacked-form > button { align-self: stretch; margin-top: 3px; }
.query-controls { display: flex; gap: 12px; }
input, select, textarea, button { font: inherit; }
input[type="text"], input[type="password"], input[type="number"], select, textarea {
    min-width: 0;
    width: 100%;
    min-height: 48px;
    padding: 11px 13px;
    border: 1px solid #424550;
    border-radius: 6px;
    color: #f0f2f7;
    background: #181a1f;
    font-size: 16px;
    transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: #747986; opacity: 1; }
input[type="text"]:hover, input[type="password"]:hover, select:hover, textarea:hover { border-color: #68758a; }
input[type="text"]:focus, input[type="password"]:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px #1677ff20; }
textarea { resize: vertical; overflow-wrap: anywhere; }
.query-controls input { flex: 1; }
input[type="checkbox"] { width: 19px; height: 19px; accent-color: var(--primary); flex-shrink: 0; margin: 0; }
.checkbox-label { display: flex; align-items: flex-start; gap: 10px; min-width: 0; font-size: 14px; font-weight: 400; margin: 0; overflow-wrap: anywhere; }
.checkbox-label input { margin-top: 2px; }
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    min-height: 48px;
    padding: 10px 23px;
    border: 1px solid transparent;
    border-radius: 6px;
    color: #fff;
    background: var(--primary);
    font-size: 15px;
    font-weight: 500;
    white-space: nowrap;
    transition: background .15s, border-color .15s;
}
button .ui-icon { width: 18px; height: 18px; }
button:hover { background: var(--primary-hover); }
button:active { background: #095ecb; }
.secondary-button { color: #d6dae4; border-color: #464a56; background: #282a32; }
.secondary-button:hover { color: #8fbcff; border-color: #397fe2; background: #25324a; }
.danger-button { background: #c33f49; }
.danger-button:hover { background: #df525c; }
:focus-visible { outline: 2px solid #82b5ff; outline-offset: 3px; }
.helper, .empty, .page-description { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.helper { margin-top: 8px; }
.page-description { margin-bottom: 18px; }
.stacked-form > .helper { margin: -5px 0 0; }
code, .code-value { font-family: "IBM Plex Mono", Consolas, monospace; }
code { color: #b7c7e1; font-size: .95em; }
.results { margin-top: 28px; }
.record + .record { margin-top: 12px; }
.record-header > *, dd, .message, .agent-summary h3, .profile h2 { min-width: 0; overflow-wrap: anywhere; }
.status.warning { background: #3c2d1f; border-color: #6a4828; color: #e8b773; }
.details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; margin-top: 18px; padding-top: 6px; border-top: 1px solid var(--line); }
.details > div { padding: 12px 0; border-bottom: 1px solid #2e3038; }
dt { color: var(--muted); font-size: 12px; margin-bottom: 3px; }
dd { color: #e4e7ee; font-size: 14px; }
.message { padding: 12px 15px; border: 1px solid; border-radius: 7px; margin-bottom: 20px; font-size: 14px; }
.message.error { border-color: #6d353a; color: #ffafb6; background: #342226; }
.message.success { border-color: #285845; color: #a4dfbe; background: #1d3028; }
.warning-note { display: flex; align-items: center; gap: 9px; padding: 12px 14px; border: 1px solid #593a31; border-radius: 6px; color: #e9ad8d; background: #30241f; font-size: 13px; }
.warning-note .ui-icon { width: 18px; height: 18px; }
.agent-create { display: grid; grid-template-columns: 1.1fr 1.1fr 1fr auto; align-items: start; gap: 18px; }
.agent-create > button { margin-top: 30px; }
.batch-panel, .batch-results { margin-bottom: 24px; }
.batch-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.batch-heading h2 { margin-bottom: 0; }
#bulk-accounts { min-height: 190px; font-family: Consolas, "Microsoft YaHei", monospace; line-height: 1.7; }
.batch-controls { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 16px; }
.batch-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.batch-stats > div { display: flex; flex-direction: column; padding: 15px 18px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.batch-stats span { color: var(--muted); font-size: 12px; }
.batch-stats strong { color: #e9ebf1; font-size: 25px; font-weight: 600; }
.batch-stats > div:nth-child(2) strong { color: #a4dfbe; }
.batch-stats > div:nth-child(3) strong { color: #eabb88; }
.batch-table th:nth-child(2) { width: 24%; }
.batch-table th:nth-child(3) { width: 17%; }
.agents-list { display: grid; gap: 16px; }
.agent-card { display: grid; grid-template-columns: minmax(170px, 1fr) minmax(360px, 1.5fr); align-items: center; gap: 20px 28px; }
.agent-identity { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; min-width: 0; }
.agent-identity h3 { max-width: 100%; }
.agent-avatar { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; color: #90bbfa; background: #29344b; }
.agent-avatar .ui-icon { width: 20px; height: 20px; }
.agent-summary .helper { margin-top: 10px; font-size: 12px; }
.agent-edit { display: grid; grid-template-columns: minmax(130px, 1.5fr) minmax(100px, 1fr) auto; align-items: end; gap: 12px; }
.agent-actions { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; border-top: 1px solid var(--line); padding-top: 18px; }
.account-action { min-width: 0; border: 1px solid #3a3e49; border-radius: 7px; background: #21232a; }
.account-action summary { display: flex; align-items: center; gap: 9px; min-height: 46px; padding: 10px 13px; cursor: pointer; color: #b8c9e4; font-size: 14px; list-style: none; }
.account-action summary::-webkit-details-marker { display: none; }
.account-action summary::after { content: "+"; margin-left: auto; color: #8c96a8; font-size: 20px; font-weight: 300; }
.account-action[open] summary::after { content: "−"; }
.account-action summary .ui-icon { width: 17px; height: 17px; }
.account-action[open] { grid-column: 1 / -1; }
.account-action[open] summary { border-bottom: 1px solid var(--line); }
.delete-action summary { color: #f09a9f; }
.action-form { padding: 18px; }
.table-panel { padding: 0; overflow: hidden; }
.audit-table { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: 13px; text-align: left; }
.audit-table th { color: #b4bac8; background: #24262d; font-size: 12px; font-weight: 500; }
.audit-table th, .audit-table td { padding: 15px 12px; border-bottom: 1px solid #30323a; vertical-align: top; overflow-wrap: anywhere; }
.audit-table th:first-child { width: 15%; }
.audit-table th:nth-child(6) { width: 23%; }
.audit-table tbody tr:last-child td { border-bottom: 0; }
.audit-table tbody tr:hover { background: #23262e; }
.log-result { display: inline-block; padding: 1px 7px; border-radius: 4px; color: #9ed5b6; background: #203a2d; font-size: 12px; }
.log-result.result-warning { color: #eabb88; background: #3b2e22; }
.pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; font-size: 13px; color: var(--muted); }
.pagination > div { display: flex; gap: 10px; }
.pagination a { display: inline-flex; align-items: center; min-height: 40px; padding: 4px 12px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); text-decoration: none; }
.back-link { display: inline-flex; align-items: center; gap: 4px; min-height: 40px; margin: -10px 0 14px; color: #a6aebf; font-size: 13px; text-decoration: none; }
.back-link .ui-icon { width: 16px; height: 16px; }
.profile { display: flex; align-items: center; gap: 20px; padding: 28px; border-color: #314565; background: linear-gradient(115deg, #1d314e, #1d2432); }
.profile-avatar { display: grid; place-items: center; width: 68px; height: 68px; flex: 0 0 auto; border: 1px solid #4e6d99; border-radius: 18px; color: #d8e8ff; background: #304e78; }
.profile-avatar .ui-icon { width: 33px; height: 33px; }
.profile-info { min-width: 0; }
.profile h2 { margin-bottom: 8px; font-size: 25px; color: #f4f7ff; }
.profile-role { display: flex; align-items: center; gap: 6px; color: #b1c4df; font-size: 13px; }
.profile-role .ui-icon { width: 16px; height: 16px; }
.profile-links { display: grid; gap: 12px; margin-top: 22px; }
.profile-links a { display: flex; align-items: center; gap: 14px; min-height: 88px; padding: 18px 22px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--ink); text-decoration: none; }
.profile-links a:hover { border-color: #4e6488; background: #222832; }
.menu-icon { display: grid; place-items: center; width: 42px; height: 42px; flex: 0 0 auto; border-radius: 10px; color: #84b4ff; background: #23344f; }
.menu-copy { display: flex; flex-direction: column; min-width: 0; gap: 3px; }
.menu-copy strong { font-size: 15px; font-weight: 500; }
.menu-copy small { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.menu-chevron { margin-left: auto; color: #778297; font-size: 24px; }
.logout-form { margin-top: 24px; }
.logout-form > button { width: 100%; }
.bottom-nav { position: fixed; z-index: 5; bottom: 0; left: 0; right: 0; padding-bottom: env(safe-area-inset-bottom, 0px); background: #1c1e24; border-top: 1px solid #343741; box-shadow: 0 -5px 22px #00000018; }
.bottom-nav-inner { display: flex; width: min(100%, 760px); margin: auto; }
.bottom-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-width: 0; min-height: 74px; padding: 8px 12px; border-top: 2px solid transparent; color: #8f96a7; font-size: 12px; text-decoration: none; }
.bottom-nav a .ui-icon { width: 22px; height: 22px; }
.bottom-nav a[aria-current="page"] { color: #6eabff; border-top-color: var(--primary); background: #1b2a41; font-weight: 500; }
.bottom-nav a:hover { color: #b5c9e8; background: #232b38; }
@media (max-width: 900px) {
    .agent-create { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .agent-create > button { align-self: end; margin-top: 0; }
    .agent-card { grid-template-columns: minmax(0, 1fr); gap: 20px; }
}
@media (max-width: 700px) {
    .table-panel { border: 0; background: transparent; overflow: visible; box-shadow: none; }
    .audit-table, .audit-table tbody { display: block; }
    .audit-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
    .audit-table tr { display: block; margin-bottom: 14px; padding: 15px 17px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
    .audit-table td { display: grid; grid-template-columns: 62px minmax(0, 1fr); gap: 12px; border: 0; padding: 5px 0; font-size: 13px; }
    .audit-table td::before { content: attr(data-label); color: var(--muted); }
    .audit-table tbody tr:hover { background: var(--surface); }
    .log-result { justify-self: start; }
}
@media (max-width: 540px) {
    .site-bar-inner, main { width: min(100% - 28px, 1120px); }
    .site-bar-inner { min-height: 60px; gap: 10px; }
    .brand { font-size: 16px; gap: 8px; }
    .brand-mark { width: 28px; height: 30px; border-radius: 7px; }
    .brand-mark .ui-icon { width: 20px; height: 20px; }
    .account-link { gap: 6px; font-size: 12px; }
    .account-avatar { width: 25px; height: 25px; }
    main { margin-top: 24px; }
    .page-header { margin-bottom: 20px; }
    .query-controls { flex-direction: column; }
    .details, .agent-create { grid-template-columns: minmax(0, 1fr); }
    .agent-edit { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .agent-edit > button { grid-column: 1 / -1; }
    .agent-create > button { margin-top: 0; }
    .batch-controls { grid-template-columns: minmax(0, 1fr); }
    .batch-stats { gap: 8px; }
    .batch-stats > div { padding: 12px; }
    .stacked-form > button { align-self: stretch; }
    .login-layout .stacked-form { padding: 22px; }
    .mode { padding: 3px 7px; font-size: 11px; }
    .profile { gap: 16px; padding: 23px 20px; }
    .profile-avatar { width: 57px; height: 57px; border-radius: 15px; }
    .profile-avatar .ui-icon { width: 29px; height: 29px; }
    .profile h2 { font-size: 22px; }
    .profile-links a { padding: 17px; gap: 12px; }
    .menu-icon { width: 38px; height: 38px; border-radius: 9px; }
    .action-form { padding: 16px; }
    .agent-identity { gap: 8px; }
    .bottom-nav a { min-height: 70px; }
}
