:root {
  font-family: Inter, "Microsoft YaHei UI", "PingFang SC", "Segoe UI", system-ui, sans-serif;
  color: #303843;
  background: #f2f4f7;
  font-synthesis: none;
  --ink: #303843;
  --muted: #596579;
  --line: #e1e6ed;
  --paper: #fff;
  --accent: #409eff;
  --accent-dark: #165a9e;
  --accent-ink: #102f51;
  --mint: #e9f5ec;
  --nav: #203044;
  --danger: #ad303c;
  --shadow: 0 2px 8px #20304712;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--accent-dark); }
h1, h2, h3, p { margin: 0; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 2px solid #3687d9; outline-offset: 2px; }

.full-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.access-card { display: grid; gap: 18px; width: min(100%, 420px); padding: 32px; background: var(--paper); border: 1px solid var(--line); border-radius: 4px; box-shadow: var(--shadow); }
.access-card h1 { font-size: 23px; }
.access-card > p { color: var(--muted); font-size: 14px; line-height: 1.55; }
.brand-mark { display: inline-grid; place-items: center; width: 31px; height: 31px; flex: 0 0 auto; border-radius: 4px; background: #d8ebff; color: #1b5b9a; font-size: 19px; font-weight: 800; }

.shell { --navigation-width: 200px; --task-panel-width: min(480px, 38vw); min-height: 100vh; display: grid; grid-template-columns: var(--navigation-width) minmax(0, 1fr) var(--task-panel-width); }
.shell.tasks-collapsed { grid-template-columns: var(--navigation-width) minmax(0, 1fr); }
.shell.navigation-collapsed { grid-template-columns: minmax(0, 1fr) var(--task-panel-width); }
.shell.navigation-collapsed.tasks-collapsed { grid-template-columns: minmax(0, 1fr); }
.shell.navigation-collapsed > .navigation { display: none; }
.navigation { position: sticky; top: 0; height: 100vh; overflow: auto; display: flex; flex-direction: column; padding: 0 0 12px; background: var(--nav); color: #fff; }
.brand { display: flex; gap: 9px; align-items: center; min-height: 56px; margin: 0 0 8px; padding: 8px 14px; border-bottom: 1px solid #ffffff14; }
.brand strong, .brand small { display: block; white-space: nowrap; }
.brand strong { font-size: 14px; }
.brand small { margin-top: 3px; color: #b8c7da; font-size: 10px; }
.nav-group + .nav-group { margin-top: 2px; }
.nav-group summary { display: flex; align-items: center; gap: 9px; min-height: 36px; padding: 8px 13px; color: #e6eef9; font-size: 13px; font-weight: 700; list-style: none; cursor: pointer; }
.nav-group summary:hover, .nav-group[open] summary { background: #283b54; }
.nav-group summary::-webkit-details-marker { display: none; }
.nav-group summary::after { width: 6px; height: 6px; margin: 0 3px 0 auto; border-top: 1px solid #a3bbd9; border-right: 1px solid #a3bbd9; transform: rotate(45deg); content: ''; }
.nav-group[open] summary::after { transform: rotate(135deg); }
.nav-icon { flex: 0 0 auto; width: 15px; height: 15px; color: #b7c9de; }
.nav-links { padding: 3px 0; background: #1b293b; }
.nav-group a { display: flex; align-items: center; min-height: 32px; padding: 6px 12px 6px 29px; border-left: 3px solid transparent; color: #dbe6f5; font-size: 12px; line-height: 1.4; text-decoration: none; }
.nav-group a:hover { background: #26384f; }
.nav-group a[aria-current="page"] { border-left-color: var(--accent); background: #293f59; color: #91c9ff; font-weight: 700; }
.skip { position: fixed; inset: 8px auto auto 8px; z-index: 10; padding: 10px 12px; border-radius: 7px; background: var(--paper); transform: translateY(-200%); }
.skip:focus { transform: translateY(0); }

.workspace { min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 56px; padding: 7px 16px; background: var(--paper); border-bottom: 1px solid var(--line); }
.topbar-left { display: flex; min-width: 0; align-items: center; gap: 10px; }
.button.nav-toggle { flex: 0 0 auto; width: 32px; padding: 0; color: #405066; }
.navigation-collapsed .nav-toggle svg { transform: scaleX(-1); }
.breadcrumb { min-width: 0; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.breadcrumb span[aria-hidden] { margin: 0 6px; color: #8492a2; }
.breadcrumb strong { color: var(--ink); }
.top-actions, .actions, .dialog-actions { display: flex; gap: 7px; flex-wrap: wrap; align-items: center; }
.current-operator { color: var(--muted); font-size: 12px; max-width: 140px; overflow-wrap: anywhere; }
.page-tabs { display: flex; align-items: center; gap: 5px; min-height: 37px; padding: 4px 16px; border-bottom: 1px solid var(--line); background: var(--paper); box-shadow: var(--shadow); overflow-x: auto; scrollbar-width: thin; }
.page-tabs:empty { display: none; }
.page-tab { display: inline-flex; flex: 0 0 auto; align-items: center; min-height: 26px; border: 1px solid var(--line); border-radius: 3px; background: var(--paper); color: var(--muted); font-size: 12px; }
.page-tab.is-active { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.page-tab > a { display: block; max-width: 190px; padding: 4px 7px; overflow: hidden; color: inherit; line-height: 1.3; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; }
.page-tab > button { display: inline-grid; width: 20px; min-height: 24px; place-items: center; margin-right: 2px; padding: 0; border: 0; border-radius: 3px; background: transparent; color: inherit; font-size: 14px; cursor: pointer; }
.page-tab > button:hover, .page-tab > a:hover { background: #1b4e8314; }
.page-content { padding: 16px 16px 28px; }
.page-heading, .resource-heading { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.page-heading h1, .resource-heading h1 { font-size: 22px; line-height: 1.25; }
.page-heading p, .resource-heading p { margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.resource-heading h1 { font-size: 19px; }
.inventory-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.inventory-card { display: grid; align-content: start; gap: 5px; min-width: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 4px; background: var(--paper); color: var(--ink); text-decoration: none; box-shadow: var(--shadow); }
.inventory-card:hover { background: #f2f8ff; border-color: #8dbde9; }
.inventory-card span { color: var(--accent-dark); font-size: 13px; font-weight: 700; }
.inventory-card strong { font-size: 26px; }
.inventory-card small { color: var(--muted); font-size: 11px; line-height: 1.55; }
.panel { min-width: 0; border: 1px solid var(--line); border-radius: 4px; background: var(--paper); overflow: hidden; box-shadow: var(--shadow); }
.panel + .panel { margin-top: 12px; }
.panel-heading { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; padding: 9px 12px; border-bottom: 1px solid var(--line); }
.panel-heading h2 { font-size: 14px; }
.panel-heading p { color: var(--muted); font-size: 12px; }
.panel-content { padding: 14px 16px; color: var(--muted); font-size: 13px; }
.section-note { margin-bottom: 10px; color: var(--muted); font-size: 12px; }
.apple-workflow-nav { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 12px; }
.apple-topup-check { width: 16px; height: 16px; vertical-align: middle; accent-color: var(--accent); }
.apple-plan-fill-group { display: flex; flex-wrap: wrap; gap: 10px; }
.apple-plan-fill { display: flex; gap: 6px; align-items: flex-end; }
.apple-plan-fill input { width: 125px; }
[data-dialog-action="apple-topup-batch"] [data-apple-plan-amount] { min-width: 125px; }
dialog:has([data-dialog-action="apple-topup-batch"], [data-dialog-action="apple-arrange-batch"], [data-dialog-action="delivery-sell"]) { width: min(820px, calc(100vw - 26px)); }
.apple-arrange-toolbar { display: grid; gap: 6px; margin-bottom: 12px; }
.apple-clock { display: inline-block; min-width: 135px; }
.apple-history { display: grid; gap: 12px; }
.apple-receipt-fields { grid-column: 1 / -1; min-width: 0; margin: 0; padding: 10px; border: 1px solid var(--line); border-radius: 4px; }
dialog:has(.apple-history) { width: min(920px, calc(100vw - 26px)); }
.settings-list { margin: 0; }
.settings-list div { display: grid; grid-template-columns: minmax(85px, 26%) minmax(0, 1fr); gap: 8px; padding: 11px 16px; border-bottom: 1px solid #e9eef3; }
.settings-list div:last-child { border-bottom: 0; }
.settings-list dt { font-size: 12px; font-weight: 700; }
.settings-list dd { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; overflow-wrap: anywhere; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; text-align: left; font-size: 13px; }
th, td { padding: 7px 10px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); vertical-align: middle; }
th:last-child, td:last-child { border-right: 0; }
th { background: #f1f4f8; color: #4a5567; font-weight: 700; white-space: nowrap; }
tbody tr:nth-child(even) td { background: #f8fafd; }
tbody tr:hover td { background: #f0f7ff; }
tbody tr:last-child td { border-bottom: 0; }
td .subtle { display: block; margin-top: 3px; }
.data-panel td .button { min-height: 24px; padding: 2px 0; border: 0; border-radius: 2px; background: transparent; color: #1767ae; font-size: 12px; font-weight: 550; }
.data-panel td .button:hover { background: transparent; text-decoration: underline; }
.data-panel td .button.danger { color: var(--danger); }
.data-panel td .button[data-action="ip-request"] { color: #2e773a; }
.data-panel td .button:is([data-action="email-status"], [data-action="ip-credentials"], [data-action="ip-api-link"], [data-action="ads-password"]) { color: #8a5a14; }
.data-panel td .actions { gap: 2px 9px; }
.data-panel .table-empty { padding: 34px 14px; background: var(--paper); }
.record, .log-message { min-width: 115px; max-width: 225px; overflow-wrap: anywhere; }
.log-message { max-width: 340px; white-space: pre-wrap; }
.cell-list { list-style: none; margin: 0; padding: 0; }
.cell-list li + li { margin-top: 5px; }
.notes { min-width: 80px; max-width: 170px; overflow-wrap: anywhere; color: var(--muted); }
.note-cell { display: block; min-width: 76px; max-width: 260px; padding: 3px 5px; text-align: left; color: var(--ink); background: transparent; border: 1px solid transparent; border-radius: 4px; font: inherit; cursor: text; white-space: pre-wrap; overflow-wrap: anywhere; }
.note-cell:hover, .note-cell:focus-visible { border-color: var(--line); background: var(--paper); }
.note-cell.note-empty { color: var(--muted); border-bottom-style: dashed; }
[data-note-draft-field] > input[hidden], [data-note-draft-field] > button[hidden] { display: none; }
.nowrap { white-space: nowrap; }
.subtle { color: var(--muted); }
.empty { padding: 26px 16px; color: var(--muted); text-align: center; font-size: 13px; line-height: 1.6; }

.button { display: inline-flex; min-height: 32px; padding: 5px 10px; align-items: center; justify-content: center; gap: 5px; border: 1px solid #cdd8e1; border-radius: 4px; background: #fff; color: var(--ink); font-size: 12px; font-weight: 650; line-height: 1.2; text-decoration: none; white-space: nowrap; cursor: pointer; }
.button:hover { border-color: #b1d4fa; background: #edf5fd; }
.button.primary { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.button.primary:hover { border-color: #3290eb; background: #3290eb; }
.button.quiet { border-color: transparent; background: transparent; }
.button.quiet:hover { background: #edf2f7; }
.button.danger { color: var(--danger); }
.button:disabled { opacity: .57; cursor: not-allowed; }
.badge { display: inline-block; max-width: 100%; padding: 3px 7px; border-radius: 4px; background: #edf2f6; color: #455667; font-size: 11px; font-weight: 650; line-height: 1.2; overflow-wrap: anywhere; }
.badge.success { background: #e5f4eb; color: #1b604a; }
.badge.waiting { background: #fff0d5; color: #744906; }
.badge.active { background: #e6eefc; color: #28558f; }
.badge.danger { background: #fae9eb; color: #922932; }
.feedback { margin: 10px 16px 0; padding: 8px 10px; border: 1px solid #c3e0d1; border-radius: 4px; background: var(--mint); color: #225a48; font-size: 13px; overflow-wrap: anywhere; }
.feedback.error { border-color: #f0cbd0; background: #fff1f3; color: var(--danger); }

.tasks { position: sticky; top: 0; min-width: 0; height: 100vh; overflow: auto; overscroll-behavior: contain; border-left: 1px solid var(--line); background: var(--paper); }
.task-header { position: sticky; top: 0; z-index: 1; display: grid; gap: 14px; padding: 17px 16px 12px; border-bottom: 1px solid var(--line); background: var(--paper); }
.task-header-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.task-header h2 { font-size: 20px; line-height: 1.25; }
.task-header-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 4px; }
.task-header p { margin-top: 5px; color: var(--muted); font-size: 12px; line-height: 1.4; }
.task-count { flex: 0 0 auto; min-width: 27px; padding: 4px 7px; border-radius: 20px; background: var(--mint); color: var(--accent-dark); text-align: center; font-weight: 750; font-size: 12px; }
.task-count-hidden { position: absolute; width: 1px; height: 1px; min-width: 0; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.task-refresh { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.task-refresh:hover { border-color: #3290eb; background: #3290eb; }
.task-close { width: 31px; min-height: 32px; padding: 0; color: var(--muted); font-size: 22px; font-weight: 500; }
.task-filters, .task-status-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.task-filters { gap: 7px; }
#task-type-filter { width: 114px; max-width: 100%; min-height: 32px; padding: 5px 6px 5px 8px; border: 1px solid #cdd8e1; border-radius: 6px; background: var(--paper); color: var(--ink); font-size: 12px; }
.task-status-filters .button { min-height: 32px; padding: 5px 7px; border-radius: 6px; font-weight: 500; }
.task-status-filters .button[aria-pressed="true"] { border-color: #a9bff0; background: #eaf1ff; color: #1847a5; font-weight: 700; }
#task-content { padding: 13px 16px 20px; }
.task-empty { display: grid; place-content: center; justify-items: center; gap: 10px; min-height: 230px; padding: 20px 10px; color: #5d6d82; text-align: center; font-size: 13px; }
.task-empty svg { width: 42px; height: 42px; color: #8292a8; }
.task-shortcut { display: none; }
.task-list { display: grid; gap: 8px; }
.task-row { display: grid; width: 100%; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 5px 8px; padding: 10px; border: 1px solid var(--line); border-radius: 4px; background: var(--paper); color: var(--ink); text-align: left; cursor: pointer; }
.task-row:hover, .task-row[aria-expanded="true"] { border-color: #b4c7ec; background: #f4f7ff; }
.task-row strong { font-size: 12px; line-height: 1.4; overflow-wrap: anywhere; }
.task-row time { font-size: 11px; color: var(--muted); grid-column: 1 / -1; }
.task-detail { margin: 10px 0 14px; padding: 12px; border: 1px solid var(--line); border-radius: 4px; background: var(--paper); }
.task-detail h3 { font-size: 14px; overflow-wrap: anywhere; }
.task-meta { margin: 5px 0 8px; color: var(--muted); font-size: 11px; line-height: 1.55; overflow-wrap: anywhere; }
.task-instruction { margin: 8px 0 10px; padding: 9px; border-radius: 6px; background: #f0f4f7; font-size: 12px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.task-data { margin: 8px 0 10px; padding: 0; }
.task-data div { display: grid; grid-template-columns: minmax(70px, 1fr) 2fr; gap: 7px; padding: 4px 0; font-size: 11px; overflow-wrap: anywhere; }
.task-data dt { color: var(--muted); }
.task-data dd { margin: 0; }
.task-detail .actions { margin: 10px 0; }
.log-title { margin-top: 13px; font-size: 12px; font-weight: 750; }
.logs { list-style: none; padding: 0; margin: 6px 0 0; }
.logs li { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 4px 7px; padding: 7px 0; border-top: 1px solid #edf1f4; font-size: 11px; line-height: 1.5; }
.logs li > span { overflow-wrap: anywhere; white-space: pre-wrap; }
.logs time { color: var(--muted); font-variant-numeric: tabular-nums; }
.logs li.error > span { color: var(--danger); }
.logs li.warning > span { color: #74500b; }
.task-items { margin: 6px 0 10px; padding-left: 18px; font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }

dialog { width: min(560px, calc(100vw - 26px)); max-height: calc(100dvh - 28px); padding: 0; border: 1px solid var(--line); border-radius: 4px; color: var(--ink); background: var(--paper); box-shadow: 0 12px 45px #172a4540; }
dialog::backdrop { background: #15253665; }
.dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 19px; border-bottom: 1px solid var(--line); }
.dialog-header h2 { font-size: 17px; }
.dialog-header button { min-width: 35px; font-size: 19px; }
#dialog-body { padding: 16px 19px 20px; }
.form { display: grid; gap: 12px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.field { min-width: 0; display: grid; gap: 5px; font-size: 12px; font-weight: 650; }
.field.full, .form-grid > p { grid-column: 1 / -1; }
.delivery-sale-item { min-width: 0; padding: 12px; margin: 0; border: 1px solid var(--line, #e2e8f0); border-radius: 6px; }
.delivery-sale-item > legend { padding: 0 6px; font-weight: 650; overflow-wrap: anywhere; }
.delivery-sale-item .delivery-risk { color: #8e4510; margin: 0; }
.field input:not([type="checkbox"]), .field textarea, .field select { min-width: 0; width: 100%; min-height: 32px; padding: 5px 8px; border: 1px solid #cbd5e1; border-radius: 4px; background: #fff; color: var(--ink); font-size: 13px; font-weight: 400; }
.field textarea { min-height: 82px; resize: vertical; }
.field.checkbox { display: flex; align-items: center; }
.field.checkbox input { flex: 0 0 auto; width: 16px; height: 16px; accent-color: var(--accent); }
.form-hint { color: var(--muted); font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.form-error { color: var(--danger) !important; font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.dialog-actions { justify-content: flex-end; }
[data-dialog-action="cancel-task"] button[type="submit"] { border-color: #a9303c; background: #a9303c; color: #fff; }
[data-dialog-action="cancel-task"] button[type="submit"]:hover { border-color: #8e2430; background: #8e2430; }
.password-value { display: block; padding: 11px; border: 1px solid var(--line); border-radius: 6px; background: #f8fafc; font: 14px ui-monospace, Consolas, monospace; overflow-wrap: anywhere; user-select: all; }
.filter-panel { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 108px), 1fr)); gap: 9px; margin-bottom: 13px; padding: 12px; }
.filter-panel > .field:first-child { grid-column: span 2; }
.email-toolbar { display: grid; gap: 10px; margin-bottom: 12px; padding: 12px; }
.email-filter-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 110px), 1fr)); gap: 8px; align-items: end; }
.email-filter-fields > .field:first-child { grid-column: span 2; }
.email-toolbar-bottom, .email-search-actions, .email-toolbar-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.email-toolbar-bottom { justify-content: space-between; padding-top: 9px; border-top: 1px solid #edf0f4; }
.email-toolbar-actions .button[data-action="email-add"] { border-color: #368238; background: #368238; color: #fff; }
.email-toolbar-actions .button[data-action="email-add"]:hover { border-color: #2d7031; background: #2d7031; }
.pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 7px; min-height: 44px; padding: 7px 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.pagination-summary { white-space: nowrap; }
.pagination-pages { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.pagination-pages .button { min-width: 27px; min-height: 27px; padding: 3px 6px; font-weight: 550; }
.pagination-pages .button.is-active { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.pagination-ellipsis { padding-inline: 3px; }
#email-page-size { min-height: 28px; padding: 3px 6px; border: 1px solid #cbd5e1; border-radius: 4px; background: var(--paper); color: var(--ink); font-size: 12px; }
.resource-tabs { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 12px; }
.resource-tabs .button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.ip-status-counts { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 12px; }
.ip-status-counts .button { display: inline-flex; align-items: center; gap: 5px; }
.ip-status-counts .button[aria-pressed="true"] { border-color: #a9bff0; background: #eaf1ff; color: #1847a5; }
.ip-status-counts strong { font-variant-numeric: tabular-nums; }
.ip-filter-panel { grid-template-columns: repeat(auto-fit, minmax(min(100%, 105px), 1fr)); }
.ip-guidance { line-height: 1.55; }
.ip-upload-zone {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 7px;
  min-height: 144px;
  padding: 18px;
  border: 1px dashed #94a3b8;
  border-radius: 6px;
  background: #f8fafc;
  text-align: center;
  cursor: pointer;
}
.ip-upload-zone input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: inherit; }
.ip-upload-zone:hover, .ip-upload-zone:focus-within, .ip-upload-zone.drag-active { border-color: var(--accent); background: #eef6ff; }
.ip-upload-zone:focus-within { outline: 2px solid #3687d9; outline-offset: 2px; }
[data-ip-upload][aria-busy="true"] .ip-upload-zone { cursor: progress; }
#ip-results table[aria-label="代理库存"] { min-width: 1380px; }
.ip-username { overflow-wrap: anywhere; }
.ip-asn { display: inline-block; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
.ip-inventory-status { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 4px; min-width: 95px; }
.ip-check-reason { display: block; }
.ip-check-danger { color: var(--danger); }
.ip-risk-scale { display: inline-flex; align-items: center; gap: 4px; padding: 3px 5px; border: 1px solid #667085; border-radius: 999px; white-space: nowrap; }
.ip-risk-band { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 999px; background: var(--risk-color); }
.ip-risk-band.is-current { width: auto; height: auto; min-width: 74px; padding: 2px 7px; text-align: center; color: var(--risk-text, #192013); font-weight: 700; font-size: 11px; }
.ip-risk-band-0 { --risk-color: #087629; --risk-text: white; }
.ip-risk-band-1 { --risk-color: #33c742; }
.ip-risk-band-2 { --risk-color: #a8cd54; }
.ip-risk-band-3 { --risk-color: #efda20; }
.ip-risk-band-4 { --risk-color: #f8a51e; }
.ip-risk-band-5 { --risk-color: #cf2525; --risk-text: white; }
.ip-expired { color: var(--danger); }
#ip-results :is(th, td):first-child:not([colspan]) { min-width: 123px; }
#ip-results .badge { white-space: nowrap; }
#ip-results :is(th, td):last-child:not([colspan]), #email-results :is(th, td):last-child:not([colspan]) {
  position: sticky;
  right: 0;
  z-index: 1;
  background: var(--paper);
  box-shadow: -1px 0 var(--line), -7px 0 10px -7px #18253566;
}
#ip-results :is(th, td):last-child:not([colspan]) { width: 158px; min-width: 158px; }
#ip-results th:last-child, #email-results th:last-child { background: #f1f4f8; }
#ip-results tbody tr:nth-child(even) td:last-child:not([colspan]), #email-results tbody tr:nth-child(even) td:last-child:not([colspan]) { background: #f8fafd; }
#ip-results tbody tr:hover td:last-child:not([colspan]), #email-results tbody tr:hover td:last-child:not([colspan]) { background: #f0f7ff; }
.ip-detail { display: grid; gap: 12px; }
.ip-detail > .panel { margin: 0; }
.ip-detail-fields { border: 1px solid var(--line); border-radius: 9px; }
.ip-detail-fields .button { margin-block: 3px; }
dialog:has(.ip-detail) { width: min(850px, calc(100vw - 26px)); }
dialog:has([data-dialog-action="ip-preview"], [data-dialog-action="ip-edit"], [data-dialog-action="ip-replacement-complete"], [aria-label="代理预览"]) { width: min(820px, calc(100vw - 26px)); }
.inline-credential { display: inline-block; min-width: 75px; max-width: 175px; color: #25435a; font: 12px ui-monospace, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; user-select: all; }
#email-results :is(th, td):first-child:not([colspan]) { width: 44px; min-width: 44px; text-align: center; }
#email-results :is(th, td):is(:nth-child(2), :nth-child(4)) { min-width: 174px; }
#email-results :is(th, td):nth-child(3) { min-width: 124px; }
#email-results :is(th, td):nth-child(5) { min-width: 146px; }
#email-results .badge { white-space: nowrap; overflow-wrap: normal; }
#email-results :is(th, td):last-child:not([colspan]) { width: 168px; min-width: 168px; }
.email-row-actions { width: 146px; }
.email-owner { min-width: 85px; max-width: 160px; overflow-wrap: anywhere; }
.email-association { min-width: 175px; max-width: 260px; display: grid; justify-items: start; gap: 6px; overflow-wrap: anywhere; }
.email-account-label, .email-environment-name, .email-association-ip { font-weight: 650; }
.email-association .subtle { display: block; margin-top: 3px; font-size: 11px; }
.email-association-ip { display: block; margin-top: 3px; white-space: nowrap; }
.email-environments { width: 100%; }
.email-environments li { padding-top: 6px; border-top: 1px solid #e9eef3; }
#email-results td:has(.email-association-heading) { vertical-align: baseline; }
#email-results .email-association { display: block; max-width: none; width: 100%; }
/* Use the bottom of the heading as the table cell baseline, even when the label wraps. */
.email-association-heading { display: inline-block; width: 100%; overflow: hidden; vertical-align: baseline; }
.email-association-heading .email-account-label { display: block; margin-top: 6px; }
#email-results .email-environments { margin-top: 6px; border-top: 1px solid #b9c7d6; }
#email-results .email-association > .subtle { margin-top: 9px; }
#email-results .email-environments li:first-child { border-top: 0; }
.email-association-section { display: grid; gap: 8px; }
.email-association-section + .email-association-section { padding-top: 12px; border-top: 1px solid var(--line); }
.email-association-section h3 { color: var(--ink); font-size: 13px; }
.email-association-section .email-association { max-width: none; width: 100%; }
.email-association-section > .button { justify-self: start; }
.email-detail { display: grid; gap: 12px; }
.email-detail > .panel { margin: 0; }
.email-detail-fields { border: 1px solid var(--line); border-radius: 9px; }
.email-detail-fields .inline-credential { max-width: 100%; }
dialog:has(.email-detail) { width: min(740px, calc(100vw - 26px)); }
dialog:has([data-dialog-action="apple-permission-batch"]) { width: min(940px, calc(100vw - 26px)); }
[data-dialog-action="apple-permission-batch"] [data-apple-permission-time] { min-width: 185px; }
[data-dialog-action="apple-permission-batch"] [data-apple-permission-review] { min-width: 170px; }
.email-backfill { min-width: 0; margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: 7px; }
.import-errors { margin: 0; padding: 0; list-style: none; }
.import-errors { max-height: 160px; padding: 8px 10px; overflow: auto; border-radius: 6px; background: #fff1f3; color: var(--danger); font-size: 12px; }
.import-errors li + li { margin-top: 6px; }

@media (max-width: 1120px) {
  .shell { --navigation-width: 184px; --task-panel-width: min(430px, 42vw); }
  .inventory-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .shell { --navigation-width: 155px; grid-template-columns: var(--navigation-width) minmax(0, 1fr); }
  .shell.navigation-collapsed { grid-template-columns: minmax(0, 1fr); }
  .navigation { grid-row: span 2; }
  .brand { padding-inline: 10px; gap: 7px; }
  .brand strong { font-size: 12px; }
  .brand-mark { width: 32px; height: 32px; }
  .tasks { grid-column: 2; position: static; height: auto; border-top: 1px solid var(--line); border-left: 0; min-height: 230px; }
  .shell.navigation-collapsed > .tasks { grid-column: 1; }
  .task-header { position: static; }
  .task-shortcut { position: fixed; z-index: 2; display: inline-flex; right: 12px; bottom: 12px; box-shadow: var(--shadow); }
  #task-content { padding-bottom: 58px; }
}

@media (max-width: 570px) {
  .shell { display: block; }
  .navigation { position: static; height: auto; padding: 12px 10px; }
  .brand { min-height: 40px; margin: 0 0 6px; padding: 0 4px 6px; }
  .brand small { display: none; }
  .navigation nav { max-height: min(42vh, 310px); overflow: auto; }
  .nav-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 5px; }
  .nav-group + .nav-group { margin-top: 3px; }
  .nav-group summary { min-height: 32px; padding-block: 6px; }
  .nav-group a { min-height: 31px; margin: 0; padding: 4px 6px; font-size: 11px; }
  .topbar { flex-wrap: wrap; gap: 5px; min-height: 56px; padding-inline: 10px; }
  .topbar-left { gap: 5px; }
  .top-actions { gap: 4px; }
  .page-tabs { padding-inline: 10px; }
  .page-content { padding: 12px 10px 24px; }
  .feedback { margin-inline: 10px; }
  .form-grid { grid-template-columns: 1fr; }
  .task-header { padding-inline: 12px; }
  #task-content { padding-inline: 12px; }
  .filter-panel > .field:first-child, .email-filter-fields > .field:first-child { grid-column: 1 / -1; }
  #email-results :is(th, td):last-child:not([colspan]) { width: 150px; min-width: 150px; padding-inline: 8px; }
  .email-row-actions { width: 134px; }
  #ip-results :is(th, td):last-child:not([colspan]) { width: 132px; min-width: 132px; padding-inline: 8px; }
}

@media (max-width: 380px) {
  .inventory-grid { grid-template-columns: 1fr; }
}

/* Clarity · white workspace. Presentation only; existing forms and states are retained. */
:root {
  color-scheme: only light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei UI", "PingFang SC", sans-serif;
  background: #fff; color: #24272e;
  --ink: #24272e; --muted: #687180; --line: #e6e9ef; --paper: #fff;
  --accent: #0868d9; --accent-dark: #0868d9; --accent-ink: #fff;
  --nav: #f7f8fa; --mint: #edf7f0; --danger: #b34242;
  --shadow: none; --radius: 16px; --row-space: 17px; --soft: #f7f8fb;
}
body { background: #fff; font-size: 14px; line-height: 1.5; }
.shell { --navigation-width: 218px; --task-panel-width: min(430px, 34vw); }
.navigation { padding: 24px 12px 16px; background: var(--nav); color: var(--ink); border-right: 1px solid var(--line); }
.brand { min-height: 48px; padding: 0 9px; margin-bottom: 27px; border: 0; gap: 11px; }
.brand-mark { width: 33px; height: 33px; background: #24272e; color: #fff; border-radius: 11px; font-weight: 650; }
.brand strong { color: var(--ink); font-size: 19px; font-weight: 650; letter-spacing: -.6px; }
.brand small { color: var(--muted); font-size: 9px; letter-spacing: 1.4px; margin-top: 4px; }
.nav-group + .nav-group { margin-top: 13px; }
.nav-group summary { padding: 9px 10px; min-height: 39px; color: #717988; font-size: 12px; font-weight: 500; border-radius: 9px; }
.nav-group summary:hover, .nav-group[open] summary { background: transparent; color: var(--ink); }
.nav-group summary::after { border-color: #8c94a2; width: 5px; height: 5px; }
.nav-icon { color: #798392; width: 16px; height: 16px; }
.nav-links { background: transparent; padding: 3px 0; display: grid; gap: 3px; }
.nav-group a { min-height: 37px; padding: 9px 11px 9px 31px; margin: 0; border: 0; border-radius: 9px; color: #606b7c; font-size: 12px; font-weight: 400; }
.nav-group a:hover { background: #eceff4; color: var(--ink); }
.nav-group a[aria-current="page"] { color: var(--accent); background: #fff; font-weight: 600; box-shadow: 0 1px 5px #172b4c07; }
.topbar { min-height: 67px; padding: 12px 28px; gap: 16px; }
.topbar-left { gap: 13px; }
.top-actions { gap: 9px; }
.breadcrumb { font-size: 12px; }
.breadcrumb strong { font-weight: 500; }
.current-operator { font-size: 11px; padding-right: 6px; }
.page-tabs { min-height: 45px; gap: 6px; padding: 6px 28px; box-shadow: none; scrollbar-width: thin; }
.page-tab { border-color: transparent; background: #fff; border-radius: 7px; font-size: 11px; min-height: 29px; }
.page-tab.is-active { color: var(--accent); border-color: #dce8f8; background: #f0f6ff; font-weight: 500; }
.page-tab > a { padding: 6px 10px; }
.page-content { padding: 28px 30px 40px; }
.page-heading, .resource-heading { align-items: center; gap: 20px; margin-bottom: 24px; }
.page-heading > div:first-child, .resource-heading > div:first-child { min-width: 0; }
.page-heading h1, .resource-heading h1 { font-size: 28px; font-weight: 650; letter-spacing: -.7px; }
.page-heading p, .resource-heading p { margin-top: 9px; font-size: 12px; line-height: 1.7; max-width: 880px; }
.clarity-eyebrow { font-size: 10px; color: var(--muted); letter-spacing: 1.8px; margin-bottom: 7px; font-weight: 500; }
.button { min-height: 35px; border-radius: 8px; border-color: #dce1e9; font-size: 12px; font-weight: 500; padding: 8px 12px; line-height: 1.3; }
.button:hover { border-color: #c7d4e4; background: #f4f7fb; }
.button.primary:hover { background: #075cbe; border-color: #075cbe; }
.button.quiet:hover { background: #f3f5f8; }
.button.nav-toggle { height: 33px; color: var(--muted); }
.badge { padding: 4px 8px; border-radius: 6px; font-weight: 500; font-size: 11px; line-height: 1.35; }
.badge.success { background: #edf7f0; color: #28704d; }
.badge.waiting { background: #fff4e3; color: #94601c; }
.badge.active { background: #edf4ff; color: #2867b0; }
.badge.danger { background: #fcefed; color: #ad4942; }
.panel, .inventory-card { border-radius: var(--radius); box-shadow: none; border-color: var(--line); }
.panel + .panel { margin-top: 18px; }
.panel-heading { min-height: 52px; padding: 15px 18px; gap: 12px; }
.panel-heading h2 { font-size: 14px; font-weight: 600; letter-spacing: -.1px; }
.panel-heading p { font-size: 11px; }
.panel-heading > p { margin-left: auto; }
.panel-content { padding: 20px; font-size: 13px; line-height: 1.8; }
.inventory-grid { gap: 16px; margin-bottom: 24px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.inventory-card { padding: 21px; gap: 9px; min-height: 146px; }
.inventory-card:hover { background: #fafcff; border-color: #cbdcf2; }
.inventory-card span { color: var(--muted); font-weight: 500; font-size: 12px; }
.inventory-card strong { font-size: 32px; font-weight: 600; letter-spacing: -.7px; font-variant-numeric: tabular-nums; }
.inventory-card small { font-size: 11px; }
table { font-size: 13px; }
th, td { padding: var(--row-space) 15px; border-right: 0; border-bottom: 1px solid var(--line); }
th { padding-block: 12px; font-size: 11px; font-weight: 500; color: var(--muted); background: #f8f9fb; }
tbody tr:nth-child(even) td { background: #fff; }
tbody tr:hover td { background: #f7faff; }
table .record { min-width: 145px; max-width: 245px; }
.record strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 550; }
.record .subtle { font-size: 11px; line-height: 1.5; }
.data-panel td .button { min-height: 30px; font-weight: 500; font-size: 12px; padding: 4px 2px; }
.data-panel td .actions { gap: 4px 12px; }
.data-panel .table-empty { padding: 48px 20px; }
.empty { color: var(--muted); font-size: 13px; }
.data-panel:has(.table-empty) thead { display: none; }
.table-wrap { scrollbar-width: thin; scrollbar-color: #cdd5df #f7f8fa; }
.table-wrap:focus-visible { outline: 2px solid #bfd6f5; outline-offset: -2px; }
.notes, .log-message { line-height: 1.65; }
.inline-credential { color: #526174; font-size: 12px; }
.note-cell { border-radius: 7px; }
.section-note { margin-bottom: 17px; line-height: 1.7; font-size: 12px; }
.apple-workflow-nav { gap: 7px; margin-bottom: 20px; padding-bottom: 17px; border-bottom: 1px solid var(--line); }
.apple-workflow-nav .button { border-color: transparent; background: transparent; color: var(--muted); }
.apple-workflow-nav .button[aria-current], .apple-workflow-nav .button.primary { color: var(--accent); background: #eef5ff; }
.apple-arrange-toolbar { margin-block: 14px; gap: 8px; }
.apple-arrange-toolbar .actions { gap: 8px; }
.apple-arrange-toolbar small { font-size: 11px; }
.filter-panel, .email-toolbar { border-radius: 12px; box-shadow: none; padding: 16px 18px; margin-bottom: 18px; gap: 13px; }
.email-filter-fields { gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 135px), 1fr)); }
.email-toolbar-bottom { padding-top: 12px; border-color: var(--line); }
#apple-list-filter { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 14px; }
#apple-list-filter .email-filter-fields { flex: 1; min-width: min(100%, 420px); }
#apple-list-filter .email-toolbar-bottom { border: 0; padding-top: 0; padding-bottom: 1px; }
.email-toolbar-actions .button[data-action="email-add"] { background: var(--accent); border-color: var(--accent); }
.email-toolbar-actions .button[data-action="email-add"]:hover { background: #075cbe; border-color: #075cbe; }
.field { gap: 7px; font-size: 12px; font-weight: 500; color: #566173; }
.field input:not([type="checkbox"]), .field textarea, .field select { border-color: #dce1e9; border-radius: 8px; padding: 9px 11px; min-height: 38px; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: #8db7ed; }
.form, .form-grid { gap: 17px; }
.form-hint { font-size: 12px; color: var(--muted); }
.dialog-actions { margin-top: 7px; gap: 9px; }
.pagination { padding: 14px 16px; border-color: var(--line); gap: 13px; }
.pagination select, #email-page-size, #apple-list-size { border: 1px solid var(--line); border-radius: 7px; padding: 5px 8px; background: #fff; color: var(--ink); }
.pagination .button { border-color: transparent; border-radius: 7px; }
.resource-tabs { gap: 7px; margin-bottom: 19px; }
.resource-tabs .button[aria-pressed="true"] { background: #24272e; border-color: #24272e; color: #fff; }
.ip-status-counts { gap: 9px; margin-bottom: 18px; }
.ip-status-counts .button { border-color: transparent; background: #f8f9fb; }
.ip-status-counts .button[aria-pressed="true"] { background: #edf4ff; color: var(--accent); }
.ip-detail, .email-detail, .apple-history { gap: 18px; }
.settings-list div { padding: 15px 20px; gap: 18px; }
.settings-list dt { color: #515d70; font-weight: 500; }
.settings-list dd { font-size: 13px; }
#ip-results :is(th, td):last-child:not([colspan]), #email-results :is(th, td):last-child:not([colspan]) { background: #fff; box-shadow: -1px 0 var(--line), -8px 0 12px -10px #23365328; }
#ip-results th:last-child, #email-results th:last-child { background: #f8f9fb; }
#ip-results tbody tr:nth-child(even) td:last-child:not([colspan]), #email-results tbody tr:nth-child(even) td:last-child:not([colspan]) { background: #fff; }
#ip-results tbody tr:hover td:last-child:not([colspan]), #email-results tbody tr:hover td:last-child:not([colspan]) { background: #f7faff; }
.feedback { margin: 18px 30px 0; padding: 13px 16px; border-radius: 11px; border-color: #d8ebde; }
.tasks { background: #fafbfd; }
.task-header { padding: 23px 20px 18px; background: #fff; }
.task-header h2 { font-size: 18px; letter-spacing: -.3px; }
.task-header p { font-size: 12px; }
.task-count { background: #edf4ff; color: var(--accent); border-radius: 6px; }
.task-status-filters .button { border-radius: 7px; font-size: 11px; }
.task-status-filters .button[aria-pressed="true"] { background: #24272e; color: #fff; border-color: #24272e; }
.task-row, .task-detail, .task-empty { border-radius: 12px; }
.task-row { padding: 15px; background: #fff; }
.task-row[aria-expanded="true"] { border-color: #a5c8f4; background: #f4f8ff; }
.task-row strong { font-size: 13px; font-weight: 550; }
.task-detail h3 { font-size: 15px; }
dialog { border-radius: 18px; border-color: #e2e6ed; box-shadow: 0 24px 100px #18273929; }
dialog::backdrop { background: #18243252; backdrop-filter: blur(3px); }
.dialog-header { position: sticky; top: 0; z-index: 2; background: #fff; padding: 19px 23px; }
.dialog-header h2 { font-size: 19px; letter-spacing: -.3px; font-weight: 600; }
#dialog-body { padding: 23px; }
.access-card { width: min(100%, 440px); padding: 36px; border-radius: 22px; gap: 23px; box-shadow: 0 12px 70px #2336530a; }
.access-card .brand-mark { width: 42px; height: 42px; border-radius: 14px; font-size: 23px; }
.access-card h1 { font-size: 25px; letter-spacing: -.7px; }
.access-card > .button { min-height: 42px; }
.clarity-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 0; margin-bottom: 18px; background: #fff; }
.clarity-stat { min-width: 0; padding: 0 22px; border-right: 1px solid var(--line); }
.clarity-stat:last-child { border: 0; }
.clarity-stat span { color: var(--muted); font-size: 12px; }
.clarity-stat strong { display: block; font-size: 27px; line-height: 1.3; letter-spacing: -.7px; font-weight: 600; margin-top: 4px; font-variant-numeric: tabular-nums; }
.clarity-tools { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin: 20px 0 15px; }
.clarity-section-tabs { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; min-width: 0; }
.clarity-section-tabs .button { border-color: transparent; background: #fff; color: var(--muted); }
.clarity-section-tabs .button[aria-pressed="true"] { color: #fff; background: #24272e; }
.clarity-section-tabs small { font-size: 10px; opacity: .75; font-variant-numeric: tabular-nums; }
.clarity-view-switch { display: flex; padding: 3px; gap: 3px; background: #f3f5f8; border: 1px solid var(--line); border-radius: 9px; }
.clarity-view-switch .button { min-height: 29px; padding: 5px 10px; font-size: 12px; border: 0; background: transparent; }
.clarity-view-switch .button[aria-pressed="true"] { color: var(--ink); background: #fff; box-shadow: 0 1px 4px #1226380b; }
.clarity-panel-tools { display: flex; align-items: center; gap: 10px; }
.clarity-panel-tools .button { min-height: 29px; padding: 5px 8px; font-size: 11px; }
.clarity-columns { padding: 14px 18px; border-bottom: 1px solid var(--line); background: #fafbfd; }
.clarity-columns-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; color: var(--muted); font-size: 12px; }
.clarity-columns-options { display: flex; flex-wrap: wrap; gap: 12px 19px; }
.clarity-columns label { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #556175; }
.clarity-columns input { accent-color: var(--accent); }
.clarity-row-button { color: var(--accent) !important; white-space: nowrap; }
.clarity-record-detail { display: grid; gap: 0; }
.clarity-record-field { display: grid; grid-template-columns: minmax(100px, 30%) minmax(0, 1fr); gap: 20px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.clarity-record-field dt { color: var(--muted); font-size: 12px; font-weight: 400; }
.clarity-record-field dd { margin: 0; font-size: 13px; overflow-wrap: anywhere; min-width: 0; }
.clarity-record-detail .record { max-width: none; }
.clarity-record-detail .record strong { white-space: normal; overflow-wrap: anywhere; }
.clarity-record-actions { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 9px; }
.clarity-collection .panel + .panel { margin-top: 0; }
.clarity-stage-panels { display: grid; gap: 18px; }
.clarity-board .clarity-stage-panels { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); align-items: start; }
.clarity-board .data-panel { border: 0; background: #f6f7f9; padding: 10px; border-radius: 14px; overflow: visible; }
.clarity-board .panel-heading { min-height: 35px; padding: 2px 3px 12px; border: 0; }
.clarity-board .panel-heading h2 { font-size: 12px; color: #5e6879; }
.clarity-board .panel-heading > p { font-size: 11px; }
.clarity-board .clarity-panel-tools { display: none; }
.clarity-board .table-wrap { overflow: visible; }
.clarity-board table, .clarity-board tbody { display: block; min-width: 0 !important; width: 100%; }
.clarity-board thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.clarity-board tr { display: flex; flex-direction: column; padding: 15px; margin-bottom: 11px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.clarity-board tr:last-child { margin-bottom: 0; }
.clarity-board td { display: block; width: auto !important; min-width: 0 !important; border: 0; padding: 5px 0; background: transparent !important; text-align: left; }
.clarity-board td::before { content: attr(data-clarity-label); display: block; color: var(--muted); font-size: 10px; margin-bottom: 3px; }
.clarity-board td.clarity-card-identity::before, .clarity-board td:last-child::before, .clarity-board td.clarity-card-select::before { display: none; }
.clarity-board .record { min-width: 0; max-width: 100%; }
.clarity-board .record strong { white-space: normal; overflow-wrap: anywhere; }
.clarity-board .actions { display: flex; flex-wrap: wrap; margin-top: 5px; border-top: 1px solid var(--line); padding-top: 8px; gap: 6px 10px; }
.clarity-board td:last-child { position: static !important; box-shadow: none !important; }
.clarity-board .table-empty { padding: 20px 8px; font-size: 12px; }
.clarity-board .table-empty::before { display: none; }
.clarity-board-note { color: var(--muted); font-size: 11px; margin: 0 0 15px; }
.clarity-density-compact { --row-space: 10px; }
/* Keep original selection and action entry points accessible in wide lists. */
.data-panel .clarity-operation-cell { position: sticky; right: 0; z-index: 2; background: #fff; min-width: 140px; box-shadow: -5px 0 8px -7px #607086; }
.data-panel .clarity-operation-cell .actions { max-width: 220px; flex-wrap: wrap; }
.data-panel .clarity-selection-cell { position: sticky; left: 0; z-index: 2; background: #fff; }
.data-panel thead .clarity-operation-cell, .data-panel thead .clarity-selection-cell { z-index: 3; background: #fafbfd; }
.clarity-board .clarity-operation-cell, .clarity-board .clarity-selection-cell { position: static; box-shadow: none; }
@media (max-width: 570px) { .data-panel .clarity-operation-cell { min-width: 100px; } .data-panel .clarity-operation-cell .actions { max-width: 150px; } }
@media (min-width: 1600px) { .shell { --navigation-width: 230px; } .page-content { padding: 32px 38px 48px; } .clarity-board .clarity-stage-panels { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); } }
@media (max-width: 1120px) {
  .shell { --navigation-width: 190px; --task-panel-width: min(410px, 40vw); }
  .page-content { padding: 24px 22px 32px; }
  .topbar, .page-tabs { padding-inline: 22px; }
  .page-heading h1, .resource-heading h1 { font-size: 25px; }
  .inventory-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .clarity-stat { padding-inline: 17px; }
}
@media (max-width: 900px) {
  .shell { --navigation-width: 174px; }
  .navigation { padding-inline: 9px; }
  .brand { padding-inline: 5px; gap: 8px; }
  .brand strong { font-size: 17px; }
  .brand small { font-size: 8px; letter-spacing: .8px; }
  .topbar { flex-wrap: wrap; }
  .task-header { position: static; }
  .tasks { background: #fafbfd; }
  .clarity-summary { padding: 15px 0; }
}
@media (max-width: 570px) {
  .navigation { padding: 15px 12px; }
  .brand { margin-bottom: 10px; }
  .nav-group + .nav-group { margin-top: 5px; }
  .nav-group a { min-height: 34px; padding: 7px; font-size: 11px; }
  .nav-links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-content { padding: 21px 13px 30px; }
  .topbar, .page-tabs { padding-inline: 13px; }
  .top-actions { gap: 5px; }
  .page-heading { gap: 13px; margin-bottom: 20px; }
  .page-heading h1, .resource-heading h1 { font-size: 23px; }
  .page-heading p, .resource-heading p { font-size: 12px; }
  .clarity-stat { padding-inline: 11px; }
  .clarity-stat span { font-size: 11px; }
  .clarity-stat strong { font-size: 24px; }
  .clarity-tools { gap: 10px; }
  .clarity-section-tabs .button { padding: 7px 9px; font-size: 11px; }
  .clarity-record-field { grid-template-columns: 1fr; gap: 6px; }
  .panel-heading { padding-inline: 14px; }
  .filter-panel, .email-toolbar { padding: 14px; }
  .email-filter-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .feedback { margin-inline: 13px; }
  .inventory-grid { gap: 12px; }
  .inventory-card { padding: 16px; min-height: 130px; }
  .dialog-header, #dialog-body { padding: 18px; }
}
@media (max-width: 380px) { .inventory-grid { grid-template-columns: 1fr; } .email-filter-fields { grid-template-columns: 1fr; } .email-filter-fields > .field:first-child { grid-column: auto; } }
@media (pointer: coarse) { .button, .nav-group a { min-height: 44px; } .field input, .field select, .field textarea { font-size: 16px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; } }

/* Keep the merged lifecycle status readable without adding a second status column. */
table[aria-label="环境与 Claude 账号列表"] td:nth-child(9) { min-width: 104px; white-space: nowrap; }

/* Task drawer: overlay only; the workspace never gives up a grid column. */
html { scrollbar-gutter: stable; }
body.task-drawer-open { overflow: hidden; }
.shell, .shell.tasks-collapsed { grid-template-columns: var(--navigation-width) minmax(0, 1fr); }
.shell.navigation-collapsed, .shell.navigation-collapsed.tasks-collapsed { grid-template-columns: minmax(0, 1fr); }
dialog.tasks { position: fixed; inset: 0 0 0 auto; margin: 0; width: min(560px, 100%); max-width: 100%; height: 100vh; height: 100dvh; max-height: 100dvh; padding: 0; border: 0; border-left: 1px solid var(--line); border-radius: 0; background: var(--paper); color: var(--ink); box-shadow: -8px 0 32px #21324b24; overflow: hidden; }
dialog.tasks[open] { display: flex; flex-direction: column; }
dialog.tasks::backdrop { background: #182b4533; }
.task-notice { padding: 10px 12px; border-radius: 6px; background: #edf6f1; color: #286247; font-size: 13px; overflow-wrap: anywhere; }
.task-notice.error { background: #fff1f3; color: var(--danger); }
.task-notice .button { margin-left: 4px; }
dialog.tasks .task-header { position: static; flex-shrink: 0; padding: 22px 24px 16px; gap: 16px; }
dialog.tasks .task-header h2 { font-size: 21px; }
dialog.tasks .task-header-top { gap: 12px; }
dialog.tasks .task-refresh { background: var(--paper); color: var(--accent); border-color: var(--line); }
dialog.tasks .task-header p { line-height: 1.6; }
dialog.tasks #task-content { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 16px 24px 24px; }
dialog.tasks .task-detail { padding: 0; margin: 0; border: 0; border-radius: 0; }
dialog.tasks .task-back { padding: 0 0 16px; border: 0; color: var(--muted); }
dialog.tasks .task-detail h3 { font-size: 18px; line-height: 1.5; }
dialog.tasks .task-instruction { margin: 18px 0; padding: 15px; border-radius: 8px; background: #f5f8fd; line-height: 1.65; }
dialog.tasks .task-list { gap: 0; }
dialog.tasks .task-row { border: 0; border-bottom: 1px solid var(--line); padding: 18px 10px; border-radius: 0; gap: 8px; }
dialog.tasks .task-row strong { font-size: 14px; font-weight: 600; }
dialog.tasks .task-row time { font-size: 12px; }
.task-footer { flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 16px 24px; border-top: 1px solid var(--line); background: var(--paper); }
.task-footer > span { font-size: 12px; color: var(--muted); }
.task-footer .actions { margin: 0; }
.task-choice-field { border: 0; padding: 0; margin: 0; min-width: 0; }
.task-choice-field legend { padding: 0; margin-bottom: 10px; font-size: 14px; font-weight: 600; }
.task-required { margin-left: 8px; font-size: 11px; font-weight: 400; color: var(--muted); }
.task-choice-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.task-choice { display: flex; gap: 10px; align-items: flex-start; min-width: 0; padding: 15px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); cursor: pointer; font-size: 14px; line-height: 1.55; overflow-wrap: anywhere; }
.task-choice input { width: 16px; height: 16px; margin: 3px 0 0; flex-shrink: 0; accent-color: var(--accent); }
.task-choice:hover { border-color: #a6bee5; background: #f8faff; }
.task-choice:has(input:checked) { border-color: var(--accent); background: #eff5ff; box-shadow: inset 0 0 0 1px var(--accent); }
.task-choice:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.task-note > summary { color: var(--accent); cursor: pointer; font-size: 13px; }
.task-note > .field { margin-top: 10px; }
.task-note textarea { min-height: 76px; }
.task-logs { border-top: 1px solid var(--line); margin-top: 20px; padding-top: 16px; }
.task-logs > summary { cursor: pointer; font-size: 13px; color: var(--muted); }
.task-logs > summary .subtle { display: inline; margin-left: 8px; }
#task-toggle-count { font-size: 11px; white-space: normal; background: #edf3fd; }
#feedback .button { margin-left: 6px; padding: 4px 8px; min-height: 28px; }
@media (max-width: 900px) {
  dialog.tasks { width: 100%; border: 0; }
  dialog.tasks .task-header { padding: 18px 16px 14px; }
  dialog.tasks #task-content { padding: 16px; }
  .task-footer { padding: 14px 16px; }
}
@media (max-width: 420px) {
  .task-choice-options { grid-template-columns: minmax(0, 1fr); }
  #task-toggle-count { max-width: 160px; }
  dialog.tasks .task-header-actions { gap: 3px; }
}
