:root {
  --klein: #002fa7;
  --klein-600: #0a3fd0;
  --klein-700: #00268a;
  --klein-800: #001b66;
  --klein-900: #00113f;
  --klein-50: #eef2fc;
  --klein-100: #dbe4f8;
  --bg: #f3f5fa;
  --card: #ffffff;
  --border: #e1e6f2;
  --text: #0b1533;
  --muted: #5d6a8a;
  --ok: #0f9d6b;
  --ok-bg: #e6f6ef;
  --bad: #d93649;
  --bad-bg: #fdecee;
  --warn: #c97f00;
  --radius: 4px;
  --shadow: 0 1px 2px rgba(0, 23, 87, 0.06), 0 6px 18px rgba(0, 23, 87, 0.05);
  --font: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "Cascadia Code", "JetBrains Mono", Consolas, "Courier New", monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); color: var(--text); background: var(--bg); font-size: 14px; -webkit-font-smoothing: antialiased; }
button { font: inherit; cursor: pointer; }
b, strong, h1, h2, h3, h4, h5, h6, th, dt, dd, summary, label, button, input, select, textarea, optgroup { font-weight: 400; }
[hidden] { display: none !important; }
a { color: var(--klein); }

.ico { width: 18px; height: 18px; flex-shrink: 0; }
.spin { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.mono { font-family: var(--mono); }
.small { font-size: 12px; }
.text-ok { color: var(--ok); }
.text-bad { color: var(--bad); }
.text-warn { color: var(--warn); }
.text-muted { color: var(--muted); }
.text-klein { color: var(--klein); }

.app { display: flex; height: 100vh; overflow: hidden; }

/* Sidebar */
.sidebar {
  width: 236px; flex-shrink: 0; display: flex; flex-direction: column; color: #fff;
  background:
    radial-gradient(circle at 0 0, rgba(255, 255, 255, 0.16), transparent 42%),
    radial-gradient(circle at 100% 78%, rgba(90, 140, 255, 0.28), transparent 46%),
    linear-gradient(180deg, var(--klein) 0%, var(--klein-700) 100%);
  box-shadow: 4px 0 24px rgba(0, 20, 80, 0.18);
}
.brand { height: 64px; display: flex; align-items: center; gap: 12px; padding: 0 20px; border-bottom: 1px solid rgba(255, 255, 255, 0.12); }
.brand-logo { width: 34px; height: 34px; border-radius: 4px; background: #fff; color: var(--klein); font-weight: 800; display: grid; place-items: center; }
.brand-name { font-weight: 400; font-size: 15px; }
.brand-sub { font-size: 11px; opacity: 0.7; margin-top: 2px; }
.nav { flex: 1; padding: 20px 14px; display: flex; flex-direction: column; gap: 10px; }
.nav-title { padding: 0 12px 4px; font-size: 11px; letter-spacing: 0.12em; color: rgba(255, 255, 255, 0.5); }
.nav-item {
  position: relative; display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 12px 16px;
  border: 1px solid transparent; border-radius: 4px; background: transparent;
  color: rgba(255, 255, 255, 0.74); font-size: 14px; text-align: left;
  transition: background 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.nav-item .ico { width: 18px; height: 18px; opacity: 0.85; transition: opacity 0.2s, transform 0.2s; }
.nav-item:hover { background: rgba(255, 255, 255, 0.08); color: #fff; transform: translateX(2px); }
.nav-item:hover .ico { opacity: 1; }
.nav-item.active {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.24) 0%, rgba(255, 255, 255, 0.1) 100%);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff; font-weight: 400; transform: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 8px 22px rgba(0, 12, 60, 0.28);
  backdrop-filter: blur(8px);
}
.nav-item.active .ico { opacity: 1; transform: scale(1.06); }
.nav-item.active::before {
  content: ""; position: absolute; left: -14px; top: 50%; width: 4px; height: 24px; transform: translateY(-50%);
  border-radius: 0 4px 4px 0; background: #fff; box-shadow: 0 0 12px rgba(255, 255, 255, 0.85);
}
.nav-badge { margin-left: auto; font-style: normal; font-size: 11px; padding: 1px 8px; border-radius: 4px; background: rgba(255, 255, 255, 0.18); color: #fff; }
.nav-item.active .nav-badge { background: rgba(255, 255, 255, 0.28); }
.nav-badge.alert, .nav-item.active .nav-badge.alert { background: #ff5a6e; color: #fff; }
.sidebar-foot { padding: 16px; border-top: 1px solid rgba(255, 255, 255, 0.12); background: rgba(0, 0, 0, 0.12); }
.proxy-state { display: flex; justify-content: space-between; align-items: center; font-size: 12px; margin-bottom: 12px; }
.pill { font-size: 11px; padding: 2px 10px; border-radius: 4px; font-weight: 400; }
.pill.on { background: rgba(70, 230, 160, 0.18); color: #86f7c8; }
.pill.off { background: rgba(255, 90, 110, 0.22); color: #ffb8c1; }
.foot-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.foot-meta { margin-top: 12px; display: flex; justify-content: space-between; align-items: center; font-size: 11px; opacity: 0.8; }
.link-light { background: none; border: 0; color: #fff; padding: 0; font-size: 11px; text-decoration: underline; text-underline-offset: 3px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: 4px; padding: 9px 16px; border: 1px solid transparent; font-size: 13px; font-weight: 400; white-space: nowrap; transition: background 0.15s, border-color 0.15s, color 0.15s; }
.btn .ico { width: 15px; height: 15px; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: var(--klein); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--klein-600); }
.btn-outline { background: #fff; color: var(--klein); border-color: var(--klein-100); }
.btn-outline:hover:not(:disabled) { background: var(--klein-50); }
.btn-ghost { background: #eef0f5; color: var(--text); }
.btn-ghost:hover { background: #e3e7f0; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-light { background: rgba(255, 255, 255, 0.12); color: #fff; border-color: rgba(255, 255, 255, 0.22); padding: 7px 10px; font-size: 12px; }
.btn-light:hover { background: rgba(255, 255, 255, 0.22); }
.btn-light.toggle-btn.active { background: #fff; color: var(--klein); border-color: #fff; }
.icon-btn { width: 34px; height: 34px; display: inline-grid; place-items: center; border-radius: 4px; border: 1px solid var(--border); background: #fff; color: var(--muted); transition: 0.15s; flex-shrink: 0; }
.icon-btn:hover { color: var(--klein); border-color: var(--klein-100); background: var(--klein-50); }
.icon-btn.danger:hover { color: var(--bad); border-color: #f6c9cf; background: var(--bad-bg); }
.icon-btn.light { background: rgba(255, 255, 255, 0.12); border-color: rgba(255, 255, 255, 0.22); color: #fff; }
.icon-btn.light:hover { background: rgba(255, 255, 255, 0.24); }
.icon-btn .ico { width: 16px; height: 16px; }

/* Main */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow-y: auto; }
.topbar { position: sticky; top: 0; z-index: 5; min-height: 64px; display: flex; align-items: center; justify-content: space-between; padding: 0 32px; background: rgba(243, 245, 250, 0.88); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.topbar h2 { margin: 0; font-size: 18px; color: var(--klein-900); }
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 14px; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--klein); background: var(--klein-50); border: 1px solid var(--klein-100); padding: 3px 10px; border-radius: 4px; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px rgba(15, 157, 107, 0.18); }
.pt-date { text-align: right; line-height: 1.35; }
.pt-date span { display: block; font-size: 11px; color: var(--muted); }
.pt-date strong { font-size: 14px; color: var(--klein-900); }

.page { padding: 26px 32px 40px; display: flex; flex-direction: column; gap: 22px; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.storage-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.avail { display: flex; align-items: center; gap: 8px; min-width: 108px; }
.avail-bar { flex: 1; height: 6px; border-radius: 4px; background: var(--klein-50); overflow: hidden; }
.avail-bar i { display: block; height: 100%; background: var(--ok); }
.avail-bar.warn i { background: var(--warn); }
.avail-bar.bad i { background: var(--bad); }
.avail b { font-size: 12px; font-weight: 600; color: var(--klein-900); }
.stat { position: relative; overflow: hidden; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.stat::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--klein); }
.stat-label { display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; color: var(--muted); font-weight: 400; }
.stat-icon { width: 32px; height: 32px; border-radius: 4px; display: grid; place-items: center; background: var(--klein-50); color: var(--klein); }
.stat-value { font-size: 28px; font-weight: 700; margin-top: 10px; letter-spacing: -0.3px; color: var(--klein-900); white-space: nowrap; }
.stat-value small { font-size: 16px; color: var(--muted); font-weight: 400; }
.stat-sub { font-size: 12px; color: var(--muted); margin-top: 4px; }
.stat.featured { background: var(--klein); border-color: var(--klein); background-image: radial-gradient(circle at 100% 0, rgba(255, 255, 255, 0.18), transparent 55%); }
.stat.featured::after { display: none; }
.stat.featured .stat-label, .stat.featured .stat-sub { color: rgba(255, 255, 255, 0.78); }
.stat.featured .stat-value { color: #fff; }
.stat.featured .stat-icon { background: rgba(255, 255, 255, 0.16); color: #fff; }

/* Cards */
.grid-main { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 22px; align-items: start; }
.col { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 22px; }
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; gap: 12px; }
.card h3 { margin: 0; font-size: 15px; font-weight: 400; display: flex; align-items: center; gap: 8px; }
.card h3::before { content: ""; width: 4px; height: 14px; border-radius: 2px; background: var(--klein); }
.chart-wrap { height: 260px; position: relative; }
.chart-wrap canvas { width: 100%; height: 100%; display: block; }
.legend { display: flex; gap: 18px; justify-content: center; font-size: 12px; color: var(--muted); margin-top: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; font-size: 12px; color: var(--klein-800); font-weight: 400; background: var(--klein-50); padding: 10px 12px; white-space: nowrap; }
.table th:first-child { border-radius: 4px 0 0 4px; }
.table th:last-child { border-radius: 0 4px 4px 0; }
.table td { padding: 12px; border-bottom: 1px solid var(--border); }
.table tr:last-child td { border-bottom: 0; }
.empty { text-align: center; color: var(--muted); padding: 28px 0 !important; }
.code-tag { font-family: var(--mono); font-size: 12px; background: var(--klein-50); color: var(--klein); padding: 2px 7px; border-radius: 4px; font-weight: 400; white-space: nowrap; }
.tier-tag { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 4px; white-space: nowrap; }
.tier-free { color: #526071; background: #eef2f6; }
.tier-pro { color: var(--klein); background: var(--klein-50); }
.tier-ultra { color: #8a5a00; background: #fff4d6; }
.tier-plus { color: var(--ok); background: var(--ok-bg); }
.tier-unknown { color: var(--muted); background: #f3f5f8; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.qchip { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; padding: 2px 8px; border-radius: 4px; border: 1px solid; white-space: nowrap; }
.qchip i { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.qchip.ok { color: var(--ok); background: var(--ok-bg); border-color: #bfe8d6; }
.qchip.ok i { background: var(--ok); }
.qchip.bad { color: var(--bad); background: var(--bad-bg); border-color: #f6c9cf; }
.qchip.bad i { background: var(--bad); }

.info-list { margin: 0; }
.info-row { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px dashed var(--border); font-size: 13px; }
.info-row:last-child { border-bottom: 0; }
.info-row dt { color: var(--muted); }
.info-row dd { margin: 0; font-weight: 400; text-align: right; }

.card-klein { color: #fff; border-color: var(--klein); background: var(--klein); background-image: radial-gradient(circle at 100% 100%, rgba(255, 255, 255, 0.16), transparent 55%); }
.card-klein h3::before { background: #fff; }
.card-klein p { font-size: 12.5px; line-height: 1.75; color: rgba(255, 255, 255, 0.85); margin: 12px 0; }
.endpoint { display: flex; align-items: center; gap: 8px; background: rgba(0, 0, 0, 0.24); border-radius: 4px; padding: 7px 7px 7px 12px; }
.endpoint code { flex: 1; font-family: var(--mono); font-size: 12.5px; overflow-x: auto; white-space: nowrap; }

/* Accounts */
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.page-head p { margin: 0; color: var(--muted); }
.acc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 18px; }
.acc-card { background: #fff; border: 1px solid var(--border); border-top: 4px solid var(--klein); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; transition: border-color 0.15s, box-shadow 0.15s; }
.acc-card.disabled { border-top-color: #a7b0c6; }
.acc-card.disabled > :not(.acc-actions) { opacity: 0.68; }
.acc-card.selected { border-color: var(--klein); box-shadow: 0 0 0 3px rgba(0, 47, 167, 0.14), var(--shadow); }
.acc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.acc-head .chk { margin-top: 2px; }
.acc-head .acc-id { flex: 1; min-width: 0; }
.acc-head h4 { margin: 0; font-size: 15px; word-break: break-all; }
.acc-head p { margin: 4px 0 0; font-size: 11.5px; color: var(--muted); }
.tag { font-size: 11px; font-weight: 400; padding: 2px 9px; border-radius: 4px; white-space: nowrap; }
.tag.ok { color: var(--ok); background: var(--ok-bg); }
.tag.bad { color: var(--bad); background: var(--bad-bg); }
.acc-meta { display: flex; flex-direction: column; gap: 8px; font-size: 12.5px; }
.acc-meta div { display: flex; justify-content: space-between; }
.acc-meta span { color: var(--muted); }
.quota-label { font-size: 12px; color: var(--muted); font-weight: 400; margin: 0 0 8px; }
.quota-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.quota-item { display: flex; justify-content: space-between; align-items: center; gap: 6px; font-size: 11.5px; padding: 6px 9px; border-radius: 4px; background: var(--klein-50); color: var(--klein-800); }
.quota-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quota-item i { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); flex-shrink: 0; }
.quota-item.limited { background: var(--bad-bg); color: var(--bad); }
.quota-item.limited i { background: var(--bad); }
.acc-actions { display: flex; justify-content: space-between; align-items: center; padding-top: 14px; border-top: 1px solid var(--border); margin-top: auto; }
.row-gap { display: flex; gap: 8px; }
.empty-state { grid-column: 1 / -1; border: 2px dashed var(--klein-100); border-radius: var(--radius); padding: 48px 24px; text-align: center; background: #fff; }
.empty-state h4 { margin: 14px 0 6px; font-size: 16px; }
.empty-state p { color: var(--muted); margin: 0 auto 18px; max-width: 440px; line-height: 1.7; }
.empty-icon { width: 56px; height: 56px; border-radius: 50%; background: var(--klein-50); color: var(--klein); display: inline-grid; place-items: center; }
.empty-icon .ico { width: 26px; height: 26px; }
.empty-state.slim { border: 0; border-radius: 0; padding: 56px 24px; }

.btn-danger { background: var(--bad); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #c02a3c; }
.link-btn { border: 0; background: none; padding: 0; color: var(--klein); font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }
.link-btn:hover { color: var(--klein-600); }

.chk { appearance: none; -webkit-appearance: none; margin: 0; width: 16px; height: 16px; flex-shrink: 0; border: 1.5px solid #b6c1db; border-radius: 4px; background: #fff center / 12px no-repeat; cursor: pointer; vertical-align: middle; transition: background-color 0.15s, border-color 0.15s, box-shadow 0.15s; }
.chk:hover { border-color: var(--klein); }
.chk:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(0, 47, 167, 0.18); }
.chk:checked { background-color: var(--klein); border-color: var(--klein); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E"); }
.chk:indeterminate { background-color: var(--klein); border-color: var(--klein); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round'%3E%3Cline x1='6' y1='12' x2='18' y2='12'/%3E%3C/svg%3E"); }
.chk-label { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--klein-800); cursor: pointer; user-select: none; }

.acc-panel { padding: 0; }
.acc-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.acc-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; flex: 1; min-width: 0; }
.acc-tools .dd { width: 156px; }
.search-field { position: relative; display: block; width: 300px; max-width: 100%; }
.search-field .ico { position: absolute; left: 11px; top: 50%; width: 15px; height: 15px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search-field input { width: 100%; border: 1px solid var(--border); border-radius: 4px; padding: 9px 12px 9px 34px; font: inherit; font-size: 13px; color: var(--text); background: #fafbfe; outline: none; transition: border-color 0.15s, box-shadow 0.15s, background 0.15s; }
.search-field input:focus { border-color: var(--klein); background: #fff; box-shadow: 0 0 0 3px rgba(0, 47, 167, 0.12); }
.view-switch { display: inline-flex; gap: 3px; padding: 3px; background: var(--klein-50); border: 1px solid var(--klein-100); border-radius: 4px; }
.view-btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 0; border-radius: 4px; background: transparent; color: var(--klein-800); font-size: 13px; transition: background 0.15s, color 0.15s, box-shadow 0.15s; }
.view-btn .ico { width: 15px; height: 15px; }
.view-btn:hover { background: rgba(0, 47, 167, 0.07); }
.view-btn.active { background: var(--klein); color: #fff; box-shadow: 0 4px 10px rgba(0, 47, 167, 0.25); }

.bulk-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px 16px; flex-wrap: wrap; padding: 10px 20px; background: var(--klein-50); border-bottom: 1px solid var(--klein-100); animation: dd-in 0.16s ease-out; }
.bulk-info { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; color: var(--klein-900); font-size: 13px; }
.bulk-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.acc-row { display: grid; grid-template-columns: 18px minmax(200px, 2.2fr) 76px 78px 70px minmax(160px, 1.8fr) 104px 118px; gap: 14px; align-items: center; padding: 13px 20px; border-bottom: 1px solid var(--border); font-size: 13px; transition: background 0.15s; }
.acc-row:last-child { border-bottom: 0; }
.acc-row:not(.acc-row-head):hover { background: #fafbff; }
.acc-row.selected { background: var(--klein-50); box-shadow: inset 3px 0 0 var(--klein); }
.acc-row.selected:hover { background: var(--klein-50); }
.acc-row-head { padding-top: 10px; padding-bottom: 10px; background: #f6f8fd; color: var(--klein-800); font-size: 12px; white-space: nowrap; }
.acc-row > div { min-width: 0; }
.c-check { display: flex; align-items: center; }
.c-name { display: flex; align-items: center; gap: 12px; }
.acc-avatar { width: 34px; height: 34px; flex-shrink: 0; border-radius: 4px; display: grid; place-items: center; background: linear-gradient(135deg, var(--klein-600), var(--klein)); color: #fff; font-size: 14px; box-shadow: 0 4px 10px rgba(0, 47, 167, 0.2); }
.acc-row.disabled .acc-avatar { background: #a7b0c6; box-shadow: none; }
.acc-row.disabled .acc-id, .acc-row.disabled .c-quota { opacity: 0.6; }
.acc-id { min-width: 0; }
.acc-title { margin: 0; font-size: 14px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-sub { margin: 3px 0 0; font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.c-cookie, .c-time { color: var(--muted); white-space: nowrap; }
.c-quota { display: flex; flex-wrap: wrap; gap: 5px; }
.qchip.more { color: var(--klein); background: var(--klein-50); border-color: var(--klein-100); }
.c-actions { display: flex; justify-content: flex-end; gap: 6px; }
.c-actions .icon-btn { width: 32px; height: 32px; }
.only-narrow { display: none; }

.grid-head { padding: 14px 20px 0; }
.acc-panel .acc-grid { padding: 14px 20px 20px; }

.acc-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px 20px; flex-wrap: wrap; padding: 14px 20px; border-top: 1px solid var(--border); }
.acc-total { font-size: 12.5px; color: var(--muted); }
.pager-wrap { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.page-size { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.page-size .dd-btn { padding: 6px 10px; min-width: 88px; font-size: 12.5px; }
.pager { display: flex; align-items: center; gap: 4px; }
.pg-btn { min-width: 32px; height: 32px; padding: 0 8px; display: inline-grid; place-items: center; border: 1px solid var(--border); border-radius: 4px; background: #fff; color: var(--text); font-size: 13px; transition: background 0.15s, border-color 0.15s, color 0.15s; }
.pg-btn .ico { width: 15px; height: 15px; }
.pg-btn:hover:not(:disabled) { color: var(--klein); border-color: var(--klein-100); background: var(--klein-50); }
.pg-btn:disabled { opacity: 0.45; cursor: default; }
.pg-btn.active, .pg-btn.active:disabled { opacity: 1; background: var(--klein); border-color: var(--klein); color: #fff; box-shadow: 0 4px 10px rgba(0, 47, 167, 0.22); }
.pg-gap { min-width: 22px; text-align: center; color: var(--muted); }
.pg-info { display: none; padding: 0 8px; font-size: 13px; color: var(--klein-800); white-space: nowrap; }

/* Forms */
.settings-card { width: 100%; padding: 0; overflow: hidden; }
.settings-section .form-grid { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.settings-section { padding: 22px 24px; border-bottom: 1px solid var(--border); }
.settings-section h4 { margin: 0 0 16px; font-size: 14px; color: var(--klein); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 22px; }
.storage-line { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 18px 22px; align-items: end; }
.storage-save .btn { min-height: 40px; }
.form-grid .full { grid-column: 1 / -1; }
.field label { display: block; font-size: 12.5px; font-weight: 400; margin-bottom: 7px; }
.field input, .field select, .field textarea { width: 100%; border: 1px solid var(--border); border-radius: 4px; padding: 9px 12px; font: inherit; font-size: 13px; color: var(--text); background: #fafbfe; outline: none; transition: border-color 0.15s, box-shadow 0.15s, background 0.15s; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--klein); background: #fff; box-shadow: 0 0 0 3px rgba(0, 47, 167, 0.12); }
.field input.mono, .field textarea.cookie-input { font-family: var(--mono); }
.field .hint, td .hint { display: block; font-size: 11.5px; color: var(--muted); margin-top: 6px; line-height: 1.6; }
td .hint { margin-top: 2px; font-size: 11px; }
.field .hint.warn { color: var(--warn); }
.dd { position: relative; display: inline-block; }
.field .dd { display: block; width: 100%; }
.dd-native { display: none !important; }
.dd-btn { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 12px; border: 1px solid var(--border); border-radius: 4px; background: #fafbfe; color: var(--text); font-size: 13px; text-align: left; transition: border-color 0.15s, box-shadow 0.15s, background 0.15s; }
.dd-btn:hover { border-color: var(--klein-100); background: #fff; }
.dd.open .dd-btn, .dd-btn:focus-visible { outline: none; border-color: var(--klein); background: #fff; box-shadow: 0 0 0 3px rgba(0, 47, 167, 0.12); }
.dd-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-arrow { width: 16px; height: 16px; color: var(--muted); transition: transform 0.2s, color 0.2s; }
.dd.open .dd-arrow { transform: rotate(180deg); color: var(--klein); }
.dd.dark .dd-btn { padding: 6px 10px; border-color: rgba(255, 255, 255, 0.22); background: rgba(255, 255, 255, 0.12); color: #fff; font-size: 12px; min-width: 128px; }
.dd.dark .dd-btn:hover { background: rgba(255, 255, 255, 0.2); }
.dd.dark.open .dd-btn, .dd.dark .dd-btn:focus-visible { border-color: #fff; background: rgba(255, 255, 255, 0.2); box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.18); }
.dd.dark .dd-arrow { color: rgba(255, 255, 255, 0.8); }
.dd-menu { position: fixed; z-index: 80; max-height: 300px; overflow-y: auto; padding: 5px; border: 1px solid var(--klein-100); border-radius: 4px; background: #fff; box-shadow: 0 16px 40px rgba(0, 17, 63, 0.2); animation: dd-in 0.14s ease-out; }
.dd-opt { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 8px 10px; border: 0; border-radius: 4px; background: none; color: var(--text); font-size: 13px; text-align: left; white-space: nowrap; }
.dd-opt + .dd-opt { margin-top: 2px; }
.dd-opt:hover, .dd-opt:focus-visible { outline: none; background: var(--klein-50); color: var(--klein); }
.dd-opt.active { background: var(--klein); color: #fff; }
.dd-opt .ico { width: 15px; height: 15px; }
@keyframes dd-in { from { opacity: 0; transform: translateY(-4px); } }
.input-affix { position: relative; }
.input-affix input { padding-right: 42px; }
.input-affix button { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--muted); padding: 5px; display: grid; }
.input-affix button:hover { color: var(--klein); }
.settings-foot { padding: 16px 24px; display: flex; justify-content: flex-end; background: #fafbfe; }
textarea.cookie-input { font-size: 12px; resize: vertical; min-height: 150px; }

/* Logs */
.page-logs { flex: 1; }
.console { display: flex; flex-direction: column; height: calc(100vh - 64px - 66px); min-height: 420px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--klein-800); box-shadow: var(--shadow); background: var(--klein-900); }
.console-bar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--klein); color: #fff; flex-wrap: wrap; }
.console-search { flex: 1; min-width: 200px; display: flex; align-items: center; gap: 8px; background: rgba(255, 255, 255, 0.12); border-radius: 4px; padding: 6px 10px; }
.console-search .ico { width: 16px; height: 16px; opacity: 0.8; }
.console-search input { flex: 1; min-width: 0; background: none; border: 0; outline: none; color: #fff; font: inherit; font-size: 13px; }
.console-search input::placeholder { color: rgba(255, 255, 255, 0.6); }
.console-bar select { background: rgba(255, 255, 255, 0.12); color: #fff; border: 1px solid rgba(255, 255, 255, 0.22); border-radius: 4px; padding: 6px 8px; font: inherit; font-size: 12px; outline: none; }
.console-bar select option { color: var(--text); }
.console-body { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 16px; font-family: var(--mono); font-size: 12.5px; line-height: 1.7; color: #c9d6ff; }
.log-line { white-space: pre-wrap; word-break: break-all; padding: 1px 0 1px 10px; border-left: 2px solid rgba(255, 255, 255, 0.12); }
.log-line.err { color: #ff9aa7; border-left-color: #ff5a6e; }
.log-line.warn { color: #ffd48a; border-left-color: #ffb020; }
.log-line.ok { color: #8cf2c6; border-left-color: #2bd99a; }
.log-line.debug { color: #8ea2d8; }
.console-empty { height: 100%; display: grid; place-items: center; color: rgba(255, 255, 255, 0.4); }

/* Modals */
.modal-mask { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; background: rgba(0, 17, 63, 0.55); backdrop-filter: blur(4px); }
.modal { width: 100%; max-width: 660px; max-height: 88vh; display: flex; flex-direction: column; overflow: hidden; background: #fff; border-radius: 4px; box-shadow: 0 24px 64px rgba(0, 17, 63, 0.35); }
.modal.small { max-width: 420px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 22px; background: var(--klein); color: #fff; }
.modal-head h3 { margin: 0; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.modal-head button { background: none; border: 0; color: #fff; opacity: 0.8; display: grid; padding: 4px; }
.modal-head button:hover { opacity: 1; }
.modal-body { padding: 20px 22px; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; }
.modal-body > p { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.75; }
.modal-foot { padding: 14px 22px; display: flex; justify-content: flex-end; gap: 10px; border-top: 1px solid var(--border); background: #fafbfe; }
.checkbox-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 4px; background: var(--klein-50); border: 1px solid var(--klein-100); cursor: pointer; }
.checkbox-row input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--klein); }
.checkbox-row b { display: block; font-size: 13px; color: var(--klein-900); }
.checkbox-row span { font-size: 12px; color: var(--muted); }
.probe-box { border-radius: 4px; background: var(--klein-900); color: #c9d6ff; padding: 12px 14px; font-family: var(--mono); font-size: 12px; line-height: 1.7; }
.probe-title { color: #fff; font-weight: 400; margin-bottom: 4px; font-family: var(--font); }
.probe-row { display: flex; justify-content: space-between; gap: 12px; }
.probe-row .text-ok { color: #8cf2c6; }
.probe-row .text-bad { color: #ff9aa7; }
.probe-msg { color: #8ea2d8; font-size: 11px; padding-left: 12px; word-break: break-all; }
#upload-box { max-height: 220px; overflow-y: auto; }
.upload-file { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #fff; }
.probe-row > span:last-child { flex-shrink: 0; max-width: 62%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.import-drop { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border: 1.5px dashed var(--klein-100); border-radius: 4px; background: linear-gradient(135deg, #f7f9ff, var(--klein-50)); transition: border-color 0.15s, background 0.15s, box-shadow 0.15s; }
.import-drop.dragging { border-color: var(--klein); background: var(--klein-50); box-shadow: 0 0 0 4px rgba(0, 47, 167, 0.1); }
.import-drop.busy { opacity: 0.8; }
.import-drop-icon { width: 42px; height: 42px; flex-shrink: 0; display: grid; place-items: center; border-radius: 4px; background: var(--klein); color: #fff; box-shadow: 0 6px 14px rgba(0, 47, 167, 0.25); }
.import-drop-icon .ico { width: 20px; height: 20px; }
.import-drop-text { flex: 1; min-width: 0; }
.import-drop-text b { display: block; font-size: 14px; color: var(--klein-900); margin-bottom: 3px; }
.import-drop-text span { font-size: 12px; color: var(--muted); line-height: 1.6; }
.divider-text { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; }
.divider-text::before, .divider-text::after { content: ""; flex: 1; height: 1px; background: var(--border); }
@media (max-width: 640px) {
  .import-drop { flex-wrap: wrap; }
  .import-drop .btn { width: 100%; }
}

/* Toasts */
.toasts { position: fixed; top: 18px; right: 18px; z-index: 60; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.toast { pointer-events: auto; min-width: 260px; max-width: 440px; display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 4px; background: #fff; border-left: 4px solid var(--klein); box-shadow: 0 10px 30px rgba(0, 17, 63, 0.18); font-size: 13px; line-height: 1.55; animation: toast-in 0.2s ease-out; }
.toast .ico { margin-top: 1px; color: var(--klein); }
.toast.success { border-left-color: var(--ok); }
.toast.success .ico { color: var(--ok); }
.toast.error { border-left-color: var(--bad); }
.toast.error .ico { color: var(--bad); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-6px); } }

/* Playground */
.page-play { height: calc(100vh - 65px); min-height: 560px; padding-bottom: 26px; }
.play { flex: 1; min-height: 0; display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 22px; }
.play-side { display: flex; flex-direction: column; gap: 18px; overflow-y: auto; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; background: var(--klein-50); border: 1px solid var(--klein-100); border-radius: 4px; }
.seg-item { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 10px 4px; border: 0; border-radius: 4px; background: transparent; color: var(--klein-800); font-size: 12px; font-weight: 400; transition: background 0.2s, color 0.2s, box-shadow 0.2s; }
.seg-item:hover { background: rgba(0, 47, 167, 0.07); }
.seg-item.active { background: var(--klein); color: #fff; box-shadow: 0 6px 14px rgba(0, 47, 167, 0.28); }
.play-opts { display: flex; flex-direction: column; gap: 18px; }
.range-val { float: right; color: var(--klein); font-family: var(--mono); }
.field input[type="range"] { padding: 0; border: 0; background: none; box-shadow: none; accent-color: var(--klein); }
.switch-row { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.switch-row input { width: 16px; height: 16px; accent-color: var(--klein); }
.side-tip { margin: 0; font-size: 12px; line-height: 1.75; color: var(--klein-800); background: var(--klein-50); border-left: 3px solid var(--klein); padding: 10px 12px; border-radius: 0 4px 4px 0; }
.side-foot { margin-top: auto; padding-top: 4px; }
.side-foot .btn { width: 100%; }

.play-main { position: relative; display: flex; flex-direction: column; min-height: 0; padding: 0; overflow: hidden; }
.play-main.drag::after { content: "松开鼠标即可添加图片"; position: absolute; inset: 10px; z-index: 3; display: grid; place-items: center; border: 2px dashed var(--klein); border-radius: 4px; background: rgba(238, 242, 252, 0.92); color: var(--klein); font-weight: 400; }
.play-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.play-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.play-title h3 { margin: 0; font-size: 15px; }
.play-title h3::before { display: none; }
.play-title p { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.play-badge { width: 40px; height: 40px; flex-shrink: 0; display: grid; place-items: center; border-radius: 4px; color: #fff; background: linear-gradient(135deg, var(--klein), var(--klein-600)); box-shadow: 0 6px 14px rgba(0, 47, 167, 0.25); }
.chip.busy { color: var(--warn); background: #fff6e5; border-color: #f5dfb0; }
.play-msgs { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 18px; padding: 22px 24px; background: linear-gradient(180deg, #f8faff 0%, #fff 60%); }

.msg { display: flex; align-items: flex-start; gap: 10px; }
.msg.user { justify-content: flex-end; }
.avatar { width: 32px; height: 32px; flex-shrink: 0; display: grid; place-items: center; border-radius: 4px; background: var(--klein-50); color: var(--klein); }
.avatar.bot { background: var(--klein); color: #fff; }
.avatar .ico { width: 16px; height: 16px; }
.bubble { min-width: 0; max-width: min(780px, 84%); padding: 12px 16px; border-radius: 4px; font-size: 14px; line-height: 1.75; word-break: break-word; }
.msg.user .bubble { background: var(--klein); color: #fff; border-top-right-radius: 4px; box-shadow: 0 6px 16px rgba(0, 47, 167, 0.2); }
.msg.model .bubble { background: #fff; border: 1px solid var(--border); border-top-left-radius: 4px; box-shadow: var(--shadow); }
.user-text { white-space: pre-wrap; }
.gen-imgs { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 8px; }
.gen-imgs:last-child { margin-bottom: 0; }
.att-img { display: block; max-width: 200px; max-height: 160px; border-radius: 4px; border: 2px solid rgba(255, 255, 255, 0.35); cursor: zoom-in; }
.gen-img { position: relative; margin: 0; }
.gen-img img { display: block; max-width: 100%; max-height: 480px; border-radius: 4px; border: 1px solid var(--border); cursor: zoom-in; }
.gen-dl { position: absolute; top: 8px; right: 8px; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 4px; background: rgba(0, 17, 63, 0.62); color: #fff; opacity: 0; transition: opacity 0.2s; }
.gen-img:hover .gen-dl { opacity: 1; }
.gen-dl .ico { width: 16px; height: 16px; }

.md p { margin: 0 0 8px; }
.md p:last-child { margin-bottom: 0; }
.md h4 { margin: 12px 0 6px; font-size: 15px; color: var(--klein-900); }
.md ul, .md ol { margin: 4px 0 8px; padding-left: 22px; }
.md blockquote { margin: 6px 0; padding: 4px 12px; border-left: 3px solid var(--klein-100); color: var(--muted); }
.md code { font-family: var(--mono); font-size: 12.5px; background: var(--klein-50); color: var(--klein-800); padding: 1px 6px; border-radius: 4px; }
.md-code { margin: 8px 0; overflow: hidden; border-radius: 4px; background: var(--klein-900); }
.md .md-code code { display: block; padding: 12px 14px; overflow-x: auto; white-space: pre; background: none; color: #dbe4f8; font-size: 12.5px; line-height: 1.6; border-radius: 0; }
.md-code-head, .doc-code-head { display: flex; justify-content: space-between; align-items: center; padding: 6px 10px 6px 14px; background: rgba(255, 255, 255, 0.06); color: #9fb3e8; font-family: var(--mono); font-size: 11.5px; }
.md-copy { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border: 0; border-radius: 4px; background: rgba(255, 255, 255, 0.1); color: #dbe4f8; font-size: 11.5px; }
.md-copy:hover { background: rgba(255, 255, 255, 0.2); }
.md-copy .ico { width: 12px; height: 12px; }
.thought { margin-bottom: 10px; border: 1px solid var(--klein-100); border-radius: 4px; background: var(--klein-50); font-size: 13px; }
.thought summary { display: flex; align-items: center; gap: 6px; padding: 7px 12px; color: var(--klein); font-weight: 400; cursor: pointer; list-style: none; }
.thought summary::-webkit-details-marker { display: none; }
.thought summary .ico { width: 14px; height: 14px; }
.thought .md { padding: 0 12px 10px; color: var(--muted); }
.msg-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--border); font-size: 11.5px; color: var(--muted); }
.msg-meta i { font-style: normal; opacity: 0.5; }
.msg-error, .msg-note { display: flex; align-items: flex-start; gap: 8px; margin-top: 6px; padding: 10px 12px; border-radius: 4px; font-size: 13px; line-height: 1.6; }
.msg-error { background: var(--bad-bg); color: var(--bad); }
.msg-error.muted { background: #f1f3f8; color: var(--muted); }
.msg-note { background: #fff6e5; color: #8a5a00; }
.msg-error .ico, .msg-note .ico { width: 16px; height: 16px; margin-top: 2px; }
.bubble > .msg-error:first-child { margin-top: 0; }
.typing { display: flex; gap: 5px; padding: 7px 2px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--klein); animation: typing 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: 0.2s; }
.typing i:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing { 0%, 80%, 100% { opacity: 0.25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

.vid-job { min-width: min(360px, 60vw); }
.vid-stage { display: flex; align-items: center; gap: 12px; }
.vid-stage > .ico { width: 36px; height: 36px; padding: 8px; border-radius: 4px; background: var(--klein-50); color: var(--klein); }
.vid-stage b { display: block; font-size: 14px; }
.vid-stage span { font-size: 12px; color: var(--muted); }
.vid-stage em { font-style: normal; font-family: var(--mono); font-weight: 400; color: var(--klein); }
.vid-progress { height: 6px; margin: 12px 0 8px; overflow: hidden; border-radius: 4px; background: var(--klein-50); }
.vid-progress i { display: block; width: 35%; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--klein), #4d7cff); animation: indeterminate 1.6s ease-in-out infinite; }
@keyframes indeterminate { from { transform: translateX(-100%); } to { transform: translateX(300%); } }
.vid-op { margin: 0; font-size: 11.5px; color: var(--muted); word-break: break-all; }
.vid-result video { display: block; width: 100%; max-width: 640px; max-height: 420px; border-radius: 4px; background: #000; }
.vid-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 10px; font-size: 12px; color: var(--muted); }
.vid-actions > span { display: inline-flex; align-items: center; gap: 5px; }
.vid-actions .ico { width: 14px; height: 14px; }
.vid-note { display: flex; gap: 6px; margin: 8px 0 0; font-size: 12px; color: var(--warn); }

.play-welcome { max-width: 560px; margin: auto; padding: 20px; text-align: center; }
.welcome-icon { width: 64px; height: 64px; display: inline-grid; place-items: center; border-radius: 4px; color: #fff; background: linear-gradient(135deg, var(--klein), var(--klein-600)); box-shadow: 0 12px 28px rgba(0, 47, 167, 0.3); }
.welcome-icon .ico { width: 30px; height: 30px; }
.play-welcome h4 { margin: 16px 0 6px; font-size: 18px; color: var(--klein-900); }
.play-welcome p { margin: 0 0 20px; color: var(--muted); line-height: 1.7; }
.suggest { display: flex; flex-direction: column; gap: 8px; }
.suggest button { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border: 1px solid var(--border); border-radius: 4px; background: #fff; color: var(--text); font-size: 13px; text-align: left; transition: border-color 0.2s, color 0.2s, background 0.2s, transform 0.2s; }
.suggest button:hover { border-color: var(--klein); color: var(--klein); background: var(--klein-50); transform: translateY(-1px); }
.suggest .ico { width: 15px; height: 15px; color: var(--klein); }

.composer { padding: 14px 20px 12px; border-top: 1px solid var(--border); background: #fff; }
.attach-list { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.attach { position: relative; width: 64px; height: 64px; }
.attach img { width: 100%; height: 100%; object-fit: cover; border-radius: 4px; border: 1px solid var(--border); }
.attach button { position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: var(--bad); color: #fff; }
.attach button .ico { width: 12px; height: 12px; }
.composer-box { display: flex; align-items: flex-end; gap: 8px; padding: 8px; border: 1.5px solid var(--border); border-radius: 4px; background: #fafbfe; transition: border-color 0.2s, box-shadow 0.2s, background 0.2s; }
.composer-box:focus-within { border-color: var(--klein); background: #fff; box-shadow: 0 0 0 4px rgba(0, 47, 167, 0.1); }
.composer-box textarea { flex: 1; max-height: 180px; overflow-y: hidden; padding: 6px 4px; border: 0; outline: none; resize: none; background: transparent; color: var(--text); font: inherit; font-size: 14px; line-height: 1.6; }
.composer-box .icon-btn { border: 0; background: transparent; }
.send-btn { padding: 9px 18px; border-radius: 4px; }
.send-btn.stop, .send-btn.stop:hover:not(:disabled) { background: var(--bad); }
.composer-hint { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px; padding: 0 4px; font-size: 11.5px; color: var(--muted); }

.lightbox { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 32px; background: rgba(0, 10, 40, 0.84); cursor: zoom-out; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 4px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5); }

/* Docs */
.docs { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 22px; align-items: start; }
.docs-toc { position: sticky; top: 90px; display: flex; flex-direction: column; gap: 2px; padding: 14px; }
.toc-title { margin: 0 0 8px; padding: 0 10px; font-size: 11px; letter-spacing: 0.12em; color: var(--muted); }
.docs-toc button { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 0; border-radius: 4px; background: none; color: var(--text); font-size: 13px; text-align: left; transition: background 0.15s, color 0.15s; }
.docs-toc button:hover { background: var(--klein-50); color: var(--klein); }
.docs-toc .ico { width: 15px; height: 15px; color: var(--klein); }
.docs-body { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.doc-section { scroll-margin-top: 90px; }
.doc-section > h3::before { display: none; }
.doc-section .table-wrap { margin: 14px 0; }
.doc-section > h3 .ico { width: 18px; height: 18px; color: var(--klein); }
.doc-section p { margin: 12px 0; font-size: 13.5px; line-height: 1.8; color: #2a3557; }
.doc-section h4 { margin: 20px 0 10px; font-size: 14px; color: var(--klein-800); }
.doc-section code { font-family: var(--mono); font-size: 12.5px; padding: 1px 6px; border-radius: 4px; background: var(--klein-50); color: var(--klein-800); }
.doc-kv { display: flex; flex-direction: column; gap: 8px; margin: 14px 0; }
.doc-kv > div { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border: 1px solid var(--klein-100); border-radius: 4px; background: var(--klein-50); }
.doc-kv span { width: 72px; flex-shrink: 0; font-size: 12.5px; color: var(--muted); }
.doc-section .doc-kv code { flex: 1; padding: 0; background: none; color: var(--klein); font-size: 13px; font-weight: 400; word-break: break-all; }
.doc-kv .icon-btn { width: 30px; height: 30px; }
.doc-section .doc-tip { display: flex; align-items: flex-start; gap: 8px; padding: 10px 14px; border-radius: 4px; background: var(--klein-50); color: var(--klein-800); font-size: 12.5px; line-height: 1.75; }
.doc-tip .ico { width: 16px; height: 16px; margin-top: 3px; color: var(--klein); }
.doc-section .doc-tip.warn { background: #fff6e5; color: #7a5200; }
.doc-tip.warn .ico { color: var(--warn); }
.doc-code { overflow: hidden; border-radius: 4px; background: var(--klein-900); }
.doc-code pre { margin: 0; padding: 14px 16px; overflow-x: auto; }
.doc-section .doc-code code { padding: 0; background: none; color: #dbe4f8; font-size: 12.5px; line-height: 1.65; white-space: pre; }
.code-tabs { margin: 12px 0; }
.code-tab-bar { display: flex; gap: 4px; }
.code-tab-bar button { padding: 7px 14px; border: 0; border-radius: 4px 4px 0 0; background: var(--klein-50); color: var(--klein-800); font-size: 12.5px; font-weight: 400; }
.code-tab-bar button.active { background: var(--klein-900); color: #fff; }
.code-tabs .doc-code { border-top-left-radius: 0; }
.method { font-family: var(--mono); font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 4px; }
.method.get { background: var(--ok-bg); color: var(--ok); }
.method.post { background: var(--klein-50); color: var(--klein); }
.doc-table td { font-size: 12.5px; vertical-align: top; }
.doc-table td.mono { word-break: break-all; }
.kind { font-size: 11px; font-weight: 400; padding: 2px 9px; border-radius: 4px; white-space: nowrap; }
.kind.text { background: var(--klein-50); color: var(--klein); }
.kind.image { background: #f1e8ff; color: #6d28d9; }
.kind.video { background: #ffefe3; color: #c2410c; }
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 14px 0; }
.steps > div { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--klein-100); border-radius: 4px; background: linear-gradient(135deg, #fff, var(--klein-50)); }
.steps b { width: 30px; height: 30px; flex-shrink: 0; display: grid; place-items: center; border-radius: 50%; background: var(--klein); color: #fff; }
.steps span { font-size: 13px; font-weight: 400; line-height: 1.5; }
.steps small { font-size: 11.5px; font-weight: 400; color: var(--muted); }
.doc-list { margin: 8px 0; padding-left: 22px; font-size: 13.5px; line-height: 2; }
.card-klein .btn-light { margin-top: 2px; }

@media (max-width: 1440px) {
  .acc-row { grid-template-columns: 18px minmax(190px, 2fr) 76px 78px minmax(150px, 1.8fr) 104px 118px; }
  .acc-row .c-cookie { display: none; }
}
@media (max-width: 1280px) {
  .acc-row { grid-template-columns: 18px minmax(180px, 2fr) 76px 78px minmax(140px, 1.6fr) 118px; }
  .acc-row .c-time { display: none; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-main { grid-template-columns: minmax(0, 1fr); }
  .play { grid-template-columns: 260px minmax(0, 1fr); }
}
@media (max-width: 1000px) {
  .page-play { height: auto; }
  .play { flex: none; grid-template-columns: minmax(0, 1fr); }
  .play-side { overflow: visible; }
  .play-main { height: 75vh; }
  .docs { grid-template-columns: minmax(0, 1fr); }
  .docs-toc { position: static; flex-direction: row; flex-wrap: wrap; }
  .toc-title { display: none; }
  .steps { grid-template-columns: minmax(0, 1fr); }

  .acc-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; padding: 14px 16px; }
  .acc-row .c-name { flex: 1 1 0; }
  .acc-row .c-quota { order: 2; flex-basis: calc(100% - 30px); margin-left: 30px; }
  .acc-row .c-user, .acc-row .c-cookie, .acc-row .c-time { display: flex; align-items: center; gap: 6px; order: 3; font-size: 12px; color: var(--muted); }
  .acc-row .c-user { margin-left: 30px; }
  .acc-row .c-user::before, .acc-row .c-cookie::before, .acc-row .c-time::before { content: attr(data-label); color: #8a95b2; }
  .acc-row .c-actions { order: 4; margin-left: auto; }
  .acc-row-head { padding: 10px 16px; }
  .acc-row-head > :not(.c-check):not(.c-name) { display: none !important; }
  .only-wide { display: none; }
  .only-narrow { display: inline; }
  .acc-toolbar, .bulk-bar, .acc-foot { padding-left: 16px; padding-right: 16px; }
  .grid-head { padding-left: 16px; padding-right: 16px; }
  .acc-panel .acc-grid { padding: 14px 16px 16px; }
}
@media (max-width: 640px) {
  .acc-tools, .search-field, .acc-tools .dd { width: 100%; }
  .acc-tools .dd, .search-field { flex: 1 1 100%; }
  .view-switch { width: 100%; }
  .view-btn { flex: 1; justify-content: center; }
  .acc-foot, .pager-wrap { flex-direction: column; align-items: stretch; }
  .acc-total { text-align: center; }
  .pager-wrap { gap: 12px; }
  .page-size { justify-content: center; }
  .pager { justify-content: center; }
  .pager .pg-btn:not(.pg-arrow), .pg-gap { display: none; }
  .pg-info { display: inline; }
  .bulk-bar { flex-direction: column; align-items: stretch; }
  .bulk-actions .btn { flex: 1; }
  .acc-row .c-user { margin-left: 0; }
  .acc-row .c-quota { margin-left: 0; flex-basis: 100%; }
}
@media (max-width: 780px) {
  .sidebar { width: 64px; }
  .brand { padding: 0 15px; }
  .brand > div:last-child, .nav-title, .nav-item span, .nav-badge, .proxy-state, .foot-meta, .foot-actions span { display: none; }
  .nav { padding: 18px 8px; }
  .nav-item { justify-content: center; padding: 12px 0; }
  .nav-item:hover { transform: none; }
  .nav-item.active::before { left: -8px; }
  .foot-actions { grid-template-columns: 1fr; }
  .page, .topbar { padding-left: 16px; padding-right: 16px; }
  .stats, .form-grid, .settings-section .form-grid, .storage-line { grid-template-columns: minmax(0, 1fr); }
  .pt-date { display: none; }
}
