:root {
  color-scheme: dark;
  --bg: #0b0c10;
  --surface: #13151b;
  --surface-2: #191c24;
  --line: #292d38;
  --text: #f3f4f7;
  --muted: #969cab;
  --accent: #d8ff64;
  --accent-ink: #121600;
  --danger: #ff6b7a;
  --success: #70e1a1;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 1080px; background: var(--bg); color: var(--text); font: 14px/1.5 Inter, "PingFang SC", "Microsoft YaHei", sans-serif; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
.app-shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 24px 18px; background: #0f1116; border-right: 1px solid var(--line); display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 10px 28px; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: var(--accent); color: var(--accent-ink); font-size: 20px; font-weight: 900; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 16px; letter-spacing: .03em; }
.brand small { margin-top: 1px; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .12em; }
nav details summary { display: flex; align-items: center; gap: 9px; padding: 11px 12px; color: #c5c9d2; cursor: pointer; list-style: none; font-weight: 650; }
nav details summary::-webkit-details-marker { display: none; }
.chevron { margin-left: auto; color: var(--muted); transition: transform .2s; }
details[open] .chevron { transform: rotate(180deg); }
.submenu { display: grid; gap: 4px; margin: 4px 0 18px; padding-left: 18px; }
.submenu a { padding: 10px 14px 10px 21px; border-radius: 9px; color: var(--muted); position: relative; }
.submenu a::before { content: ""; position: absolute; left: 7px; top: 50%; width: 5px; height: 5px; margin-top: -2px; border-radius: 50%; background: #3d424f; }
.submenu a:hover { color: var(--text); background: #171a21; }
.submenu a.active { color: var(--accent); background: rgba(216,255,100,.08); }
.submenu a.active::before { background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.sidebar-foot { margin-top: auto; padding: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.status-dot { display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 10px rgba(112,225,161,.6); }
main { min-width: 0; padding: 34px 38px 56px; }
.topbar { display: flex; align-items: end; justify-content: space-between; margin-bottom: 28px; }
.eyebrow { margin: 0 0 4px; color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
h1 { margin: 0; font-size: 30px; letter-spacing: -.03em; }
.topbar p:last-child { margin: 5px 0 0; color: var(--muted); }
.primary { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 17px; border: 0; border-radius: 10px; background: var(--accent); color: var(--accent-ink); font-weight: 800; cursor: pointer; }
.alert { margin-bottom: 18px; padding: 12px 15px; border: 1px solid; border-radius: 10px; }
.alert.success { color: var(--success); border-color: rgba(112,225,161,.35); background: rgba(112,225,161,.08); }
.alert.error { color: var(--danger); border-color: rgba(255,107,122,.35); background: rgba(255,107,122,.08); }
.content-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; align-items: start; }
.content-grid.with-editor { grid-template-columns: minmax(580px, 1fr) 390px; }
.panel { border: 1px solid var(--line); border-radius: 15px; background: var(--surface); box-shadow: 0 15px 45px rgba(0,0,0,.12); overflow: hidden; }
.panel-head { min-height: 65px; padding: 17px 20px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.panel-head h2 { margin: 0; font-size: 16px; }
.panel-head > span, .panel-head div > span { color: var(--muted); font-size: 12px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 11px 15px; background: #111319; color: var(--muted); text-align: left; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
td { padding: 14px 15px; border-top: 1px solid #222630; vertical-align: middle; }
tbody tr:hover { background: rgba(255,255,255,.018); }
td strong, td small { display: block; }
td small { max-width: 230px; margin-top: 3px; overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
td.url { max-width: 330px; overflow: hidden; color: #bbc0cc; text-overflow: ellipsis; white-space: nowrap; }
code { padding: 3px 7px; border: 1px solid #303541; border-radius: 6px; background: #0d0f13; color: #d6d9e0; font-size: 12px; }
.badge { display: inline-flex; padding: 4px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.badge.on { color: var(--success); background: rgba(112,225,161,.1); }
.badge.off { color: var(--muted); background: rgba(150,156,171,.1); }
.actions { white-space: nowrap; }
.actions > * { display: inline-block; margin-right: 10px; }
.actions a, .link-button { color: var(--accent); }
.link-button { padding: 0; border: 0; background: none; cursor: pointer; }
.link-button.danger { color: var(--danger); }
.link-button:disabled { color: #5d626d; cursor: not-allowed; }
.empty { padding: 40px; color: var(--muted); text-align: center; }
.editor { position: sticky; top: 24px; max-height: calc(100vh - 48px); overflow-y: auto; }
.close { font-size: 24px; color: var(--muted); }
.form-stack, .form-grid { padding: 20px; }
.form-stack { display: grid; gap: 15px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.span-2 { grid-column: span 2; }
label { display: grid; gap: 7px; color: #c8ccd5; font-size: 12px; font-weight: 650; }
input, textarea, select { width: 100%; border: 1px solid #333846; border-radius: 9px; outline: none; background: #0e1015; color: var(--text); }
input, select { height: 40px; padding: 0 11px; }
textarea { min-height: 80px; padding: 10px 11px; resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: #7f963d; box-shadow: 0 0 0 3px rgba(216,255,100,.07); }
.switch-row { grid-template-columns: 1fr auto; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #101218; }
.switch-row span strong, .switch-row span small { display: block; }
.switch-row span small { margin-top: 2px; color: var(--muted); font-weight: 400; }
.switch-row input, .mini-check input { width: 17px; height: 17px; accent-color: var(--accent); }
.form-actions { display: flex; align-items: center; justify-content: flex-end; gap: 15px; padding-top: 4px; }
.form-actions > a { color: var(--muted); }
.wide-editor { width: 430px; }
.user-head { gap: 20px; }
.search { display: flex; gap: 8px; width: min(460px, 45%); }
.search button, .inline-config button { border: 1px solid #3b414f; border-radius: 8px; background: #20242d; color: var(--text); cursor: pointer; }
.search button { padding: 0 16px; }
.inline-config { display: flex; align-items: center; gap: 8px; }
.inline-config select { width: 105px; height: 34px; }
.inline-config button { height: 34px; padding: 0 10px; }
.mini-check { display: flex; align-items: center; gap: 5px; white-space: nowrap; font-weight: 500; }
.character-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; padding: 20px; }
.character-card { align-self: start; min-width: 0; overflow: hidden; border: 1px solid #d8dce4; border-radius: 12px; background: #f8f9fb; color: #292d33; box-shadow: 0 4px 14px rgba(0,0,0,.18); transition: transform .18s ease, box-shadow .18s ease; }
.character-card:hover { transform: translateY(-2px); box-shadow: 0 9px 22px rgba(0,0,0,.24); }
.character-cover { position: relative; overflow: hidden; background: #e8ebf0; }
.character-cover::after { content: ""; position: absolute; z-index: 1; right: 0; bottom: 0; left: 0; height: 48%; background: linear-gradient(to top, rgba(0,0,0,.72), transparent); pointer-events: none; }
.character-cover img { display: block; width: 100%; height: auto; }
.character-card.is-disabled .character-cover img { filter: grayscale(.55); opacity: .72; }
.character-card.is-disabled .character-cover-empty { filter: grayscale(.55); opacity: .72; }
.character-cover-empty { display: grid; place-items: center; width: 100%; min-height: 220px; color: #8d939e; background: linear-gradient(145deg, #eef0f4, #dfe3e9); font-weight: 700; }
.character-type-stack { position: absolute; z-index: 2; top: 10px; right: 10px; display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.character-type-stack span { max-width: 150px; overflow: hidden; padding: 4px 8px; border: 1px solid rgba(255,255,255,.55); border-radius: 7px; background: rgba(20,22,27,.72); color: #fff; font-size: 11px; font-weight: 750; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; backdrop-filter: blur(5px); }
.character-identity { position: absolute; z-index: 2; right: 12px; bottom: 10px; left: 12px; display: flex; align-items: baseline; gap: 8px; min-width: 0; color: #fff; text-shadow: 0 1px 5px rgba(0,0,0,.8); }
.character-identity strong { overflow: hidden; font-size: 16px; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.character-identity span { flex: 0 0 auto; color: rgba(255,255,255,.84); font-size: 12px; font-weight: 650; }
.character-card-body { padding: 10px 12px 12px; }
.character-card-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding-top: 9px; border-top: 1px solid #dfe2e8; }
.character-card-actions form { margin: 0; }
.card-button { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 40px; border: 1px solid #bbc2cd; border-radius: 8px; background: #fff; color: #2d3239; font-weight: 800; cursor: pointer; }
.card-button.edit { border-color: #be2f2f; background: #c93232; color: #fff; }
.card-button:hover { filter: brightness(.96); }
.modal-backdrop { position: fixed; z-index: 1000; inset: 0; display: grid; place-items: center; padding: 32px; background: rgba(3,5,9,.76); backdrop-filter: blur(4px); }
.modal-dialog { display: flex; flex-direction: column; width: min(980px, calc(100vw - 64px)); max-height: calc(100vh - 64px); overflow: hidden; border: 1px solid #353a47; border-radius: 16px; background: var(--surface); box-shadow: 0 30px 90px rgba(0,0,0,.6); }
.modal-dialog .panel-head { flex: 0 0 auto; gap: 20px; background: #161920; }
.character-editor-heading { display: flex; align-items: center; gap: 20px; min-width: 0; }
.language-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.language-tabs a { min-width: 44px; padding: 5px 9px; border: 1px solid #3b414f; border-radius: 7px; color: var(--muted); text-align: center; font-size: 11px; font-weight: 750; line-height: 1.2; }
.language-tabs a:hover { border-color: #697181; color: var(--text); }
.language-tabs a.active { border-color: var(--accent); background: rgba(216,255,100,.12); color: var(--accent); }
.modal-dialog .character-form { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; overflow-y: auto; }
.character-form .span-2 { grid-column: 1 / -1; }
.character-form input, .character-form select { height: 36px; }
.editor-detail-row { display: grid; grid-column: 1 / -1; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.editor-detail-row textarea { height: 144px; min-height: 144px; overflow-y: auto; resize: none; }
.media-dialog { width: min(1200px, calc(100vw - 32px)); height: min(920px, calc(100vh - 32px)); max-height: calc(100vh - 32px); }
.media-dialog > .panel-head { min-height: 48px; padding: 10px 20px; }
.media-dialog .character-editor-heading { max-width: calc(100% - 48px); }
.media-dialog .character-editor-heading > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-panels { display: flex; flex: 1; min-height: 0; overflow: hidden; }
.media-panels > .media-browser[hidden] { display: none; }
.media-dialog.is-switching .media-tabs { opacity: .65; pointer-events: none; }
.media-browser { display: flex; flex: 1; flex-direction: column; min-height: 0; overflow: hidden; }
.media-tabs { display: grid; flex: 0 0 auto; grid-template-columns: 1fr 1fr; gap: 10px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.media-tabs a { padding: 9px 16px; border: 1px solid #3b414f; border-radius: 9px; color: var(--muted); text-align: center; font-weight: 800; }
.media-tabs a:hover { border-color: #697181; color: var(--text); }
.media-tabs a.active { border-color: var(--accent); background: rgba(216,255,100,.12); color: var(--accent); }
.media-error { margin: 14px 20px 0; padding: 10px 12px; border: 1px solid rgba(255,107,122,.35); border-radius: 8px; background: rgba(255,107,122,.08); color: var(--danger); }
.media-grid { display: grid; flex: 1; grid-template-columns: repeat(5, minmax(0, 180px)); grid-auto-rows: auto; align-content: start; align-items: start; justify-content: center; gap: 12px; min-height: 0; padding: 16px 20px; overflow: auto; }
.media-asset { position: relative; display: flex; align-self: start; flex-direction: column; width: 100%; max-width: 180px; min-width: 0; min-height: 0; overflow: hidden; border: 1px solid #303541; border-radius: 10px; background: #0e1015; }
.media-asset.is-assigned { border-color: #8fa83f; box-shadow: inset 0 0 0 1px rgba(216,255,100,.18); }
.media-preview { position: relative; display: grid; flex: 0 0 auto; place-items: center; min-height: 0; overflow: hidden; background: #090b0f; }
.media-preview img, .media-preview video { display: block; width: 100%; height: auto; object-fit: contain; }
.media-preview img { object-position: center; }
.media-used-mark { position: absolute; z-index: 2; top: 8px; left: 8px; padding: 4px 7px; border-radius: 6px; background: rgba(216,255,100,.92); color: var(--accent-ink); font-size: 10px; font-weight: 900; box-shadow: 0 2px 8px rgba(0,0,0,.35); }
.media-missing { color: var(--muted); font-size: 12px; }
.media-asset:has(.media-missing) .media-preview { min-height: 220px; }
.media-asset-body { padding: 9px 10px 10px; }
.media-asset:has(.media-preview > :is(img, video)) .media-asset-body { flex: 0 0 auto; border-top: 1px solid #232833; background: #0e1015; }
.media-asset:has(.media-preview > :is(img, video)) .media-asset-body small { margin: 0; user-select: text; cursor: text; }
.media-asset-body strong, .media-asset-body small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-asset-body strong { font-size: 12px; }
.media-asset-body small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.media-meta { display: flex; align-items: center; gap: 5px; min-height: 21px; margin-top: 7px; }
.media-badge { padding: 2px 5px; border-radius: 5px; background: #282d38; color: #bec4cf; font-size: 9px; font-weight: 800; }
.media-badge.assigned { background: rgba(216,255,100,.14); color: var(--accent); }
.media-badge.disabled { background: rgba(255,107,122,.12); color: var(--danger); }
.media-size { margin-left: auto; color: var(--muted); font-size: 9px; }
.media-empty { display: grid; flex: 1; place-items: center; color: var(--muted); }
.media-pagination { display: grid; flex: 0 0 auto; grid-template-columns: 80px 1fr 80px; align-items: center; padding: 13px 20px; border-top: 1px solid var(--line); text-align: center; }
.media-pagination a { color: var(--accent); font-weight: 800; }
.media-page-jump { display: flex; align-items: center; justify-content: center; margin: 0; }
.media-page-jump label { display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--text); font-size: 13px; font-weight: 600; }
.media-page-jump input[type=number] { width: 58px; height: 28px; padding: 0 5px; border: 1px solid #48505f; border-radius: 6px; background: #0e1015; color: var(--text); text-align: center; font: inherit; }
.media-page-jump input[type=number]:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 2px rgba(216,255,100,.12); }
.media-pagination .disabled { color: #555b68; }
@media (max-width: 1280px) {
  .content-grid.with-editor { grid-template-columns: minmax(520px, 1fr) 370px; }
  main { padding-left: 24px; padding-right: 24px; }
  .character-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
}
.editable-row { cursor: pointer; }
.editable-row:hover > td { background: rgba(216,255,100,.12); }
.editable-row:hover > td:first-child { box-shadow: inset 4px 0 0 rgba(216,255,100,.9); }
.editable-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.badge.test { color: #e1b86c; background: rgba(225,184,108,.1); }
.entity-dialog { width: min(620px, calc(100vw - 64px)); }
.entity-form { overflow-y: auto; }
.entity-form input[readonly] { color: var(--muted); background: #111319; cursor: default; }
.entity-secondary-action { display: flex; justify-content: flex-end; padding: 0 20px 20px; }
.danger-button { min-height: 36px; padding: 0 14px; border: 1px solid rgba(255,107,122,.45); border-radius: 8px; background: rgba(255,107,122,.08); color: var(--danger); font-weight: 750; cursor: pointer; }
.danger-button:hover { background: rgba(255,107,122,.14); }
.statistics-page { display: grid; gap: 18px; }
.statistics-filter { display: grid; grid-template-columns: minmax(240px, 1fr) minmax(240px, 1fr) auto; align-items: end; gap: 14px; padding: 18px 20px; }
.statistics-filter .primary { min-width: 88px; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.metric-card { position: relative; min-height: 118px; padding: 19px 20px; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: linear-gradient(145deg, #171a21, #111319); box-shadow: 0 12px 30px rgba(0,0,0,.12); }
.metric-card::after { content: ""; position: absolute; right: -24px; bottom: -36px; width: 105px; height: 105px; border-radius: 50%; background: rgba(216,255,100,.045); }
.metric-card span { display: block; color: var(--muted); font-size: 12px; }
.metric-card strong { display: inline-block; margin-top: 10px; font-size: 32px; line-height: 1; letter-spacing: -.04em; }
.metric-card small { margin-left: 6px; color: var(--muted); }
.statistics-chart-panel { min-width: 0; }
.online-chart-wrap { position: relative; height: 390px; padding: 18px 18px 10px; }
#online-chart { display: block; width: 100%; height: 100%; }
.chart-tooltip { position: absolute; z-index: 2; min-width: 112px; padding: 7px 9px; transform: translate(-50%, calc(-100% - 10px)); border: 1px solid #3b414f; border-radius: 7px; background: rgba(13,15,19,.94); color: var(--text); text-align: center; font-size: 11px; pointer-events: none; box-shadow: 0 7px 22px rgba(0,0,0,.4); }
.statistics-empty { display: grid; min-height: 300px; place-items: center; color: var(--muted); }
.statistics-note { padding: 11px 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.statistics-table th:not(:first-child), .statistics-table td:not(:first-child) { text-align: right; }
.statistics-table .stat-number { font-size: 17px; font-weight: 750; font-variant-numeric: tabular-nums; }
.operations-panel .panel-head > div { min-width: 0; }
.operations-panel .panel-head > div span { display: block; margin-top: 3px; }
.operation-stat-row { cursor: pointer; }
.operation-stat-row:hover > td { background: rgba(216,255,100,.12); }
.operation-stat-row:hover > td:first-child { box-shadow: inset 4px 0 0 rgba(216,255,100,.9); }
.operation-stat-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.modal-backdrop[hidden] { display: none; }
.operation-detail-backdrop { padding: 16px 48px; }
.operation-detail-dialog { width: calc(100vw - 96px); height: calc(100vh - 32px); max-height: calc(100vh - 32px); }
.operation-detail-dialog > .panel-head h2 { color: #f7f9fc; font-size: 22px; }
.operation-detail-dialog > .panel-head > div span { display: block; margin-top: 5px; color: #c8ced9; font-size: 13px; }
.operation-detail-close { padding: 0; border: 0; background: none; color: #e4e8ef; cursor: pointer; }
.operation-detail-table-wrap { flex: 1; min-height: 0; max-height: none; overflow: auto; }
.operation-detail-table { min-width: 1480px; color: #e9edf3; font-size: 15px; }
.operation-detail-table thead { position: sticky; z-index: 2; top: 0; }
.operation-detail-table th { padding: 16px 18px; background: #1c212a; color: #f7f9fc; font-size: 14px; font-weight: 800; letter-spacing: .02em; }
.operation-detail-table td { padding: 15px 18px; color: #e9edf3; font-size: 15px; line-height: 1.55; }
.operation-detail-table th, .operation-detail-table td { text-align: center; }
.operation-detail-table code { color: inherit; font-size: 14px; font-weight: 650; user-select: text; cursor: text; }
.operation-detail-table tbody tr.operation-user-group-row td:first-child { border-left: 3px solid rgba(216,255,100,.48); }
.operation-detail-table tbody tr.operation-user-group-start:not(:first-child) td { border-top: 2px solid #4a5261; }
.operation-detail-table tbody tr.operation-user-group-row:not(.operation-user-group-start) td { background: rgba(216,255,100,.018); }
.operation-detail-table tbody tr.operation-character-group-start:not(.operation-user-group-start) td:nth-child(n+4) { border-top: 1px dashed #343a46; }
.operation-detail-table th:first-child, .operation-detail-platform { width: 15em; max-width: 15em; }
.operation-detail-platform, .operation-detail-platform code { color: #d8b4fe; font-weight: 800; }
.operation-detail-platform code { display: block; max-width: 15em; margin: 0 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.operation-detail-account, .operation-detail-account code { color: #ffd08a; font-weight: 800; }
.operation-detail-user, .operation-detail-user code { color: #e8ff9a; font-weight: 850; }
.operation-detail-character, .operation-detail-character code { color: #8fdcff; font-weight: 800; }
.operation-chat-id { position: relative; padding-right: 30px; padding-left: 30px; }
.operation-chat-id, .operation-chat-id code { color: #eef1f6; }
.operation-last-chat-time, .operation-last-chat-time code { color: #c8ced9; white-space: nowrap; }
.operation-detail-table td.stat-number { color: #d8ff64; font-size: 17px; font-weight: 850; }
.operation-detail-dialog > .statistics-note { color: #c8ced9; font-size: 13px; }
.operation-user-group-row:not(.operation-user-group-start) .operation-chat-id::before { content: "↳"; position: absolute; left: 10px; color: #687180; }
.operation-chat-row { cursor: pointer; }
.operation-chat-row:hover > td { background: rgba(220,160,185,.14) !important; }
.operation-chat-row:hover > td:first-child { box-shadow: inset 4px 0 0 rgba(220,160,185,.95); }
.operation-chat-row:focus-visible { outline: 2px solid #dca0b9; outline-offset: -2px; }
.operation-chat-backdrop { z-index: 1100; padding: 16px; background: rgba(3,2,5,.82); }
.operation-chat-dialog { width: min(760px, calc(100vw - 32px)); height: min(900px, calc(100vh - 32px)); max-height: calc(100vh - 32px); border-color: rgba(255,255,255,.09); border-radius: 18px; background: rgba(12,9,15,.98); color: #f8f3f6; }
.operation-chat-topbar { display: flex; flex: 0 0 auto; align-items: center; gap: 12px; min-height: 76px; padding: 12px 18px; border-bottom: 1px solid rgba(255,255,255,.09); background: rgba(15,11,18,.96); }
.operation-chat-avatar { display: grid; flex: 0 0 46px; width: 46px; height: 46px; overflow: hidden; place-items: center; border: 1px solid rgba(255,255,255,.16); border-radius: 50%; background: linear-gradient(145deg,#7c4560,#2b1724); color: #fff; font: 22px Georgia,serif; }
.operation-chat-identity { flex: 1; min-width: 0; }
.operation-chat-identity h2 { margin: 0; overflow: hidden; font: 500 19px Georgia,serif; text-overflow: ellipsis; white-space: nowrap; }
.operation-chat-identity p { display: flex; align-items: center; gap: 8px; margin: 3px 0 0; color: #a69aa4; font-size: 12px; }
.operation-chat-language { padding: 2px 7px; border: 1px solid rgba(220,160,185,.25); border-radius: 99px; color: #d7bec9; font-size: 10px; }
.operation-chat-close { width: 36px; height: 36px; padding: 0; border: 1px solid rgba(255,255,255,.09); border-radius: 50%; background: rgba(255,255,255,.035); color: #d9cfd5; font-size: 24px; line-height: 1; cursor: pointer; }
.operation-chat-close:hover { border-color: rgba(220,160,185,.4); background: rgba(220,160,185,.1); }
.operation-chat-messages { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 16px 16px 24px; outline: none; background: radial-gradient(circle at 50% -10%,rgba(128,57,91,.18),transparent 42%),linear-gradient(150deg,#0a080d,#17101a 60%,#0b080e); scrollbar-color: #4b3544 transparent; scrollbar-width: thin; }
.operation-chat-messages::-webkit-scrollbar { width: 4px; }
.operation-chat-messages::-webkit-scrollbar-thumb { border-radius: 4px; background: #4b3544; }
.operation-chat-message { max-width: 84%; margin: 0 auto 14px 0; }
.operation-chat-message.mine { margin-right: 0; margin-left: auto; }
.operation-chat-message.system { max-width: 92%; margin-right: auto; margin-left: auto; text-align: center; }
.operation-chat-message-meta { display: flex; gap: 8px; margin: 0 5px 4px; color: #948a94; font-size: 10px; }
.operation-chat-message-meta time { font-variant-numeric: tabular-nums; }
.operation-chat-message.mine .operation-chat-message-meta { justify-content: flex-end; }
.operation-chat-message.system .operation-chat-message-meta { justify-content: center; }
.operation-chat-bubble { width: fit-content; max-width: 100%; padding: 12px 14px; border: 1px solid rgba(255,255,255,.09); border-radius: 5px 18px 18px 18px; background: rgba(28,20,31,.94); color: #e9e1e6; font-size: 14px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.operation-chat-message.mine .operation-chat-bubble { margin-left: auto; border-radius: 18px 5px 18px 18px; background: linear-gradient(145deg,#66344f,#4a263b); color: #fff; }
.operation-chat-message.system .operation-chat-bubble { margin: 0 auto; border-radius: 12px; background: rgba(255,255,255,.045); color: #b8adb4; font-size: 12px; }
.operation-chat-older { display: block; margin: 0 auto 14px; padding: 5px 10px; border: 0; background: transparent; color: #c4a9b7; font-size: 12px; cursor: pointer; }
.operation-chat-older:disabled { opacity: .45; cursor: default; }
.operation-chat-status { padding: 4px 0; color: #8f838c; text-align: center; font-size: 11px; }
.operation-chat-readonly { display: flex; flex: 0 0 auto; justify-content: space-between; padding: 10px 16px; border-top: 1px solid rgba(255,255,255,.09); background: rgba(15,11,18,.96); color: #948a94; font-size: 11px; }
@media (max-width: 1280px) {
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.sidebar-foot { display: grid; gap: 10px; }
.sidebar-foot form { margin: 0; }
.sidebar-foot button { width: 100%; padding: 7px 10px; border: 1px solid #343947; border-radius: 8px; background: #171a21; color: #cbd0d9; cursor: pointer; }
.sidebar-foot button:hover { border-color: #596172; color: var(--text); }

.auth-page { min-width: 0; min-height: 100vh; background: radial-gradient(circle at top, #1b202a 0, var(--bg) 48%); }
.auth-shell { display: grid; min-height: 100vh; padding: 32px 20px; place-items: center; }
.auth-card { width: min(460px, 100%); padding: 34px; border: 1px solid #303643; border-radius: 18px; background: rgba(19,21,27,.98); box-shadow: 0 28px 90px rgba(0,0,0,.48); }
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 30px; }
.auth-brand strong, .auth-brand small { display: block; }
.auth-brand strong { font-size: 16px; }
.auth-brand small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.auth-card header h1 { font-size: 27px; }
.auth-card header p { margin: 8px 0 0; color: #aeb4c0; line-height: 1.65; }
.auth-form { display: grid; gap: 17px; margin-top: 24px; }
.auth-form label { color: #d8dce4; font-size: 13px; }
.auth-form input { height: 46px; border-color: #3b4250; background: #0c0e13; font-size: 15px; }
.auth-submit { width: 100%; min-height: 46px; margin-top: 3px; font-size: 15px; }
.auth-message { margin-top: 20px; padding: 11px 13px; border: 1px solid; border-radius: 9px; font-size: 13px; }
.auth-message.error { border-color: rgba(255,107,122,.4); background: rgba(255,107,122,.09); color: #ff9aa5; }
.auth-message.success { border-color: rgba(112,225,161,.38); background: rgba(112,225,161,.08); color: #91edb7; }
.totp-card { width: min(520px, 100%); }
.totp-enrollment { display: grid; gap: 16px; margin-top: 23px; }
.totp-qr { display: grid; place-items: center; padding: 14px; border-radius: 14px; background: #fff; }
.totp-qr img { display: block; width: min(320px, 100%); height: auto; }
.totp-manual { padding: 13px 15px; border: 1px solid #333947; border-radius: 10px; background: #0e1015; }
.totp-manual span, .totp-manual small { display: block; color: var(--muted); font-size: 11px; }
.totp-manual code { display: block; margin: 9px 0; padding: 0; border: 0; background: none; color: var(--accent); font-size: 16px; font-weight: 800; letter-spacing: .08em; user-select: text; }
.totp-code { text-align: center; font-size: 24px !important; font-weight: 800; letter-spacing: .28em; font-variant-numeric: tabular-nums; }
.auth-logout { margin-top: 16px; text-align: center; }
.auth-logout button { padding: 0; border: 0; background: none; color: var(--muted); font-size: 12px; cursor: pointer; }
.auth-logout button:hover { color: var(--text); }

.badge.danger { color: var(--danger); background: rgba(255,107,122,.1); }
.management-page { display: grid; gap: 18px; }
.account-create-panel { overflow: visible; }
.account-create-form { display: grid; grid-template-columns: minmax(240px, 1fr) minmax(300px, 1.4fr) auto; align-items: end; gap: 14px; padding: 18px 20px 20px; }
.account-create-form .primary { min-width: 110px; }
.admin-account-table { min-width: 980px; }
.admin-account-table td:first-child .badge { margin-top: 7px; }
.admin-account-table td:nth-child(4), .admin-account-table td:nth-child(5) { color: #c4c9d3; font-size: 12px; white-space: nowrap; }
.account-editor-note { margin: 0; padding: 10px 12px; border: 1px solid rgba(216,255,100,.2); border-radius: 8px; background: rgba(216,255,100,.05); color: #cbd4ac; font-size: 12px; }
.admin-log-filter { display: grid; grid-template-columns: repeat(4, minmax(170px, 1fr)); align-items: end; gap: 14px; padding: 18px 20px 20px; overflow: visible; }
.admin-log-keyword { grid-column: span 3; }
.admin-log-filter-actions { display: flex; align-items: center; justify-content: flex-end; gap: 15px; }
.admin-log-filter-actions a { color: var(--muted); }
.admin-log-filter-actions .primary { min-width: 90px; }
.admin-log-table { min-width: 1180px; }
.admin-log-table th:first-child, .admin-log-table td:first-child { width: 170px; }
.admin-log-table td { vertical-align: top; }
.admin-log-table .log-time { color: #cbd0d9; font-variant-numeric: tabular-nums; white-space: nowrap; }
.admin-log-table .log-summary { min-width: 260px; max-width: 460px; color: #d8dce4; line-height: 1.6; overflow-wrap: anywhere; }
.admin-log-table td code { user-select: text; }
.admin-log-pagination { display: grid; grid-template-columns: 90px 1fr 90px; align-items: center; padding: 14px 20px; border-top: 1px solid var(--line); text-align: center; }
.admin-log-pagination a { color: var(--accent); font-weight: 800; }
.admin-log-pagination .disabled { color: #555b68; }
@media (max-width: 1280px) {
  .admin-log-filter { grid-template-columns: repeat(2, minmax(220px, 1fr)); }
  .admin-log-keyword { grid-column: span 1; }
  .account-create-form { grid-template-columns: 1fr 1fr; }
  .account-create-form .primary { grid-column: 2; justify-self: end; }
}
