
:root { --admin-bg: #f3f6fa; --surface: #fff; --sidebar: #0d1725; --sidebar-2: #142235; --text: #172236; --muted: #708096; --border: #dce3ec; --blue: #176fe5; --blue-soft: #e9f2ff; --green: #159565; --amber: #c47a10; --cyan: #168ca5; --danger: #d54444; }
* { box-sizing: border-box; }
html, body, #admin-app { min-height: 100%; }
body { margin: 0; background: var(--admin-bg); color: var(--text); font-family: 'Noto Sans SC', sans-serif; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
svg { width: 18px; height: 18px; }

.admin-loading { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 16px; color: var(--muted); }
.admin-loading span { width: 34px; height: 34px; border: 3px solid #dbe4ef; border-top-color: var(--blue); border-radius: 50%; animation: admin-spin .7s linear infinite; }
.admin-loading p { margin: 0; font-size: 14px; }
@keyframes admin-spin { to { transform: rotate(360deg); } }

.login-page { min-height: 100vh; display: grid; place-items: center; padding: 28px; background: #0b1421; }
.login-panel { width: min(440px, 100%); padding: 38px; border: 1px solid #26384e; border-radius: 6px; background: #111e2e; box-shadow: 0 28px 80px rgba(0,0,0,.3); }
.login-brand { display: flex; align-items: center; justify-content: space-between; padding-bottom: 26px; border-bottom: 1px solid #26384e; }
.login-brand img { width: 140px; }
.login-brand span { color: #6f849e; font-family: 'DM Mono', monospace; font-size: 10px; }
.login-copy { margin: 38px 0 30px; }
.login-copy p, .view-heading p, .section-title p { margin: 0 0 8px; color: var(--blue); font-family: 'DM Mono', monospace; font-size: 11px; }
.login-copy h1 { margin: 0; color: #fff; font-size: 30px; }
.login-panel form { display: grid; gap: 18px; }
.login-panel label span { color: #aab8ca; }
.login-panel input { border-color: #30445d; background: #0b1624; color: #fff; }
.login-panel > small { display: block; margin-top: 28px; color: #536a85; font-family: 'DM Mono', monospace; font-size: 9px; text-align: center; }
.form-error { margin: -3px 0 0; color: #ff8b8b; font-size: 12px; }
.login-sms-hint { padding: 13px 15px; border: 1px solid #d8e4f0; border-radius: 5px; background: #f5f8fc; color: #65758b; font-size: 14px; }
.login-sms-hint strong { color: var(--text); font-size: 16px; }
.login-sms-hint small { display: block; margin-top: 4px; color: #77869a; font-size: 12px; }
.login-code-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: -6px; }
.text-action { padding: 4px 0; border: 0; background: transparent; color: var(--blue); font: inherit; cursor: pointer; }
.text-action:disabled { color: #8a99aa; cursor: default; }
.login-page .form-error { color: #b42318; }

.admin-shell { min-height: 100vh; }
.admin-sidebar { position: fixed; z-index: 30; top: 0; bottom: 0; left: 0; width: 252px; display: flex; flex-direction: column; padding: 0 16px 18px; background: var(--sidebar); color: #dfe9f5; }
.admin-brand { height: 92px; display: flex; justify-content: center; flex-direction: column; gap: 8px; padding: 0 14px; border-bottom: 1px solid #243449; }
.admin-brand img { width: 134px; }
.admin-brand small { color: #6f829a; font-size: 11px; }
.admin-sidebar nav { display: grid; gap: 4px; margin-top: 20px; }
.admin-brand, .admin-user { flex-shrink: 0; }
.admin-sidebar nav { min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #cad4e2 transparent; margin-bottom: 16px; flex: 1; align-content: start; }
.admin-sidebar nav button { min-height: 44px; display: flex; align-items: center; gap: 13px; padding: 0 14px; border: 0; border-radius: 5px; background: transparent; color: #93a5bb; font-size: 13px; text-align: left; cursor: pointer; }
.admin-sidebar nav button:hover { background: #142235; color: #fff; }
.admin-sidebar nav button.active { background: #1a3150; color: #fff; box-shadow: inset 3px 0 #3b8cff; }
.admin-sidebar nav button.active svg { color: #62a2ff; }
.admin-user { display: grid; grid-template-columns: 36px 1fr 34px; align-items: center; gap: 10px; margin-top: auto; padding: 16px 8px 0; border-top: 1px solid #243449; }
.admin-user > span { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: #263b57; color: #fff; font-weight: 700; }
.admin-user div { display: flex; flex-direction: column; min-width: 0; }
.admin-user strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; }
.admin-user small { margin-top: 3px; color: #6f829a; font-size: 10px; }
.admin-user button { display: grid; place-items: center; width: 34px; height: 34px; border: 0; background: transparent; color: #71859d; cursor: pointer; }
.admin-user button:hover { color: #fff; }

.admin-workspace { min-height: 100vh; margin-left: 252px; }
.admin-topbar { position: sticky; z-index: 20; top: 0; height: 78px; display: flex; align-items: center; gap: 18px; padding: 0 34px; border-bottom: 1px solid var(--border); background: rgba(255,255,255,.96); }
.admin-topbar > div { min-width: 0; }
.admin-topbar small { color: #91a0b3; font-family: 'DM Mono', monospace; font-size: 9px; }
.admin-topbar h1 { margin: 3px 0 0; font-size: 20px; }
.admin-topbar > a { margin-left: auto; }
.mobile-nav-toggle { display: none; width: 40px; height: 40px; place-items: center; border: 1px solid var(--border); border-radius: 5px; background: #fff; color: var(--text); }
.admin-content { width: min(1380px, calc(100% - 68px)); margin: 0 auto; padding: 38px 0 70px; }
.admin-view { min-width: 0; }
.narrow-view { max-width: 900px; }
.view-heading { min-height: 62px; display: flex; align-items: flex-end; justify-content: space-between; gap: 25px; margin-bottom: 28px; }
.view-heading h2 { margin: 0; font-size: 28px; }
.heading-actions { display: flex; gap: 10px; }

.admin-btn { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; padding: 0 15px; border: 1px solid transparent; border-radius: 5px; font-size: 12px; font-weight: 600; cursor: pointer; }
.status-good { color: #17805c; font-weight: 700; }
.status-bad { color: #c23b42; font-weight: 700; }
.form-hint { margin: 8px 0 18px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.legacy-preview .metric-grid { margin-top: 0; }
.admin-btn.primary { background: var(--blue); color: #fff; }
.admin-btn.primary:hover { background: #0f62d1; }
.admin-btn.secondary { border-color: var(--border); background: #fff; color: #394a60; }
.admin-btn.secondary:hover { border-color: #aac2e1; color: var(--blue); }
.admin-btn.wide { width: 100%; min-height: 46px; }
.admin-btn:disabled { cursor: wait; opacity: .6; }
.icon-btn { width: 36px; height: 36px; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid var(--border); border-radius: 5px; background: #fff; color: #607187; cursor: pointer; }
.icon-btn:hover { border-color: #a9bfdc; color: var(--blue); }
.icon-btn.danger:hover { border-color: #efb1b1; background: #fff5f5; color: var(--danger); }
.icon-btn:disabled { opacity: .4; cursor: not-allowed; }
.managed-user-table { min-width: 880px; }
.managed-admin-table { min-width: 800px; }
.managed-user-table .admin-data-head, .managed-user-table .admin-data-row { grid-template-columns: minmax(120px, 1fr) 140px minmax(150px, 1fr) 70px 150px 124px; }
.managed-admin-table .admin-data-head, .managed-admin-table .admin-data-row { grid-template-columns: 150px 100px 130px minmax(180px, 1fr) 70px 45px; }
.management-actions { display: flex; gap: 6px; }
.managed-email { overflow-wrap: anywhere; }
.permission-summary { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.management-editor { max-width: 920px; }
.management-check { display: flex; flex-direction: row; align-items: center; gap: 10px; min-height: 40px; }
.management-check input[type="checkbox"] { width: 17px; height: 17px; min-height: 0; margin: 0; padding: 0; accent-color: var(--blue); flex-shrink: 0; }
.management-check span { margin: 0; }
.management-editor .form-grid > .management-check { align-self: end; }
.permission-fieldset { min-width: 0; margin: 0; padding: 16px 0 0; border: 0; border-top: 1px solid var(--border); }
.permission-fieldset legend { padding: 0 14px 0 0; font-size: 16px; font-weight: 600; }
.permission-all { margin-bottom: 8px; }
.permission-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px 20px; }
.permission-fieldset:disabled { opacity: .65; }
@media (max-width: 760px) { .permission-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 12px; } .management-editor { padding: 20px; } }

.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.metric-grid article { min-height: 155px; display: grid; grid-template-columns: 44px 1fr; align-content: center; gap: 9px 16px; padding: 24px; border: 1px solid var(--border); border-radius: 6px; background: #fff; }
.metric-grid article > div { grid-row: 1 / 3; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 5px; }
.metric-grid article span { align-self: end; color: var(--muted); font-size: 12px; }
.metric-grid article strong { font-family: 'DM Mono', monospace; font-size: 29px; }
.metric-grid .tone-blue > div { background: #e9f2ff; color: var(--blue); }
.metric-grid .tone-green > div { background: #e8f7f1; color: var(--green); }
.metric-grid .tone-amber > div { background: #fff4df; color: var(--amber); }
.metric-grid .tone-cyan > div { background: #e5f6f8; color: var(--cyan); }
.dashboard-band { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 18px; border: 1px solid var(--border); background: #fff; }
.dashboard-band > div { min-height: 92px; display: flex; justify-content: center; flex-direction: column; padding: 0 24px; border-right: 1px solid var(--border); }
.dashboard-band > div:last-child { border-right: 0; }
.dashboard-band span { color: #91a0b2; font-family: 'DM Mono', monospace; font-size: 9px; }
.dashboard-band strong { margin-top: 8px; font-size: 13px; }
.recent-log { margin-top: 28px; padding: 25px; border: 1px solid var(--border); border-radius: 6px; background: #fff; }
.section-title { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 18px; }
.section-title h3 { margin: 0; font-size: 18px; }
.section-title button { border: 0; background: none; color: var(--blue); font-size: 12px; cursor: pointer; }

.form-section, .admin-record { border: 1px solid var(--border); border-radius: 6px; background: #fff; }
.card-issue-form { margin: 18px 0; }
.card-issue-form .section-title { margin-bottom: 20px; padding: 0 0 16px; }
.card-issue-form .section-title h3 { margin: 0; font-size: 21px; }
.card-issue-form > .form-grid.three { grid-template-columns: minmax(0, 1fr); }
.choice-field { min-width: 0; display: flex; flex-direction: column; gap: 8px; color: #526278; font-size: 12px; }
.choice-options { display: grid; gap: 6px; }
.choice-options.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.choice-options.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.choice-options.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.choice-options button { min-height: 42px; padding: 0 10px; border: 1px solid #ced8e5; border-radius: 4px; background: #fff; color: #526278; font-size: 12px; line-height: 1.35; cursor: pointer; }
.choice-options button:hover { border-color: #8fb6e9; color: var(--blue); background: #f8fbff; }
.choice-options button.active { border-color: var(--blue); background: var(--blue-soft); color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue); font-weight: 600; }
.card-category-options { display: grid; gap: 8px; }
.product-category-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.product-category-options button { min-height: 38px; padding: 0 8px; border: 1px solid #b9cce3; border-radius: 4px; background: #f7faff; color: #385675; font-size: 11px; cursor: pointer; }
.product-category-options button:hover { border-color: var(--blue); color: var(--blue); }
.product-category-options button.active { border-color: var(--blue); background: var(--blue); color: #fff; box-shadow: inset 0 0 0 1px var(--blue); font-weight: 600; }
.card-category-options section { display: grid; gap: 5px; }
.card-category-options section > strong { color: #708096; font-size: 11px; font-weight: 600; }
.card-category-options section:last-child > strong { color: #a66308; }
.iocp-products { min-width: 0; }
.iocp-products > strong { display: block; color: #708096; font-size: 11px; font-weight: 600; }
.choice-loading, .choice-empty { margin: 4px 0 0; color: #7b8798; font-size: 11px; }
.iocp-group-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: max-content; align-content: start; gap: 10px; max-height: min(620px, 68vh); overflow-y: auto; padding: 2px 3px 2px 0; }
.iocp-group { min-width: 0; align-self: start; overflow: hidden; border: 1px solid #dce3ec; border-radius: 5px; background: #fff; }
.iocp-group > header { display: flex; align-items: center; gap: 6px; padding: 8px 11px; background: #2f86df; color: #fff; font-size: 13px; font-weight: 700; }
.iocp-group > header svg { width: 15px; height: 15px; }
.iocp-product-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; padding: 8px; }
.iocp-product-options button { min-width: 0; min-height: 70px; padding: 7px 8px; display: grid; grid-template-columns: auto 1fr; align-content: center; align-items: center; gap: 3px 7px; border: 1px solid #d6dee8; border-radius: 4px; background: #fafcff; color: #526278; text-align: left; cursor: pointer; }
.iocp-product-options button:last-child:nth-child(odd) { grid-column: 1 / -1; }
.iocp-product-options button:hover { border-color: var(--blue); background: #f0f7ff; }
.iocp-product-options button.active { border-color: var(--blue); background: #e6f2ff; box-shadow: 0 0 0 2px rgba(23,111,229,.16); }
.iocp-product-options button.unavailable { border-style: dashed; opacity: .58; cursor: not-allowed; }
.iocp-product-options .iocp-price { color: #e33b2f; font-size: 14px; font-weight: 700; white-space: nowrap; }
.iocp-product-options .iocp-cap { color: #66758a; font-size: 11px; white-space: nowrap; }
.iocp-product-options small { grid-column: 1 / -1; overflow: hidden; color: #526278; font-size: 10px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.iocp-product-options em { grid-column: 1 / -1; width: fit-content; padding: 2px 5px; border: 1px solid #81c784; border-radius: 3px; background: #e8f5e9; color: #2e7d32; font-size: 10px; font-style: normal; }
.iocp-product-options button.unavailable em { border-color: #cbd2dc; background: #f2f4f7; color: #7b8798; }
.iocp-product-options button.unavailable em::after { content: ' · 暂未开放'; }
@media (max-width: 760px) { .iocp-group-grid { grid-template-columns: 1fr; max-height: 68vh; } }
.issue-result { margin-top: 20px; padding: 16px; border: 1px solid #b9d8ca; border-radius: 5px; background: #f2fbf6; }
.issue-result > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.issue-result strong { color: #16805a; font-size: 14px; }
.issue-result textarea { min-height: 110px; border-color: #b9d8ca; background: #fff; font-family: 'DM Mono', monospace; line-height: 1.7; }
.form-section { display: grid; gap: 22px; padding: 28px; }
.form-section h3 { margin: 0 0 4px; font-size: 18px; }
.purchase-policy-form { margin-bottom: 22px; gap: 12px; padding: 22px 26px; }
.purchase-policy-form .checkbox-field label { display: inline-flex; align-items: center; justify-content: flex-start; gap: 10px; font-size: 14px; line-height: 1.6; cursor: pointer; }
.purchase-policy-form .checkbox-field input { width: 18px; height: 18px; min-height: 0; padding: 0; margin: 0; accent-color: var(--blue); }
.purchase-policy-form .form-hint { margin: 0; }
.purchase-policy-form .heading-actions { justify-content: flex-start; margin-top: 4px; }
.payment-config-intro { margin: -4px 0 22px; }
.payment-config-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 20px 0; }
.payment-config-toolbar p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.payment-config-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.payment-config-card { gap: 16px; min-width: 0; }
.payment-config-card-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.payment-config-card-head > div { display: grid; gap: 6px; min-width: 0; }
.payment-config-card-head strong { color: var(--text); font-size: 17px; overflow-wrap: anywhere; }
.payment-config-card-head small { color: var(--muted); font-size: 12px; }
.payment-config-card dl { display: grid; gap: 10px; margin: 0; padding-top: 16px; border-top: 1px solid var(--border); }
.payment-config-card dl > div { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 12px; }
.payment-config-card dt { color: var(--muted); font-size: 12px; }
.payment-config-card dd { margin: 0; color: var(--text); font-size: 13px; overflow-wrap: anywhere; }
.payment-config-card .form-hint { margin: 0; overflow-wrap: anywhere; }
.payment-config-card .heading-actions { justify-content: flex-start; }
.payment-config-list > .empty-state { grid-column: 1 / -1; }
.payment-config-delete { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 18px; padding: 18px 22px; border: 1px solid #ebc0bf; border-radius: 6px; background: #fff7f6; }
.payment-config-delete strong { color: #8d2626; font-size: 14px; }
.payment-config-delete p { margin: 7px 0 0; color: #8b6564; font-size: 12px; line-height: 1.6; }
.payment-config-form { margin-top: 22px; }
.payment-config-form fieldset { margin: 0; min-width: 0; }
.payment-config-form .heading-actions { justify-content: flex-start; }
.payment-config-secrets { padding: 18px; border: 1px solid var(--border); border-radius: 6px; background: #f8fafc; }
.payment-config-secrets h4 { margin: 0; color: var(--text); font-size: 15px; }
.payment-config-secrets .form-hint { margin: 8px 0 18px; }
.payment-secret-field { display: grid; align-content: start; gap: 8px; min-width: 0; }
.payment-secret-field label > span { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.payment-secret-field small { color: var(--muted); font-weight: 400; white-space: nowrap; }
.payment-secret-field small.configured { color: #16805a; }
.payment-secret-field textarea { font-family: ui-monospace, monospace; font-size: 12px; }
.payment-secret-clear, .payment-toggle { display: inline-flex; flex-direction: row; align-items: center; justify-content: flex-start; gap: 8px; min-height: 30px; font-size: 13px; }
.payment-secret-clear { color: #956565; font-size: 12px; }
.payment-secret-clear input, .payment-toggle input { width: 17px; height: 17px; padding: 0; margin: 0; accent-color: var(--blue); }
.payment-config-advanced { padding: 16px 18px; border: 1px solid var(--border); border-radius: 6px; }
.payment-config-advanced summary { color: var(--text); font-size: 14px; font-weight: 600; cursor: pointer; }
.payment-config-advanced[open] summary { margin-bottom: 14px; }
@media (max-width: 900px) { .payment-config-list { grid-template-columns: 1fr; } }
@media (max-width: 620px) { .payment-config-toolbar, .payment-config-delete { align-items: flex-start; flex-direction: column; gap: 14px; } .payment-config-secrets { padding: 14px; } .payment-config-card dl > div { grid-template-columns: 95px minmax(0, 1fr); } }
.home-download-editor { gap: 18px; }
.home-download-editor .section-title { margin-bottom: 0; }
.home-download-editor .section-title > span { color: var(--muted); font-size: 11px; }
.home-download-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.home-download-admin-card { display: grid; gap: 14px; min-width: 0; padding: 18px; border: 1px solid #d8e2ee; border-radius: 6px; background: #f8fafc; }
.home-download-admin-card .form-grid.two { grid-template-columns: 1fr; gap: 14px; }
.home-download-admin-head { display: flex; align-items: center; gap: 10px; padding-bottom: 12px; border-bottom: 1px solid #dfe7f0; }
.home-download-admin-head span { color: var(--blue); font-family: 'DM Mono', monospace; font-size: 12px; }
.home-download-admin-head strong { color: var(--text); font-size: 15px; }
.home-release-summary { display: grid; gap: 6px; margin: 0; min-width: 0; }
.home-release-summary dt { margin-top: 8px; color: var(--muted); font-size: 12px; }
.home-release-summary dd { margin: 0; color: var(--text); font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
.home-release-manager { margin-top: 32px; }
.home-banner-editor { margin-top: 18px; }
.download-edition-filter { display: flex; align-items: center; gap: 10px; }
.download-edition-filter select { min-width: 150px; }
.release-classification-hint { padding: 12px 16px; border: 1px solid var(--border); border-radius: 5px; background: var(--panel); }
label { display: flex; flex-direction: column; gap: 8px; color: #526278; font-size: 12px; }
input, textarea { width: 100%; border: 1px solid #ced8e5; border-radius: 4px; outline: 0; background: #fff; color: var(--text); font-size: 13px; }
input { height: 42px; padding: 0 12px; }
textarea { min-height: 82px; padding: 11px 12px; resize: vertical; line-height: 1.65; }
select { width: 100%; height: 42px; padding: 0 12px; border: 1px solid #ced8e5; border-radius: 4px; outline: 0; background: #fff; color: var(--text); font-size: 13px; cursor: pointer; }
input:focus, textarea:focus, select:focus { border-color: #6ba5ef; box-shadow: 0 0 0 3px rgba(23,111,229,.1); }
.form-grid { display: grid; gap: 16px; }
.form-grid.two { grid-template-columns: repeat(2, 1fr); }
.form-grid.three { grid-template-columns: repeat(3, 1fr); }
.form-grid.four { grid-template-columns: 1fr 1fr 1.2fr .8fr; }
.form-grid.three > .choice-field:has(.iocp-products) { grid-column: 1 / -1; }
.product-icon-editor { min-width: 0; display: grid; gap: 9px; color: #526278; font-size: 12px; }
.product-icon-preview { width: 100%; min-height: 84px; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--border); border-radius: 5px; background: #f3f7fb; }
.product-icon-preview img { width: 100%; height: 84px; object-fit: contain; }
.product-icon-preview strong { color: var(--blue); font-size: 30px; font-weight: 500; line-height: 1; }
.product-icon-actions { display: flex; align-items: center; gap: 8px; }
.product-icon-actions > .admin-btn { position: relative; min-height: 34px; flex: 1; }
.product-icon-actions > .admin-btn input { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; opacity: 0; cursor: pointer; }
.product-icon-actions .icon-btn { width: 34px; height: 34px; }
.check-field { justify-content: center; flex-direction: row; align-items: center; min-height: 42px; margin-top: 20px; border: 1px solid #ced8e5; border-radius: 4px; }
.check-field input { width: 16px; height: 16px; margin: 0; }
.record-list { display: grid; gap: 16px; }
.grid-records { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.admin-record { display: grid; gap: 18px; padding: 24px; }
.record-head { min-height: 38px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.record-head > span, .record-head div > span { color: #8191a5; font-family: 'DM Mono', monospace; font-size: 10px; }
.record-head div { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.record-head div strong { overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.case-editor { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 24px; }
.case-cover { display: flex; flex-direction: column; gap: 12px; }
.case-cover > img, .case-cover > div { width: 100%; aspect-ratio: 16 / 10; display: grid; place-items: center; border: 1px solid var(--border); background: #edf2f7; object-fit: cover; }
.case-cover > div svg { width: 32px; height: 32px; color: #9aabba; }
.case-editor > div:last-child { display: grid; gap: 16px; }
.screenshot-upload { display: grid; gap: 13px; padding: 14px; border: 1px solid var(--border); border-radius: 5px; background: #f8fafc; }
.screenshot-upload-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.screenshot-upload-head > div { display: grid; gap: 4px; }
.screenshot-upload-head span { color: #526278; font-size: 12px; }
.screenshot-upload-head small { color: var(--muted); font-size: 11px; }
.screenshot-upload-actions { display: flex !important; align-items: center; justify-content: flex-end; gap: 10px; }
.screenshot-upload-count { color: var(--blue) !important; font-size: 11px !important; white-space: nowrap; }
.screenshot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 10px; }
.screenshot-thumb { position: relative; min-width: 0; aspect-ratio: 16 / 10; overflow: hidden; margin: 0; border: 1px solid var(--border); border-radius: 4px; background: #edf2f7; }
.screenshot-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.screenshot-thumb .icon-btn { position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; border-color: rgba(255,255,255,.8); background: rgba(255,255,255,.92); }
.screenshot-thumb .icon-btn svg { width: 15px; height: 15px; }
.screenshot-empty { padding: 15px; border: 1px dashed #c5d1df; border-radius: 4px; color: var(--muted); font-size: 12px; text-align: center; }

.upload-zone { min-height: 250px; display: grid; place-content: center; justify-items: center; gap: 12px; border: 1px dashed #9fb4cc; border-radius: 6px; background: #fff; cursor: pointer; }
.upload-zone:hover { border-color: var(--blue); background: #f8fbff; }
.upload-zone svg { width: 34px; height: 34px; color: var(--blue); }
.upload-zone strong { color: var(--text); font-size: 16px; }
.upload-zone span { color: var(--muted); font-size: 11px; }
.uploaded-list { display: grid; gap: 10px; margin-top: 20px; }
.uploaded-list article { display: grid; grid-template-columns: 80px 1fr 36px; align-items: center; gap: 15px; min-height: 92px; padding: 10px; border: 1px solid var(--border); background: #fff; }
.uploaded-list img { width: 80px; height: 70px; object-fit: cover; }
.uploaded-list article > div { min-width: 0; display: grid; gap: 7px; }
.uploaded-list strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.uploaded-list input { height: 34px; color: var(--muted); font-family: 'DM Mono', monospace; font-size: 10px; }

.log-table { overflow: hidden; border: 1px solid var(--border); border-radius: 6px; background: #fff; }
.log-head, .log-row.full { display: grid; grid-template-columns: .8fr 1.1fr 1fr .8fr 1.3fr; align-items: center; gap: 18px; min-height: 50px; padding: 0 18px; }
.log-head { border-bottom: 1px solid var(--border); background: #f7f9fc; color: #75869a; font-size: 11px; font-weight: 600; }
.log-row { border-bottom: 1px solid #e7ecf2; }
.log-row:last-child { border-bottom: 0; }
.log-row.full span, .log-row.full strong, .log-row.full small, .log-row.full time { min-width: 0; overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.log-row.full strong { color: var(--blue); }
.log-row.full small, .log-row.full time { color: var(--muted); }
.log-table.compact { border: 0; border-top: 1px solid var(--border); border-radius: 0; }
.log-table.compact .log-row { display: grid; grid-template-columns: .7fr 1fr 1fr 1.3fr; align-items: center; gap: 15px; min-height: 48px; }
.log-table.compact span, .log-table.compact strong, .log-table.compact small, .log-table.compact time { font-size: 11px; }
.log-table.compact strong { color: var(--blue); }
.log-table.compact small, .log-table.compact time { color: var(--muted); }
.empty-state { margin: 0; padding: 28px; color: var(--muted); font-size: 12px; text-align: center; }

.log-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.log-search { flex: 0 1 420px; flex-direction: row; align-items: center; gap: 10px; height: 42px; padding: 0 14px; border: 1px solid #ced8e5; border-radius: 4px; background: #fff; }
.log-search svg { flex: 0 0 auto; width: 16px; height: 16px; color: #93a3b6; }
.log-search input { height: 40px; padding: 0; border: 0; background: transparent; }
.log-search input:focus { box-shadow: none; }
.log-count { margin-left: auto; color: var(--muted); font-size: 12px; }
.log-manage .log-head, .log-manage .log-row { grid-template-columns: 130px 125px 110px minmax(0, 1fr) 190px; }
.log-manage .log-row.full { min-height: 62px; padding: 8px 18px; }
.announcement-manage .log-head, .announcement-manage .log-row { grid-template-columns: 130px 125px 110px minmax(0, 1fr) 190px; }
.announcement-manage .log-row.full { min-height: 62px; padding: 8px 18px; }
.announcement-form { max-width: 1100px; }
.checkbox-field > label { display: flex; align-items: center; gap: 8px; min-height: 40px; color: var(--text); font-size: 12px; font-weight: 400; }
.checkbox-field input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--blue); }
.log-type { display: inline-flex; align-items: center; justify-content: center; width: fit-content; max-width: 100%; min-height: 26px; padding: 0 10px; border-radius: 999px; background: #eef2f7; color: #4c5f78; font-size: 11px; }
.log-type.type-1 { background: #e9f2ff; color: #176fe5; }
.log-type.type-2 { background: #fdecec; color: #c23b42; }
.log-type.type-3 { background: #e8f7f1; color: #17805c; }
.log-edition { display: inline-flex; align-items: center; justify-content: center; width: fit-content; max-width: 100%; min-height: 26px; padding: 0 9px; border-radius: 999px; background: #eef2f7; color: #4c5f78; font-size: 11px; white-space: nowrap; }
.log-edition.edition-42 { background: #e9f2ff; color: #176fe5; }
.log-edition.edition-922 { background: #fff4df; color: #a66308; }
.log-edition.edition-preview { background: #f1eaff; color: #7448b5; }
.log-edition-filter { width: 145px; height: 42px; }
.download-list-head, .download-list-row { display: grid; grid-template-columns: 125px minmax(180px, 1fr) minmax(170px, 1fr) 120px 190px; align-items: center; gap: 18px; min-height: 58px; padding: 0 18px; }
.download-list-head { border-bottom: 1px solid var(--border); background: #f7f9fc; color: #75869a; font-size: 11px; font-weight: 600; }
.download-list-row { border-bottom: 1px solid #e7ecf2; }
.download-list-row:last-of-type { border-bottom: 0; }
.download-list-row > time, .download-title-cell { color: var(--muted); font-size: 12px; }
.download-title-cell { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.download-form { max-width: 1100px; }
.download-choice-field { min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.download-choice-control { display: grid; grid-template-columns: minmax(0, 1fr) 36px 36px; align-items: center; gap: 8px; }
.download-choice-control select { min-width: 0; text-overflow: ellipsis; }
.ai-choice-field { display: grid; align-content: start; gap: 8px; min-width: 0; }
.ai-choice-control { display: grid; grid-template-columns: minmax(0, 1fr) 36px; align-items: center; gap: 8px; }
.ai-choice-control select { min-width: 0; text-overflow: ellipsis; }
.ai-choice-add { display: grid; gap: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.ai-choice-add .heading-actions { justify-content: flex-end; flex-wrap: wrap; }
.ai-choice-manager { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; }
.ai-choice-manager > .form-error { grid-column: 1 / -1; }
.ai-choice-group { min-width: 0; }
.ai-choice-group h3 { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0 0 22px; font-size: 16px; }
.ai-choice-group h3 small { color: var(--muted); font-size: 12px; font-weight: 400; white-space: nowrap; }
.ai-choice-entry { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 12px; }
.ai-choice-list { display: grid; gap: 0; padding: 0; margin: 24px 0 0; list-style: none; }
.ai-choice-list li { display: flex; align-items: center; justify-content: space-between; min-width: 0; gap: 12px; min-height: 54px; border-bottom: 1px solid var(--border); }
.ai-choice-list li > span { min-width: 0; overflow-wrap: anywhere; font-size: 13px; }
@media (max-width: 760px) { .ai-choice-manager { grid-template-columns: minmax(0, 1fr); } }
.download-default-choice.is-default { border-color: #b5cff3; background: #edf5ff; color: var(--blue); opacity: 1; }
.download-default-choice.is-default svg { fill: currentColor; }
.download-choice-add { min-width: 0; padding: 12px 0 0; border-top: 1px solid var(--border); }
.download-choice-add-actions { display: flex; justify-content: flex-end; gap: 8px; }
.download-log-editor { min-width: 0; margin: 6px 0 24px; padding-top: 24px; border-top: 1px solid var(--border); }
.download-log-editor h4 { margin: 0 0 18px; color: var(--text); font-size: 16px; }
.download-log-editor h4 small { margin-left: 8px; color: var(--muted); font-size: 12px; font-weight: 400; }
.download-log-editor.is-dragging { border-top-color: var(--blue); outline: 2px dashed var(--blue); outline-offset: 8px; }
.download-log-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.download-log-heading h4 { margin: 0; }
.download-log-upload-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.download-log-formats { color: var(--muted); font-size: 11px; }
.download-manual-status { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 18px; padding: 14px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); color: var(--blue); }
.download-manual-icon { display: flex; width: 20px; height: 20px; flex-shrink: 0; margin-top: 2px; }
.download-manual-icon > svg { width: 100%; height: 100%; }
.download-manual-status > div { display: flex; flex: 1; min-width: 0; flex-direction: column; gap: 6px; color: var(--text); font-size: 12px; overflow-wrap: anywhere; }
.download-manual-status strong { font-weight: 600; }
.download-manual-status span, .download-manual-status small { color: var(--muted); }
.download-manual-status.has-error, .download-manual-status.has-error span { color: var(--danger); }
.download-manual-status > .icon-btn { flex-shrink: 0; }
.download-log-file-status { display: flex; align-items: flex-start; gap: 8px; margin: 0 0 18px; color: var(--muted); font-size: 12px; }
.download-log-file-status svg { width: 16px; height: 16px; flex-shrink: 0; }
.download-log-file-status span { min-width: 0; overflow-wrap: anywhere; }
.download-log-replace { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; padding: 12px 14px; border-left: 3px solid var(--blue); background: var(--surface); }
.download-log-replace p { flex: 1 1 260px; min-width: 0; margin: 0; color: var(--text); font-size: 12px; line-height: 1.7; overflow-wrap: anywhere; }
.download-log-replace > div { display: flex; flex-wrap: wrap; gap: 8px; }
.download-log-editor > .form-grid { margin-bottom: 20px; }
.download-log-editor textarea { min-height: 190px; }
.download-log-status { display: flex; align-items: center; gap: 12px; min-height: 42px; color: var(--muted); font-size: 13px; }
.log-title-cell { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.log-title-cell strong { color: var(--text); font-size: 13px; }
.log-title-cell small { color: var(--muted); font-size: 11px; }
.row-actions { display: flex; justify-content: flex-end; gap: 8px; }
.security-list-head, .security-list-row { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(90px, 140px) 110px 80px 170px; align-items: center; gap: 18px; padding: 16px 18px; }
.security-list-head { background: #f7f9fc; color: var(--muted); font-size: 11px; font-weight: 600; border-bottom: 1px solid var(--border); }
.security-list-row { min-height: 82px; border-bottom: 1px solid var(--border); font-size: 12px; color: var(--muted); }
.security-list-row:last-of-type { border-bottom: 0; }
.security-list-row:hover { background: #f9fbfe; }
.security-title-cell { display: flex; align-items: center; gap: 14px; min-width: 0; }
.security-delete-confirm { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: 14px 18px 0; padding: 12px 14px; border: 1px solid #f0c4c4; border-radius: 6px; background: #fff7f7; color: #8f3030; font-size: 12px; }
.security-delete-confirm > div { display: flex; flex: 0 0 auto; gap: 8px; }
.admin-btn.danger { border-color: #efb1b1; background: #fff5f5; color: var(--danger); }
.admin-btn.danger:hover { border-color: #df8585; background: #ffeaea; }
.security-title-cell .log-title-cell { min-width: 0; }
.security-title-cell .log-title-cell small { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.security-list-icon { width: 42px; height: 42px; flex: 0 0 42px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 9px; background: #f3f7fc; color: var(--blue); font-size: 22px; overflow: hidden; }
.security-list-icon img { width: 100%; height: 100%; object-fit: contain; }
.security-display-thumb { width: 72px; height: 48px; flex-basis: 72px; }
.security-display-editor { display: grid; gap: 12px; }
.security-display-editor > span { color: var(--muted); font-size: 12px; font-weight: 600; }
.security-display-preview { width: 240px; max-width: 100%; aspect-ratio: 3 / 2; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--border); border-radius: 12px; background: var(--admin-bg); color: var(--muted); font-size: 12px; }
.security-display-preview img { width: 100%; height: 100%; object-fit: contain; }
.security-display-editor .heading-actions > .admin-btn, .security-definition-form .product-icon-actions > .admin-btn { display: inline-flex; }
.security-version { overflow-wrap: anywhere; }
.security-download-state.ready { color: #17805c; }
.security-form-icon { width: 180px; max-width: 100%; }
.security-toolbar { flex-wrap: wrap; justify-content: space-between; gap: 14px; }
.security-tabs { display: flex; gap: 20px; }
.security-tabs button { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 2px; border: 0; border-bottom: 2px solid transparent; color: var(--muted); background: none; font: inherit; cursor: pointer; }
.security-tabs button.active { border-bottom-color: var(--blue); color: var(--blue); }
.security-tabs button span { color: var(--muted); font-size: 11px; }
.security-toolbar select { max-width: 260px; padding: 9px 12px; border: 1px solid var(--border); border-radius: 4px; background: var(--surface, #fff); color: var(--text); }
.security-product-head, .security-product-row { display: grid; grid-template-columns: minmax(220px, 1fr) 110px 240px; align-items: center; gap: 18px; padding: 16px 18px; }
.security-product-head, .manual-list-head { background: #f7f9fc; color: var(--muted); font-size: 11px; }
.security-product-row { min-height: 82px; border-top: 1px solid var(--border); color: var(--muted); font-size: 12px; }
.manual-upload-form { max-width: 900px; }
.manual-upload-form > button[type="submit"] { justify-self: end; min-width: 128px; }
.manual-manage > .view-heading .heading-actions { align-items: center; flex-wrap: wrap; }
.manual-manage > .view-heading .heading-actions .admin-btn { min-width: 110px; white-space: nowrap; }
#admin-manual-theme-slot { min-width: 126px; }
.admin-page #admin-manual-theme-slot .site-theme-switcher { position: static; margin: 0; box-shadow: none; padding: 3px; }
@media (max-width: 360px) { .manual-upload-form select { padding: 0 6px; font-size: 12px; } }
.manual-file-field { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; min-height: 84px; padding: 16px; border: 1px dashed var(--border); border-radius: 4px; color: var(--muted); font-size: 12px; transition: border-color .15s, background-color .15s; }
.manual-file-field.is-dragging { border-color: var(--blue); background: var(--blue-soft); }
.manual-file-field.is-disabled { opacity: .6; cursor: not-allowed; }
.manual-file-field > span { overflow-wrap: anywhere; min-width: 0; }
.manual-progress { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; color: var(--blue); font-size: 13px; min-height: 40px; }
.manual-progress svg { width: 18px; height: 18px; }
.manual-progress .spin { animation: admin-spin 1s linear infinite; }
.manual-progress progress { width: 200px; max-width: 100%; height: 6px; accent-color: var(--blue); }
.manual-job-error { padding: 12px 16px; border-left: 3px solid var(--danger); background: #fff7f7; color: var(--danger); font-size: 12px; overflow-wrap: anywhere; }
.manual-job-error p { margin-bottom: 0; white-space: pre-wrap; }
.manual-history-heading { margin-top: 30px; }
.manual-list-head, .manual-list-row { display: grid; grid-template-columns: minmax(200px, 1fr) 100px 110px 70px 90px 140px; align-items: center; gap: 16px; padding: 16px 18px; }
.manual-list-row { border-top: 1px solid var(--border); color: var(--muted); font-size: 12px; }
.manual-list-row .log-title-cell { min-width: 0; overflow-wrap: anywhere; }
.manual-history .row-actions a { display: inline-flex; align-items: center; gap: 5px; color: var(--blue); text-decoration: none; }
.manual-history .row-actions svg { width: 15px; height: 15px; }
html[data-theme="dark"] :is(.security-product-head, .manual-list-head, .security-toolbar select) { background: #203650; }
html[data-theme="dark"] .manual-job-error { background: #392529; }
@media (max-width: 1200px) {
  .manual-list-head { display: none; }
  .manual-list-row { grid-template-columns: minmax(0, 1fr) auto; gap: 12px; }
  .manual-list-row .log-title-cell, .manual-list-row .row-actions { grid-column: 1 / -1; }
  .manual-list-row .row-actions { justify-content: flex-start; }
}
@media (max-width: 1000px) {
  .security-product-head, .manual-list-head { display: none; }
  .security-product-row, .manual-list-row { grid-template-columns: minmax(0, 1fr) auto; gap: 12px; }
  .security-product-row .security-title-cell, .manual-list-row .log-title-cell { grid-column: 1 / -1; }
  .security-product-row .row-actions { grid-column: 1 / -1; justify-content: flex-start; flex-wrap: wrap; }
}
html[data-theme="dark"] :is(.security-list-head, .security-list-icon) { background: #203650; color: #b5c9e3; }
html[data-theme="dark"] .security-list-row:hover { background: #192d46; }
html[data-theme="dark"] .security-download-state.ready { color: #69d8a3; }
@media (max-width: 1200px) {
  .security-list-head { display: none; }
  .security-list-row { grid-template-columns: 1fr auto; gap: 10px 16px; }
  .security-title-cell, .security-list-row .row-actions { grid-column: 1 / -1; }
  .security-list-row .row-actions { justify-content: flex-start; }
}
.protection-list-head, .protection-list-row { display: grid; grid-template-columns: minmax(260px, 1.8fr) 1fr .9fr 110px 190px; align-items: center; gap: 18px; min-height: 64px; padding: 0 18px; }
.protection-list-head { border-bottom: 1px solid var(--border); background: #f7f9fc; color: #75869a; font-size: 11px; font-weight: 600; }
.protection-list-row { border-bottom: 1px solid #e7ecf2; color: #4d5d72; font-size: 12px; }
.protection-list-row:last-of-type { border-bottom: 0; }
.protection-title-cell { min-width: 0; display: flex; align-items: center; gap: 12px; }
.protection-title-cell > div:last-child { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.protection-title-cell strong { overflow: hidden; color: var(--text); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.protection-title-cell small { overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.protection-list-cover { width: 62px; height: 42px; display: grid; flex: 0 0 auto; place-items: center; overflow: hidden; border: 1px solid var(--border); border-radius: 4px; background: #edf2f7; }
.protection-list-cover img { width: 100%; height: 100%; object-fit: cover; }
.protection-list-cover svg { width: 18px; height: 18px; color: #9aabba; }
.protection-list-row > time { color: var(--muted); white-space: nowrap; }
.protection-form { max-width: 1100px; }
.case-media-editor { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 24px; }
.case-media-editor .case-cover { display: grid; align-content: start; gap: 9px; color: #526278; font-size: 12px; }
.case-media-editor .case-cover > img, .case-media-editor .case-cover > div { width: 100%; aspect-ratio: 16 / 10; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--border); border-radius: 4px; background: #edf2f7; object-fit: cover; }
.case-media-editor .case-cover > img { display: block; }
.case-media-editor .case-cover > div svg { width: 32px; height: 32px; color: #9aabba; }
.row-actions button { min-height: 34px; display: inline-flex; align-items: center; gap: 6px; padding: 0 13px; border: 1px solid var(--border); border-radius: 5px; background: #fff; color: #3d5069; font-size: 12px; cursor: pointer; }
.row-actions button svg { width: 15px; height: 15px; }
.row-actions button:hover { border-color: #aac2e1; color: var(--blue); }
.row-actions button.approve { border-color: #b6e2d1; color: #17805c; background: #f2fbf7; }
.row-actions button.approve:hover { border-color: #58c89c; background: #e8f7f1; color: #126b4c; }
.row-actions button.danger:hover { border-color: #efb1b1; background: #fff5f5; color: var(--danger); }
.log-pager { display: flex; align-items: center; justify-content: center; gap: 18px; margin-top: 18px; color: var(--muted); font-size: 12px; }
.log-pager .admin-btn { min-height: 36px; }

.commerce-metrics { margin-bottom: 18px; }
.commerce-metrics article strong { font-size: 23px; white-space: nowrap; }
.data-record { gap: 0; padding: 0; overflow: hidden; }
.data-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 18px; border-bottom: 1px solid var(--border); background: #fbfcfe; }
.data-search { flex: 1 1 330px; flex-direction: row; align-items: center; gap: 10px; height: 40px; padding: 0 12px; border: 1px solid #ced8e5; border-radius: 4px; background: #fff; }
.data-search svg { flex: 0 0 auto; width: 16px; height: 16px; color: #93a3b6; }
.data-search input { height: 38px; padding: 0; border: 0; background: transparent; }
.data-search input:focus { box-shadow: none; }
.order-range-picker { flex: 0 1 auto; min-width: 250px; }
.order-range-picker select { min-width: 145px; height: 38px; padding: 0 28px 0 0; border: 0; background-color: transparent; font-weight: 600; color: var(--text); }
.order-range-picker select:focus { box-shadow: none; }
.order-range-dates { display: flex; align-items: center; gap: 8px; }
.order-range-dates label { display: flex; align-items: center; gap: 6px; height: 40px; padding: 0 10px; border: 1px solid #ced8e5; border-radius: 4px; background: #fff; }
.order-range-dates label span { color: var(--muted); font-size: 12px; white-space: nowrap; }
.order-range-dates input { height: 36px; padding: 0; border: 0; background: transparent; color: var(--text); font-size: 12px; }
.order-range-dates input:focus { box-shadow: none; }
.range-separator { color: var(--muted); font-size: 12px; }
.data-toolbar select { width: auto; min-width: 145px; height: 40px; }
.data-count { margin-left: auto; color: var(--muted); font-size: 12px; }
.data-note { margin: 0; padding: 12px 18px 0; }
.admin-table-scroll { overflow-x: auto; }
.admin-data-table { min-width: 980px; }
.admin-data-head, .admin-data-row { display: grid; align-items: center; gap: 15px; padding: 0 18px; }
.admin-data-head { min-height: 46px; border-bottom: 1px solid var(--border); background: #f7f9fc; color: #75869a; font-size: 11px; font-weight: 600; }
.admin-data-row { min-height: 64px; border-bottom: 1px solid #e7ecf2; color: #4d5d72; font-size: 12px; }
.admin-data-row:last-child { border-bottom: 0; }
.admin-data-row > * { min-width: 0; }
.admin-data-row strong { color: var(--text); font-size: 12px; }
.admin-data-row small { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-data-row time { color: var(--muted); white-space: nowrap; }
.order-table .admin-data-head, .order-table .admin-data-row { grid-template-columns: 1.4fr 1.2fr .8fr .9fr .9fr 1fr; }
.balance-table .admin-data-head, .balance-table .admin-data-row { grid-template-columns: 1.2fr 1fr 1fr 1fr .7fr 1.1fr; }
.water-table .admin-data-head, .water-table .admin-data-row { grid-template-columns: 1.3fr .9fr 1fr 1fr 1.6fr 1fr; }
.card-table .admin-data-head, .card-table .admin-data-row { grid-template-columns: 1.7fr 1.3fr 1.1fr 1.2fr .9fr 1fr 1fr 44px; }
.mono-cell { font-family: 'DM Mono', monospace; letter-spacing: 0; }
.cell-ellipsis { max-width: 220px; }
.status-pill { display: inline-flex; align-items: center; width: fit-content; min-height: 24px; padding: 0 9px; border-radius: 999px; background: #eef2f7; color: #607187; font-size: 11px; font-style: normal; white-space: nowrap; }
.status-pill.good { background: #e8f7f1; color: #17805c; }
.status-pill.warn { background: #fff4df; color: #a7670d; }
.status-pill.bad { background: #fdecec; color: #c23b42; }
.status-pill.muted { background: #eef2f7; color: #78879a; }
.announcement-image-editor { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; min-width: 0; }
.announcement-image-editor > span { color: var(--muted); font-size: 12px; font-weight: 600; }
.announcement-image-editor label.admin-btn { flex-direction: row; }
.announcement-image-editor .is-disabled { opacity: .55; cursor: not-allowed; }
.announcement-image-preview { display: block; width: min(100%, 560px); height: auto; max-height: 260px; object-fit: contain; border: 1px solid var(--border); border-radius: 6px; }
.admin-data-row .amount-up { color: #17805c; }
.admin-data-row .amount-down { color: #c23b42; }
.data-pager { display: flex; align-items: center; justify-content: center; gap: 18px; padding: 18px; border-top: 1px solid var(--border); color: var(--muted); font-size: 12px; }
.data-pager .admin-btn { min-height: 35px; }
.switch-tabs { display: flex; gap: 5px; padding: 18px 18px 0; border-bottom: 1px solid var(--border); }
.switch-tabs button { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 16px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); font-size: 13px; cursor: pointer; }
.switch-tabs button.active { border-bottom-color: var(--blue); color: var(--blue); font-weight: 700; }
.switch-tabs button:hover { color: var(--blue); }
.data-panel-block { min-width: 0; }

.admin-toast { position: fixed; z-index: 100; right: 24px; bottom: 24px; min-width: 270px; min-height: 52px; display: flex; align-items: center; gap: 11px; padding: 0 16px; border: 1px solid var(--border); border-radius: 5px; background: #fff; box-shadow: 0 15px 45px rgba(26,42,65,.18); font-size: 12px; }
.admin-toast.success svg { color: var(--green); }
.admin-toast.error svg { color: var(--danger); }
.toast-enter-active, .toast-leave-active { transition: opacity .2s, transform .2s; }
.toast-enter-from, .toast-leave-to { opacity: 0; transform: translateY(10px); }

@media (max-width: 1100px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-records { grid-template-columns: 1fr; }
  .home-download-grid { grid-template-columns: 1fr; }
  .form-grid.four { grid-template-columns: repeat(2, 1fr); }
  .case-editor { grid-template-columns: 220px minmax(0, 1fr); }
  .case-media-editor { grid-template-columns: 220px minmax(0, 1fr); }
}

/* Keep the administration area in the same light visual system. */
html[data-theme="light"] .login-page { background: #f3f7fc; }
html[data-theme="light"] .login-panel { border-color: #d8e2ee; background: #fff; box-shadow: 0 28px 80px rgba(43, 76, 115, .14); }
html[data-theme="light"] .login-brand { border-color: #d8e2ee; }
html[data-theme="light"] .login-copy h1 { color: var(--text); }
html[data-theme="light"] .login-panel label span { color: #5f7087; }
html[data-theme="light"] .login-panel input { border-color: #cbd8e6; background: #fff; color: var(--text); }
html[data-theme="light"] .admin-sidebar { background: #fff; color: var(--text); box-shadow: 8px 0 24px rgba(43, 76, 115, .06); }
html[data-theme="light"] .admin-brand { border-color: #dce5ef; }
html[data-theme="light"] .admin-brand small, html[data-theme="light"] .admin-user small { color: #708096; }
html[data-theme="light"] .admin-sidebar nav button { color: #5f7087; }
html[data-theme="light"] .admin-sidebar nav button:hover { background: #edf4fb; color: #1d5db8; }
html[data-theme="light"] .admin-sidebar nav button.active { background: #e7f0ff; color: #1d5db8; }
html[data-theme="light"] .admin-user { border-color: #dce5ef; }
html[data-theme="light"] .admin-user > span { background: #e7f0ff; color: #1d5db8; }

@media (max-width: 760px) {
  .admin-sidebar { transform: translateX(-100%); transition: transform .22s; }
  .admin-sidebar.open { transform: translateX(0); box-shadow: 18px 0 50px rgba(0,0,0,.22); }
  .admin-workspace { margin-left: 0; }
  .admin-topbar { height: 70px; padding: 0 18px; }
  .mobile-nav-toggle { display: grid; }
  .admin-topbar h1 { font-size: 17px; }
  .admin-topbar .admin-btn span { display: none; }
  .admin-content { width: calc(100% - 30px); padding: 26px 0 50px; }
  .view-heading { align-items: flex-start; flex-direction: column; }
  .view-heading h2 { font-size: 24px; }
  .heading-actions { width: 100%; }
  .heading-actions .admin-btn { flex: 1; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .metric-grid article { min-height: 130px; grid-template-columns: 38px 1fr; padding: 18px; }
  .metric-grid article > div { width: 38px; height: 38px; }
  .dashboard-band { grid-template-columns: 1fr; }
  .dashboard-band > div { min-height: 80px; border-right: 0; border-bottom: 1px solid var(--border); }
  .form-grid.two, .form-grid.three, .form-grid.four { grid-template-columns: 1fr; }
  .check-field { margin-top: 0; }
  .admin-record, .form-section { padding: 18px; }
  .case-editor { grid-template-columns: 1fr; }
  .case-media-editor { grid-template-columns: 1fr; }
  .case-cover { max-width: 320px; }
  .log-head { display: none; }
  .log-row.full { grid-template-columns: 1fr 1fr; gap: 7px 14px; padding: 13px 15px; }
  .log-row.full time { grid-column: 1 / -1; }
  .log-table.compact .log-row { grid-template-columns: 1fr 1fr; padding: 11px 0; }
  .log-table.compact time { grid-column: 1 / -1; }
  .log-toolbar { flex-wrap: wrap; }
  .log-search { flex: 1 1 100%; }
  .log-count { margin-left: 0; }
  .log-manage .log-head, .log-manage .log-row { grid-template-columns: 1fr auto; }
  .log-manage .log-row.full { padding: 13px 15px; }
  .log-manage .log-row.full time { grid-column: auto; }
  .log-manage .log-title-cell, .log-manage .row-actions { grid-column: 1 / -1; }
  .log-manage .row-actions { justify-content: flex-start; }
  .announcement-manage .log-head, .announcement-manage .log-row { grid-template-columns: 1fr auto; }
  .announcement-manage .log-row.full { padding: 13px 15px; }
  .announcement-manage .log-title-cell, .announcement-manage .row-actions { grid-column: 1 / -1; }
  .announcement-manage .row-actions { justify-content: flex-start; }
  .download-list-head { display: none; }
  .download-list-row { grid-template-columns: 1fr auto; gap: 8px 14px; padding: 14px 15px; }
  .download-list-row .log-title-cell, .download-list-row .download-title-cell, .download-list-row .row-actions { grid-column: 1 / -1; }
  .download-list-row .row-actions { justify-content: flex-start; }
  .protection-list-head { display: none; }
  .protection-list-row { grid-template-columns: 1fr auto; gap: 8px 14px; padding: 14px 15px; }
  .protection-list-row .protection-title-cell, .protection-list-row .row-actions { grid-column: 1 / -1; }
  .protection-list-row .row-actions { justify-content: flex-start; }
  .data-toolbar { padding: 14px; }
  .data-toolbar select { flex: 1 1 145px; }
  .order-range-picker { flex: 1 1 100%; }
  .order-range-dates { flex: 1 1 100%; }
  .order-range-dates label { flex: 1 1 0; min-width: 0; }
  .order-range-dates input { min-width: 0; width: 100%; }
  .data-count { width: 100%; margin-left: 0; }
  .data-pager { padding: 14px; }
  .login-panel { padding: 28px 22px; }
  .admin-toast { right: 15px; bottom: 15px; left: 15px; min-width: 0; }
}

/* All save/submit actions share one viewport corner, outside scroll content. */
.site-section-tabs { padding: 0; margin-bottom: 28px; overflow-x: auto; }
.site-section-tabs button { flex-shrink: 0; }
.site-section-tabs svg { width: 17px; height: 17px; }
.hero-library-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; color: var(--muted); font-size: 13px; }
.hero-library-upload { flex-direction: row; }
.hero-library-toolbar label { display: flex; flex-direction: row; align-items: center; gap: 10px; }
.hero-library-toolbar input { width: 80px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); }
.hero-library-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.hero-library-item { min-width: 0; overflow: hidden; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.hero-library-item.selected { border-color: var(--blue); }
.hero-library-preview { aspect-ratio: 3 / 2; overflow: hidden; background: #f4f7fb; }
.hero-library-preview img { display: block; width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; }
.ai-hero-library-view .hero-library-preview { aspect-ratio: 3 / 1; background: #202735; }
.ai-hero-library-view .hero-library-preview img { mix-blend-mode: normal; }
.hero-library-title { display: flex; align-items: center; gap: 10px; padding: 16px 16px 8px; }
.hero-library-title > span { color: var(--muted); font-size: 11px; }
.hero-library-title input { min-width: 0; width: 100%; height: 34px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 4px; background: transparent; color: var(--text); font-size: 13px; }
.hero-library-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 16px 16px; }
.hero-library-actions > label { display: flex; flex-direction: row; align-items: center; gap: 8px; color: var(--text); font-size: 13px; }
.hero-library-actions > label input { width: 17px; height: 17px; min-height: 0; flex-shrink: 0; margin: 0; padding: 0; accent-color: var(--blue); }
.hero-library-actions > div { display: flex; gap: 4px; }
@media (max-width: 1100px) { .hero-library-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 540px) { .hero-library-grid { grid-template-columns: 1fr; } }
.admin-content { padding-bottom: 128px; }
.admin-save-action { position: fixed; z-index: 80; right: max(24px, env(safe-area-inset-right)); bottom: max(24px, env(safe-area-inset-bottom)); min-width: 128px; min-height: 44px; max-width: calc(100vw - 32px); margin: 0; }
.admin-toast { bottom: max(90px, calc(env(safe-area-inset-bottom) + 66px)); }
.admin-page .site-theme-switcher { right: max(176px, calc(env(safe-area-inset-right) + 152px)); bottom: max(24px, env(safe-area-inset-bottom)); }
.admin-page .site-theme-switcher button { min-height: 32px; padding: 6px 10px; }
@media (max-width: 760px) {
  .admin-save-action { right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); }
  .admin-page .site-theme-switcher { right: max(160px, calc(env(safe-area-inset-right) + 144px)); bottom: max(16px, env(safe-area-inset-bottom)); }
  .admin-page .site-theme-switcher button { gap: 4px; padding: 6px 7px; font-size: 11px; }
  .security-delete-confirm { align-items: flex-start; flex-direction: column; margin: 14px 0 0; }
  .security-delete-confirm > div { width: 100%; }
  .security-delete-confirm .admin-btn { flex: 1; }
}
