/* Shared by account management and the DeepSeek service center. No external assets. */
:root {
  color-scheme: dark;
  --bg: #101917;
  --panel: #1a2622;
  --panel2: #21312b;
  --line: #35473e;
  --gold: #dbba83;
  --gold-soft: #edcf9d;
  --gold2: var(--gold-soft);
  --text: #f3f3ea;
  --muted: #afbeb4;
  --green: #8dd5b1;
  --red: #ffb0a6;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 24px; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: radial-gradient(ellipse at 85% 0, #2a4033 0, transparent 46%), var(--bg);
  font: 14px/1.6 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}
main {
  width: 100%;
  max-width: 1480px;
  margin: auto;
  padding: 40px max(28px, env(safe-area-inset-right)) max(64px, env(safe-area-inset-bottom)) max(28px, env(safe-area-inset-left));
}
h1 { margin: 10px 0 6px; font-size: 32px; line-height: 1.3; font-weight: 650; letter-spacing: -.6px; }
h2 { margin: 0 0 8px; font-size: 20px; line-height: 1.4; font-weight: 650; }
h3 { margin: 28px 0 12px; font-size: 15px; color: var(--gold-soft); }
p { margin: 0; }
a { color: var(--gold-soft); text-underline-offset: 4px; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
button, .back, .deepseek-button, .official-link { touch-action: manipulation; }
button, input, select { font: inherit; }
button, input, select, .back, .deepseek-button {
  min-height: 44px;
  border: 1px solid #4c6153;
  border-radius: 10px;
  padding: 10px 14px;
}
input, select { background: #131e19; color: var(--text); max-width: 100%; }
input::placeholder { color: #98ac9f; opacity: 1; }
input[type="search"] { appearance: none; }
button { cursor: pointer; background: var(--gold); border-color: var(--gold); color: #241d12; font-weight: 650; transition: background .16s, border-color .16s; }
button.secondary, .settings-button, .back { background: #26372e; border-color: #506353; color: var(--text); }
button.danger { background: #472b2a; border-color: #87524a; color: #ffc0b6; }
button:disabled { opacity: .5; cursor: not-allowed; }
:is(button, input, select, a):focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
@media (hover: hover) {
  button:not(:disabled):hover { background: #edcf9d; }
  button.secondary:hover, .back:hover, .settings-button:hover { background: #354b3d; }
  button.danger:hover { background: #633b35; }
  a:hover { color: #fff0d6; }
}
[hidden], .hidden { display: none !important; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding-bottom: 28px; margin-bottom: 26px; border-bottom: 1px solid var(--line); }
.topbar > div:first-child { min-width: 0; }
.brand { color: var(--gold); font-size: 11px; letter-spacing: 2px; font-weight: 650; }
.subtitle { color: var(--muted); font-size: 14px; }
.top-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px; }
.back, .deepseek-button, .settings-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; font-size: 13px; font-weight: 600; }
.deepseek-button { background: #344333; border-color: #7d7952; color: var(--gold-soft); }
.settings-button[aria-expanded="true"] { border-color: var(--gold); color: var(--gold-soft); }
.panel { min-width: 0; padding: 26px; border: 1px solid var(--line); border-radius: 20px; background: linear-gradient(145deg, #1e2d26, #18241f); box-shadow: 0 12px 35px #00000014; margin-bottom: 20px; }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; margin-bottom: 22px; }
.panel-head h2 { margin-bottom: 5px; }
.panel-head p, .panel > p { color: var(--muted); font-size: 13px; line-height: 1.7; }
.panel-head > :first-child { min-width: 0; }
.panel-head > button { flex-shrink: 0; }
.eyebrow { color: var(--gold); font-size: 11px; letter-spacing: 1.8px; font-weight: 650; margin-bottom: 8px; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.grid .panel { margin-bottom: 0; }
.panel.wide { grid-column: 1 / -1; }
form { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.field { display: flex; flex-direction: column; gap: 7px; flex: 1 1 180px; min-width: 0; color: var(--muted); font-size: 13px; }
.field input { width: 100%; font-size: 16px; }
.search-row, .filters { display: flex; align-items: center; gap: 12px; margin: 0 0 22px; flex-wrap: wrap; }
.search-row input { width: min(460px, 100%); }
.filters .field { flex: 1 1 240px; }
.filters select { width: 100%; min-width: 0; font-size: 16px; }
.notice { margin: 12px 0; color: var(--gold-soft); font-size: 13px; overflow-wrap: anywhere; }
.notice:empty { display: none; }
.muted, .meta, .device-meta { color: var(--muted); font-size: 12px; }
.meta, .device-meta { margin-top: 5px; overflow-wrap: anywhere; }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; min-width: 900px; border-collapse: collapse; }
th, td { padding: 15px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; font-size: 13px; }
th { background: #16221b; color: #b9c9bd; font-size: 12px; font-weight: 500; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
td { overflow-wrap: anywhere; }
td input, td select { width: 128px; padding: 8px; font-size: 13px; }
td input[type="datetime-local"] { width: 170px; }
/* WebKit's native select ignores touch-target height unless appearance is reset. */
select, td select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 30px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: right 15px center, right 11px center;
  background-size: 4px 4px;
  background-repeat: no-repeat;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.id-cell, .identity { color: var(--gold-soft); font-variant-numeric: tabular-nums; font-weight: 600; letter-spacing: .5px; }
.device-name, .account-name { font-weight: 650; color: var(--text); }
.account-name { font-size: 15px; }
.call-total { margin-top: 10px; color: var(--gold-soft); }
.call-link { display: inline-flex; align-items: center; min-height: 44px; font-size: 13px; }
.status-pill, .tag, .state { display: inline-flex; align-items: center; align-self: flex-start; gap: 7px; padding: 4px 10px; border-radius: 20px; background: #254a36; color: var(--green); font-size: 12px; white-space: nowrap; }
.status-pill { margin-bottom: 8px; }
.status-pill.pending, .tag.pending { background: #4c4028; color: #f3d191; }
.status-pill.rejected, .status-pill.deleting, .tag.error, .state:not(.ok) { background: #4b2d2b; color: var(--red); }
.state::before { content: ""; width: 6px; height: 6px; background: currentColor; border-radius: 50%; }
.deletion-countdown { display: block; margin-bottom: 8px; font-size: 12px; color: var(--red); }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; min-width: 176px; }
.row-actions .details { width: 100%; order: 2; }
.row-actions .cancel-deletion { order: 3; }
.row-actions .save, .row-actions .remove { flex: 1; }
.device-summary, .metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 22px; }
.summary-item, .metric { min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: #15221b; }
.summary-label, .metric small { display: block; color: var(--muted); font-size: 12px; margin-bottom: 8px; }
.summary-value, .metric strong { color: var(--gold-soft); font-weight: 600; overflow-wrap: anywhere; }
.summary-value { font-size: 15px; }
.metric strong { font-size: 27px; font-variant-numeric: tabular-nums; line-height: 1.4; }
.metric:last-child strong { font-size: 14px; }
.time { font-variant-numeric: tabular-nums; color: #dde6df; }
.empty { text-align: center; color: var(--muted); padding: 32px 20px; }
.key-row { margin-top: 22px; flex-wrap: nowrap; align-items: stretch; }
.key-row input { flex: 1; min-width: 0; font-size: 16px; }
.key-row button { flex-shrink: 0; }
.toolbar { display: flex; gap: 10px; margin-top: 12px; }
.hint { margin-top: 16px !important; color: var(--muted); font-size: 12px !important; line-height: 1.8; }
.mask { color: var(--gold-soft); font-size: 18px; letter-spacing: 1px; overflow-wrap: anywhere; }
.balance { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-top: 8px; }
.balance-amount { font-size: 38px; font-weight: 600; color: var(--gold-soft); font-variant-numeric: tabular-nums; letter-spacing: -1px; }
.balance-unit { margin-left: 8px; color: var(--muted); font-size: 13px; }
.balance-status { color: var(--muted); font-size: 12px; }
.official-link { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 22px; padding: 18px; min-height: 76px; border: 1px solid #6c7050; border-radius: 12px; background: #2c3b2a; color: var(--gold-soft); text-decoration: none; }
.official-link strong, .official-link small { display: block; }
.official-link strong { font-size: 15px; font-weight: 600; }
.official-link small { color: #c2cfbe; font-size: 12px; margin-top: 4px; overflow-wrap: anywhere; }
.official-link > span:last-child { font-size: 24px; flex-shrink: 0; }
.user-note { color: var(--muted); font-size: 12px; line-height: 1.8; margin-bottom: 22px; }
.pagination { display: flex; gap: 10px; justify-content: flex-end; align-items: center; margin-top: 22px; color: var(--muted); font-size: 13px; }
.pagination > span { margin-right: auto; }
.toast { position: fixed; z-index: 10; right: max(20px, env(safe-area-inset-right)); bottom: max(20px, env(safe-area-inset-bottom)); max-width: min(360px, calc(100vw - 40px)); padding: 14px 18px; border: 1px solid #667b67; border-radius: 12px; background: #2a3d30; box-shadow: 0 8px 30px #0006; opacity: 0; transform: translateY(8px); pointer-events: none; transition: opacity .18s, transform .18s; overflow-wrap: anywhere; }
.toast.show { opacity: 1; transform: none; }
/* A single set of controls serves desktop tables and mobile cards. */
@media (max-width: 1100px) {
  .table-wrap { overflow: visible; border: 0; border-radius: 0; }
  table { display: block; min-width: 0; width: 100%; }
  thead { display: none; }
  tbody { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  tbody tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 14px; padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: #15221b; align-content: start; }
  tbody td { display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 0; border: 0; }
  tbody td::before { content: attr(data-label); color: var(--muted); font-size: 12px; font-weight: 400; letter-spacing: 0; }
  tbody td:empty::before { content: none; }
  tbody td.wide-field, tbody td.empty, tbody .id-cell { grid-column: 1 / -1; }
  tbody .id-cell { font-size: 20px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
  tbody .id-cell::before { font-size: 12px; }
  td input, td select, td input[type="datetime-local"] { width: 100%; min-width: 0; font-size: 16px; }
  td .muted { font-size: 12px; }
  .status-pill { margin-bottom: 0; }
  .row-actions { min-width: 0; padding-top: 14px; border-top: 1px solid var(--line); }
  tbody tr:has(> .empty) { grid-column: 1 / -1; }
  .device-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  main { padding: 24px max(16px, env(safe-area-inset-right)) max(40px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
  h1 { font-size: 27px; }
  .topbar { flex-direction: column; align-items: stretch; gap: 18px; margin-bottom: 20px; padding-bottom: 22px; }
  .brand { font-size: 10px; letter-spacing: 1.6px; }
  .top-actions { justify-content: flex-start; }
  .top-actions > * { flex: 1; }
  .back { align-self: flex-start; }
  .panel { padding: 20px; border-radius: 16px; }
  .grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .panel-head { flex-wrap: wrap; gap: 14px; margin-bottom: 20px; }
  .panel-head > button { min-height: 44px; }
  .search-row { align-items: stretch; gap: 8px; }
  .search-row input { width: 100%; font-size: 16px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .metric, .summary-item { padding: 14px; }
  .metric strong { font-size: 24px; }
  .filters { flex-direction: column; align-items: stretch; }
  .filters .field { flex: auto; }
  .field { flex-basis: 100%; }
  .key-row { flex-direction: column; }
  .key-row button { width: 100%; }
  .pagination { flex-wrap: wrap; }
  .pagination > span { width: 100%; }
  .pagination button { flex: 1; }
  input, select { font-size: 16px; }
  form > button { width: 100%; }
}
@media (max-width: 700px) {
  tbody { grid-template-columns: minmax(0, 1fr); }
  tbody tr { padding: 16px; }
  .device-summary { gap: 10px; }
  .official-link { padding: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
