/* 2048tools 定制：对齐 calc 深色主题，仅保留计算器主体并居中 */
:root {
  --bg: #020617;
  --surface: #0f172a;
  --panel: #1e293b;
  --border: rgba(148, 163, 184, 0.18);
  --text: #f1f5f9;
  --muted: #94a3b8;
  --accent: #6366f1;
  --accent2: #22c55e;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 24px 56px rgba(0, 0, 0, 0.65);
}

.header,
.footer,
.side,
.use-help,
#business_atc_recmd_mod,
#PAF_atc_recmd_mod,
#repay_atc_recmd_mod,
[wrap="t15"],
.calculator > [view="calc_input"] > .ui-bar[skin="title"],
.calculator > [view="calc_input"] > .ui-bar[skin~="title"] {
  display: none !important;
}

* {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
  color-scheme: dark;
}

body {
  background: var(--bg) !important;
  color: var(--text) !important;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif !important;
  font-size: 14px !important;
  min-height: 100vh;
  margin: 0;
  padding: 24px 16px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.page-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.page-content {
  width: 100%;
  max-width: 520px;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  width: 100%;
}

.title-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.badge {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  color: var(--muted);
  background: radial-gradient(circle at top, rgba(148, 163, 184, 0.2), rgba(15, 23, 42, 0.9));
  text-transform: uppercase;
  letter-spacing: 0.08em;
  flex-shrink: 0;
}

.page-header h1 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  background: linear-gradient(135deg, #818cf8, #6366f1, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0;
}

.meta {
  flex-shrink: 0;
  font-size: 12px;
  color: var(--muted);
  padding-top: 4px;
}

.meta a {
  color: #93c5fd;
  text-decoration: none;
  white-space: nowrap;
}

.meta a:hover {
  text-decoration: underline;
}

.container {
  width: 100% !important;
  max-width: 520px;
  margin: 0 auto !important;
  float: none !important;
}

.calculator {
  float: none !important;
  width: 100% !important;
  margin: 0 auto !important;
  background: var(--surface) !important;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* ── Tabs（对齐 calc mode-toggle）── */
.switch-tabs {
  padding: 12px 14px !important;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}

.switch-tabs ul {
  height: auto !important;
  line-height: normal !important;
  border-radius: 20px !important;
  border: none !important;
  background: rgba(0, 0, 0, 0.3) !important;
  overflow: hidden;
  gap: 0;
}

.big-switch-tabs ul {
  height: auto !important;
  line-height: normal !important;
}

.switch-tabs li {
  border: none !important;
  margin: 0 !important;
  flex: 1;
}

.switch-tabs li div,
.switch-tabs li a {
  padding: 7px 6px !important;
  font-size: 0.76rem !important;
  font-weight: 600;
  color: var(--muted) !important;
  text-align: center;
  transition: background 0.2s, color 0.2s;
}

.switch-tabs .select-tab div,
.switch-tabs .select-tab a,
.switch-tabs li.select-tab div {
  background: var(--accent) !important;
  color: #fff !important;
}

.switch-tabs .normal-tab div,
.switch-tabs .normal-tab a,
.switch-tabs .result-tab.normal-tab a {
  background: transparent !important;
  color: var(--muted) !important;
}

.switch-tabs .result-tab.select-tab a,
.result-tab.select-tab a {
  background: var(--accent) !important;
  color: #fff !important;
}

.switch-tabs .result-tab a {
  display: block;
  padding: 7px 6px !important;
  font-size: 0.82rem !important;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  border-radius: 20px;
  transition: background 0.2s, color 0.2s;
}

/* ── Form fields ── */
.input-fields {
  padding: 4px 0 0 !important;
  background: var(--surface);
}

.input-fields ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.field-wrap {
  display: flex;
  align-items: center;
  padding: 10px 16px !important;
  border-bottom: 1px solid var(--border);
  min-height: 52px;
}

.field-wrap > label {
  flex: 0 0 72px;
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 500;
}

.field-wrap .field {
  flex: 1;
  min-width: 0;
}

.field-wrap .long-field {
  flex: 1.4;
}

.field-wrap .short-field {
  flex: 0.8;
  margin-left: 8px;
}

.ui-text,
.ui-text .filed-error,
[view] {
  background-color: #172035 !important;
}

/* ── Select 下拉：隐藏装饰条，直接显示深色原生 select ── */
.ui-select {
  height: 36px !important;
  border: none !important;
  border-radius: var(--radius-sm) !important;
  overflow: visible !important;
  background: transparent !important;
  position: relative;
}

.ui-select .value-bar {
  display: none !important;
}

.ui-select select {
  opacity: 1 !important;
  filter: none !important;
  position: relative !important;
  left: auto !important;
  top: auto !important;
  width: 100% !important;
  height: 36px !important;
  padding: 0 32px 0 10px !important;
  margin: 0 !important;
  background-color: #172035 !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M2 4l4 4 4-4'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 10px center !important;
  color: var(--text) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-sm) !important;
  font-size: 0.88rem !important;
  font-family: inherit !important;
  cursor: pointer;
  -webkit-appearance: none !important;
  appearance: none !important;
  color-scheme: dark;
}

.ui-select select:focus {
  outline: none;
  border-color: rgba(99, 102, 241, 0.55) !important;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.ui-select select option {
  background: #1e293b !important;
  color: #f1f5f9 !important;
}

.ui-select select option:checked,
.ui-select select option:hover {
  background: #334155 !important;
  color: #fff !important;
}

.ui-text {
  width: 100% !important;
  margin: 0 !important;
  height: 36px !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-sm) !important;
  overflow: hidden;
}

.ui-text input {
  background: transparent !important;
  color: var(--text) !important;
  height: 34px !important;
  padding: 0 36px 0 10px !important;
  font-size: 0.95rem !important;
}

.ui-text:after,
.rate-text:before {
  color: var(--muted) !important;
}

.repay-method {
  font-size: 0.85rem !important;
  color: var(--text) !important;
  cursor: pointer;
}

.repay-method input[type="radio"] {
  accent-color: var(--accent);
}

/* ── Calculate button ── */
.calbtn-wrap {
  padding: 14px 16px 16px !important;
  background: var(--surface);
}

.calbtn-wrap .ui-btn[skin~="blue"],
.calbtn-wrap .ui-btn[skin~="full"],
#calculate,
#recalculate,
.recal-btn .ui-btn[skin~="blue"] {
  width: 100% !important;
  height: 44px !important;
  line-height: 44px !important;
  margin: 0 !important;
  border: none !important;
  border-radius: var(--radius-sm) !important;
  background: var(--accent2) !important;
  color: #fff !important;
  font-size: 1rem !important;
  font-weight: 700 !important;
  text-shadow: none !important;
  cursor: pointer;
  transition: filter 0.15s, transform 0.1s;
}

.calbtn-wrap .ui-btn[skin~="blue"]:hover,
#calculate:hover,
#recalculate:hover {
  filter: brightness(1.08);
}

.calbtn-wrap .ui-btn[skin~="blue"]:active,
#calculate:active {
  transform: scale(0.99);
}

/* ── Result view ── */
.calc-result .ui-bar[skin~="title"],
.calc-result header.ui-bar {
  background: var(--panel) !important;
  border-top: none !important;
  border-bottom: 1px solid var(--border) !important;
}

.calc-result .ui-bar[skin~="title"] .title,
.calc-result h1.title {
  color: var(--text) !important;
  text-shadow: none !important;
  line-height: 45px !important;
}

.calc-result .ui-btn[skin~="back"] {
  background: rgba(99, 102, 241, 0.2) !important;
  border: 1px solid rgba(99, 102, 241, 0.35) !important;
  border-radius: 6px !important;
  color: var(--text) !important;
  font-size: 0.78rem !important;
  height: 30px !important;
  line-height: 30px !important;
  left: 8px !important;
}

.calc-result .ui-btn[skin~="back"]:before,
.calc-result .ui-btn[skin~="back"]:after {
  display: none !important;
}

.result-list {
  background: var(--surface);
}

.result-list li {
  border-bottom: 1px solid var(--border) !important;
  color: var(--text) !important;
}

.result-list .group-tit {
  background: var(--panel) !important;
  color: var(--muted) !important;
  font-size: 0.78rem !important;
  font-weight: 600;
  letter-spacing: 0.04em;
  height: auto !important;
  line-height: 1.4 !important;
  padding: 10px 12px !important;
  border-bottom: 1px solid var(--border) !important;
}

.group-tit {
  background: var(--panel) !important;
  color: var(--muted) !important;
  font-size: 0.78rem !important;
  font-weight: 600;
  letter-spacing: 0.04em;
  height: auto !important;
  line-height: 1.4 !important;
  padding: 10px 12px !important;
  border-bottom: 1px solid var(--border) !important;
  box-shadow: none !important;
}

.result-list .item-name {
  color: var(--muted) !important;
}

.result-list .item-value {
  color: var(--accent2) !important;
  font-weight: 600;
}

.data-container {
  background: var(--surface);
  padding: 0 12px 12px !important;
}

.data-container .group-tit {
  background: var(--panel) !important;
  color: var(--muted) !important;
  padding: 10px 12px !important;
  border-bottom: 1px solid var(--border) !important;
  margin: 0 !important;
}

.data-table {
  width: 100%;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.data-table thead th {
  background: var(--panel) !important;
  color: var(--muted) !important;
  border-color: var(--border) !important;
  font-size: 0.75rem !important;
  font-weight: 600;
  padding: 8px 6px !important;
}

.data-table tbody td {
  background: #172035 !important;
  color: var(--text) !important;
  border-color: var(--border) !important;
  font-size: 0.78rem !important;
  padding: 7px 6px !important;
}

.data-table.table-striped tbody tr:nth-child(even) td {
  background: rgba(15, 23, 42, 0.6) !important;
}

.view-more {
  margin-top: 8px;
  padding: 10px 12px !important;
  background: rgba(99, 102, 241, 0.12) !important;
  border: 1px solid rgba(99, 102, 241, 0.25) !important;
  border-radius: var(--radius-sm);
  color: #93c5fd !important;
  cursor: pointer;
  box-shadow: none !important;
  border-bottom: 1px solid rgba(99, 102, 241, 0.25) !important;
}

.view-more.hover {
  background: rgba(99, 102, 241, 0.2) !important;
}

.view-more .txt {
  color: #93c5fd !important;
}

.recal-btn {
  padding: 0 16px 16px !important;
}

#data_detail_bar .ui-bar[skin~="title"] {
  display: block !important;
  background: var(--panel) !important;
  border-bottom: 1px solid var(--border) !important;
}

.data-detail {
  background: var(--surface);
}

@media (min-width: 768px) {
  .header {
    display: none !important;
  }

  .container {
    width: 100% !important;
    max-width: 520px;
  }

  .calculator {
    width: 100% !important;
    margin: 0 auto !important;
  }

  .side {
    display: none !important;
  }

  .ui-bar[skin~="title"] {
    background: var(--panel) !important;
    border-top: none !important;
    border-bottom: 1px solid var(--border) !important;
  }
}

@media (max-width: 600px) {
  .page-header {
    flex-direction: column;
    gap: 10px;
  }

  .meta {
    padding-top: 0;
  }

  .field-wrap {
    flex-wrap: wrap;
    gap: 6px;
  }

  .field-wrap > label {
    flex: 0 0 100%;
  }

  .switch-tabs li div,
  .switch-tabs li a {
    font-size: 0.7rem !important;
    padding: 8px 4px !important;
  }
}

.page-footer {
  text-align: center;
  color: rgba(148, 163, 184, 0.4);
  font-size: 0.75rem;
  margin-top: 20px;
  padding-bottom: 8px;
  flex-shrink: 0;
}
