:root {
  --canvas: #f7f8fc;
  --surface: #ffffff;
  --surface-soft: #fafbfe;
  --surface-hover: #f3f1ff;
  --line: #e2e5ee;
  --line-strong: #cbd1df;
  --ink: #11172a;
  --ink-soft: #343b50;
  --muted: #596176;
  --placeholder: #6d7487;
  --nav: #ffffff;
  --nav-raised: #f1efff;
  --nav-line: #e5e7f0;
  --nav-text: #171b2d;
  --nav-muted: #60687b;
  --primary: #6854e8;
  --primary-strong: #5843d0;
  --primary-soft: #efedff;
  --cyan: #21cbe3;
  --success: #16815d;
  --success-soft: #e8f6f0;
  --warning: #b76b14;
  --warning-soft: #fff4df;
  --danger: #cf3f4c;
  --danger-soft: #fff0f1;
  --neutral-soft: #eef1f6;
  --radius-sm: 7px;
  --radius: 10px;
  --radius-lg: 12px;
  --field-short: 176px;
  --field-medium: 340px;
  --field-long: 760px;
  --shadow-overlay: 0 20px 56px rgba(35, 39, 67, 0.16);
  --font-sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --z-sidebar: 20;
  --z-topbar: 30;
  --z-modal: 100;
  --z-toast: 120;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  color-scheme: light;
  background: var(--canvas);
}

html,
body {
  width: 100%;
  min-height: 100dvh;
}

body {
  overflow-x: hidden;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  border: 0;
}

a {
  color: inherit;
}

img,
svg {
  display: block;
}

svg {
  flex-shrink: 0;
}

::selection {
  background: rgba(104, 84, 232, 0.2);
}

:focus-visible {
  outline: 3px solid rgba(104, 84, 232, 0.28);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
}

.app-page {
  background: var(--canvas);
}

.admin-shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100dvh;
}

.admin-sidebar {
  position: sticky;
  top: 0;
  z-index: var(--z-sidebar);
  display: flex;
  height: 100dvh;
  min-height: 0;
  flex-direction: column;
  background: var(--nav);
  color: var(--nav-text);
  border-right: 1px solid var(--nav-line);
  padding: 20px 14px 16px;
}

.sidebar-brand {
  display: flex;
  min-height: 48px;
  align-items: center;
  gap: 12px;
  color: var(--nav-text);
  text-decoration: none;
}

.app-logo {
  object-fit: cover;
}

.app-logo-sidebar {
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.brand-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  line-height: 1.2;
}

.brand-copy strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.brand-copy small {
  margin-top: 4px;
  color: var(--nav-muted);
  font-size: 11px;
  font-weight: 560;
}

.sidebar-nav {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 5px;
  margin-top: 30px;
}

.sidebar-nav a {
  display: flex;
  min-height: 42px;
  align-items: center;
  gap: 11px;
  border-radius: var(--radius);
  color: var(--nav-muted);
  padding: 9px 11px;
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
  transition: background 180ms cubic-bezier(0.22, 1, 0.36, 1), color 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

.sidebar-nav a:hover {
  background: var(--nav-raised);
  color: var(--primary-strong);
}

.sidebar-nav a.active {
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.nav-icon {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.sidebar-nav a:first-child .nav-icon path {
  fill: currentColor;
  stroke: none;
}

.sidebar-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-top: 1px solid var(--nav-line);
  padding: 15px 2px;
}

.sidebar-section-label {
  color: var(--muted);
  padding: 0 9px 5px;
  font-size: 11px;
  font-weight: 650;
}

.sidebar-action {
  display: flex;
  min-height: 34px;
  align-items: center;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--nav-muted);
  cursor: pointer;
  padding: 7px 9px;
  font-size: 12px;
  font-weight: 620;
  text-align: left;
  text-decoration: none;
  transition: background 160ms ease, color 160ms ease;
}

.sidebar-action:hover,
.sidebar-action.active {
  background: var(--nav-raised);
  color: var(--primary-strong);
}

.sidebar-user {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border-top: 1px solid var(--nav-line);
  padding: 15px 4px 0;
}

.user-avatar {
  display: inline-flex;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 13px;
  font-weight: 760;
}

.sidebar-user-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.sidebar-user-copy strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  font-weight: 680;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-user-copy small {
  color: var(--nav-muted);
  font-size: 11px;
}

.sidebar-user-settings {
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--nav-muted);
  cursor: pointer;
  padding: 6px;
  font-size: 11px;
  text-decoration: none;
}

.sidebar-user-settings:hover {
  background: var(--nav-raised);
  color: var(--primary-strong);
}

.admin-main {
  min-width: 0;
  height: 100dvh;
  overflow: auto;
  padding: 0 32px 44px;
}

.app-topbar {
  position: sticky;
  top: 0;
  z-index: var(--z-topbar);
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid rgba(223, 227, 236, 0.9);
  background: rgba(247, 248, 252, 0.96);
}

.topbar-context,
.topbar-actions {
  display: flex;
  align-items: center;
}

.topbar-context {
  min-width: 0;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.topbar-context strong {
  overflow: hidden;
  color: var(--ink);
  font-weight: 680;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-separator {
  color: #a4aaba;
}

.topbar-actions {
  gap: 4px;
}

.utility-button {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 7px 9px;
  font-size: 12px;
  font-weight: 620;
  text-decoration: none;
}

.utility-button:hover {
  background: var(--surface);
  color: var(--ink);
}

.inline-form {
  display: inline-flex;
}

.module-view {
  display: none;
}

.module-view.is-active {
  display: block;
}

.page-heading {
  display: flex;
  min-height: 112px;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 0 22px;
}

.page-heading-copy {
  min-width: 0;
}

.page-heading h1 {
  color: var(--ink);
  font-size: 25px;
  font-weight: 760;
  letter-spacing: -0.02em;
  line-height: 1.2;
  text-wrap: balance;
}

.page-heading p {
  max-width: 70ch;
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  text-wrap: pretty;
}

.page-actions,
.surface-actions,
.button-row,
.form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink-soft);
  cursor: pointer;
  padding: 8px 13px;
  font-size: 13px;
  font-weight: 660;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.btn:hover:not(:disabled) {
  border-color: #b8bfce;
  background: var(--surface-soft);
  color: var(--ink);
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.btn-primary,
.btn-accent {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover:not(:disabled),
.btn-accent:hover:not(:disabled) {
  border-color: var(--primary-strong);
  background: var(--primary-strong);
  color: #fff;
}

.btn-secondary {
  background: var(--surface);
}

.btn-quiet {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}

.btn-quiet:hover:not(:disabled) {
  border-color: transparent;
  background: var(--surface-soft);
}

.btn-danger,
.btn-danger-solid {
  border-color: var(--danger);
  background: var(--danger);
  color: #fff;
}

.btn-danger:hover:not(:disabled),
.btn-danger-solid:hover:not(:disabled) {
  border-color: #b7313d;
  background: #b7313d;
  color: #fff;
}

.btn-danger-quiet {
  border-color: transparent;
  background: transparent;
  color: var(--danger);
}

.btn-danger-quiet:hover:not(:disabled) {
  border-color: #f0c9cd;
  background: var(--danger-soft);
  color: #a92f3a;
}

.btn-sm {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 12px;
}

.no-wrap {
  white-space: nowrap;
}

.workspace-surface,
.admin-panel,
.admin-section {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.surface-header {
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  padding: 16px 18px;
}

.surface-header h2,
.chart-heading h2 {
  color: var(--ink);
  font-size: 15px;
  font-weight: 720;
  line-height: 1.3;
}

.surface-header p,
.chart-heading p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.text-link {
  flex-shrink: 0;
  color: var(--primary-strong);
  font-size: 12px;
  font-weight: 670;
  text-decoration: none;
}

.text-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.health-summary {
  display: grid;
  grid-template-columns: minmax(290px, 0.9fr) minmax(520px, 1.4fr);
  align-items: center;
  gap: 30px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--ink);
  padding: 22px 24px;
}

.health-lead {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  gap: 13px;
}

.health-indicator {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 5px rgba(22, 129, 93, 0.2);
}

.health-summary.has-issues .health-indicator {
  background: #f2a33a;
  box-shadow: 0 0 0 5px rgba(242, 163, 58, 0.18);
}

.health-lead h2 {
  color: var(--ink);
  font-size: 17px;
  font-weight: 720;
  line-height: 1.35;
  text-wrap: balance;
}

.health-lead p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.health-facts {
  display: grid;
  grid-template-columns: repeat(5, minmax(76px, 1fr));
  min-width: 0;
}

.health-facts > div {
  min-width: 0;
  border-left: 1px solid var(--line);
  padding: 2px 15px;
}

.health-facts dt {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.health-facts dd {
  margin-top: 4px;
  color: var(--ink);
  font-size: 22px;
  font-weight: 740;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}

.health-facts dd.is-warning {
  color: var(--warning);
}

.health-facts dd.is-danger {
  color: var(--danger);
}

.workbench-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.7fr);
  gap: 14px;
  align-items: start;
  margin-top: 14px;
}

.attention-list {
  min-height: 112px;
}

.attention-item {
  display: grid;
  grid-template-columns: 10px minmax(0, 1.35fr) minmax(150px, 0.8fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 66px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  padding: 11px 18px;
  text-decoration: none;
  transition: background 160ms ease;
}

.attention-item:last-child {
  border-bottom: 0;
}

.attention-item:hover {
  background: var(--surface-soft);
}

.status-dot,
.proxy-status {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.status-expired,
.status-dot.status-expired {
  background: var(--danger);
}

.status-expiring,
.status-low_traffic,
.status-dot.status-expiring,
.status-dot.status-low_traffic {
  background: var(--warning);
}

.status-unknown,
.status-dot.status-unknown {
  background: #8790a6;
}

.attention-account,
.attention-reason {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.attention-account strong,
.attention-reason strong {
  overflow: hidden;
  font-size: 13px;
  font-weight: 680;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attention-account small,
.attention-reason small {
  overflow: hidden;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attention-reason {
  text-align: right;
}

.attention-reason strong {
  color: var(--ink-soft);
  font-size: 12px;
}

.attention-arrow {
  color: #9ca3b5;
  font-size: 15px;
}

.empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--muted);
  padding: 28px 20px;
  text-align: left;
}

.empty-state.compact {
  min-height: 132px;
  justify-content: flex-start;
  padding: 24px 18px;
}

.empty-state-mark {
  display: inline-flex;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--success-soft);
  color: var(--success);
  font-weight: 800;
}

.empty-state strong {
  color: var(--ink-soft);
  font-size: 13px;
}

.empty-state p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.notice-list {
  max-height: 330px;
  overflow-y: auto;
}

.notice-item {
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background 160ms ease;
}

.notice-item:last-child {
  border-bottom: 0;
}

.notice-item:hover {
  background: var(--surface-soft);
}

.notice-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 14px;
  align-items: center;
  gap: 9px;
  padding: 13px 16px;
}

.notice-title {
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 660;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notice-date {
  color: #737b8e;
  font-size: 11px;
  white-space: nowrap;
}

.notice-arrow {
  position: relative;
  width: 14px;
  height: 14px;
  color: #8c94a8;
  transition: transform 160ms ease;
}

.notice-arrow::before {
  position: absolute;
  top: 3px;
  left: 4px;
  width: 5px;
  height: 5px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  content: "";
  transform: rotate(45deg);
}

.notice-item.active .notice-arrow {
  transform: rotate(180deg);
}

.notice-body {
  overflow: hidden;
  margin: 0 16px;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  padding: 12px 0 15px;
  font-size: 12px;
  line-height: 1.7;
  word-break: break-word;
}

.notice-body[hidden] {
  display: none !important;
}

.notice-body p {
  margin: 0 0 7px;
}

.notice-body p:last-child {
  margin-bottom: 0;
}

.notice-body img {
  max-width: 100%;
  height: auto;
  margin: 8px 0;
  border-radius: var(--radius-sm);
}

.notice-body a {
  color: var(--primary-strong);
}

.notice-empty,
.coupon-empty,
.proxy-empty,
.config-loading,
.chart-empty,
.muted-center {
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.notice-empty,
.coupon-empty,
.proxy-empty,
.config-loading {
  display: grid;
  min-height: 96px;
  place-items: center;
  padding: 18px;
}

.quick-routes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 20px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.quick-routes a {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
  border-right: 1px solid var(--line);
  padding: 14px 18px;
  text-decoration: none;
  transition: background 160ms ease;
}

.quick-routes a:last-child {
  border-right: 0;
}

.quick-routes a:hover {
  background: var(--surface);
}

.quick-routes strong {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 680;
}

.quick-routes span {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.operations-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.75fr);
  align-items: start;
  gap: 16px;
}

.operation-panel {
  min-width: 0;
  overflow: hidden;
}

.operation-panel-header {
  min-height: 92px;
}

.operation-type {
  display: block;
  margin-bottom: 4px;
  color: var(--primary-strong);
  font-size: 11px;
  font-weight: 700;
}

.subscription-workspace {
  min-height: 184px;
  padding: 26px 22px 24px;
}

.subscription-label {
  display: block;
  margin-bottom: 8px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 680;
}

.subscription-control {
  display: grid;
  width: min(100%, 820px);
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  min-width: 0;
}

.subscription-control input {
  min-width: 0;
  font-family: var(--font-mono);
  font-size: 12px;
}

.subscription-note {
  max-width: 62ch;
  margin-top: 10px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.coupon-list {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.renewal-panel .coupon-empty {
  min-height: 184px;
}

.coupon-item {
  display: flex;
  min-height: 64px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  padding: 11px 18px;
}

.coupon-item:last-child {
  border-bottom: 0;
}

.coupon-item.active {
  background: #faf9ff;
}

.coupon-item-info {
  min-width: 0;
}

.coupon-item-code {
  overflow: hidden;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.coupon-item-remark {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.coupon-item-actions {
  display: flex;
  flex-shrink: 0;
  gap: 5px;
}

input,
textarea,
select,
.search-box {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
}

input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
textarea,
select {
  width: 100%;
  min-height: 40px;
  border-radius: var(--radius-sm);
  padding: 8px 11px;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

input[type="checkbox"],
input[type="radio"] {
  width: 16px;
  min-width: 16px;
  max-width: 16px;
  height: 16px;
  min-height: 16px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 3px;
  background: transparent;
  accent-color: var(--primary);
  cursor: pointer;
  vertical-align: middle;
  box-shadow: none;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):focus,
textarea:focus,
select:focus,
.search-box:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(104, 84, 232, 0.13);
  outline: none;
}

input[type="checkbox"]:focus,
input[type="radio"]:focus {
  outline: 2px solid rgba(104, 84, 232, 0.35);
  outline-offset: 2px;
  box-shadow: none;
}

input::placeholder,
textarea::placeholder {
  color: var(--placeholder);
  opacity: 1;
}

input[readonly],
.readonly-input {
  background: var(--surface-soft);
  color: var(--muted);
}

.table-container {
  min-height: 0;
}

.table-toolbar {
  display: grid;
  grid-template-columns: auto minmax(220px, 420px) auto;
  align-items: center;
  gap: 16px;
  min-height: 64px;
  border-bottom: 1px solid var(--line);
  padding: 11px 14px;
}

.account-filters {
  display: flex;
  align-items: center;
  gap: 2px;
  overflow-x: auto;
}

.filter-button {
  min-height: 34px;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 630;
  white-space: nowrap;
}

.filter-button:hover {
  background: var(--surface-soft);
  color: var(--ink);
}

.filter-button.active {
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.search-box {
  display: flex;
  min-height: 38px;
  align-items: center;
  gap: 8px;
  border-radius: var(--radius-sm);
  padding: 6px 10px;
}

.search-box svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: var(--muted);
  stroke-linecap: round;
  stroke-width: 1.8;
}

.search-box input {
  min-height: 24px;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  font-size: 12px;
}

.search-box input:focus {
  box-shadow: none;
}

.result-count {
  color: var(--muted);
  font-size: 11px;
  text-align: right;
  white-space: nowrap;
}

.table-wrapper {
  overflow: auto;
  background: var(--surface);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  font-size: 12px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 10px 13px;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

th {
  height: 40px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 11px;
  font-weight: 690;
  user-select: none;
}

td {
  height: 54px;
}

tr:last-child td {
  border-bottom: 0;
}

tbody tr[data-id]:hover td {
  background: #fbfbfe;
}

tr.disabled td {
  background: #fafbfc;
  color: #7b8293;
  opacity: 0.7;
}

th.sortable {
  position: relative;
  cursor: pointer;
  padding-right: 23px;
}

th.sortable:hover {
  color: var(--ink);
}

th.sortable::after {
  position: absolute;
  top: 50%;
  right: 9px;
  width: 5px;
  height: 5px;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  content: "";
  opacity: 0.42;
  transform: translateY(-70%) rotate(45deg);
}

th.sortable.sort-asc::after {
  opacity: 0.9;
  transform: translateY(-20%) rotate(225deg);
}

th.sortable.sort-desc::after {
  opacity: 0.9;
}

.align-right,
.cell-actions {
  text-align: right;
}

.account-info,
.expire-info,
.traffic-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.account-email {
  max-width: 300px;
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  font-weight: 680;
  text-overflow: ellipsis;
}

.account-remark,
.expire-days,
.traffic-total,
.traffic-divider,
.no-subscribe,
.plan-name {
  color: var(--muted);
  font-size: 11px;
}

.plan-name {
  color: var(--ink-soft);
  font-size: 12px;
}

.traffic-info {
  min-width: 148px;
}

.traffic-text {
  display: flex;
  align-items: center;
  gap: 3px;
  font-family: var(--font-mono);
  font-size: 11px;
  white-space: nowrap;
}

.traffic-used {
  color: var(--ink-soft);
  font-weight: 680;
}

.progress {
  overflow: hidden;
  width: 100%;
  max-width: 148px;
  height: 5px;
  border-radius: 999px;
  background: #e7e9f0;
}

.progress-bar {
  height: 100%;
  border-radius: 999px;
  transition: width 220ms ease;
}

.progress-bar.high {
  background: var(--success);
}

.progress-bar.medium {
  background: var(--warning);
}

.progress-bar.low {
  background: var(--danger);
}

.expire-date {
  color: var(--ink-soft);
  font-size: 12px;
}

.badge,
.badge-admin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  white-space: nowrap;
}

.badge {
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.45;
}

.badge-success {
  background: var(--success-soft);
  color: #0d6749;
}

.badge-warning {
  background: var(--warning-soft);
  color: #86500c;
}

.badge-danger {
  background: var(--danger-soft);
  color: #a62e39;
}

.badge-secondary {
  background: var(--neutral-soft);
  color: #555e71;
}

.badge-admin {
  background: var(--primary-soft);
  color: var(--primary-strong);
  padding: 2px 7px;
  font-size: 10px;
  font-weight: 720;
}

.btn-copy,
.btn-icon {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink-soft);
  cursor: pointer;
  padding: 5px 8px;
  font-size: 11px;
  font-weight: 650;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease;
}

.btn-copy:hover,
.btn-copy.copied,
.btn-icon:hover {
  border-color: #c8c1fb;
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.btn-icon::before {
  content: attr(title);
}

.btn-icon svg {
  display: none;
}

.btn-icon-danger:hover {
  border-color: #f0c3c7;
  background: var(--danger-soft);
  color: var(--danger);
}

.btn-icon-warning {
  color: var(--warning);
}

.btn-icon-warning:hover {
  border-color: #f0d2a6;
  background: var(--warning-soft);
  color: #8b510b;
}

.actions {
  display: flex;
  justify-content: flex-end;
  gap: 5px;
  white-space: nowrap;
}

.table-empty {
  padding: 0;
}

.traffic-panel {
  display: none;
}

.traffic-overview {
  padding: 20px 22px;
}

.traffic-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 18px;
}

.traffic-item {
  border-right: 1px solid var(--line);
  padding: 0 18px;
}

.traffic-item:first-child {
  padding-left: 0;
}

.traffic-item:last-child {
  border-right: 0;
}

.traffic-label {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 11px;
}

.traffic-value {
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 19px;
  font-weight: 730;
  font-variant-numeric: tabular-nums;
}

.traffic-value.highlight {
  color: var(--primary-strong);
}

.traffic-progress-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.traffic-progress-bar {
  overflow: hidden;
  flex: 1;
  height: 7px;
  border-radius: 999px;
  background: #e6e8ef;
}

.traffic-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--primary);
  transition: width 240ms ease;
}

.traffic-percent {
  min-width: 48px;
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  text-align: right;
}

.chart-container {
  position: relative;
  min-height: 360px;
  border-top: 1px solid var(--line);
  padding: 18px 22px 20px;
}

.chart-heading {
  margin-bottom: 12px;
}

.chart-container canvas {
  max-width: 100% !important;
  max-height: 292px !important;
}

.chart-empty {
  position: absolute;
  top: 54%;
  left: 50%;
  width: calc(100% - 44px);
  transform: translate(-50%, -50%);
}

.traffic-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
}

.chart-container-small {
  min-width: 0;
  min-height: 238px;
  border-right: 1px solid var(--line);
  padding: 18px;
  text-align: center;
}

.chart-container-small:last-child {
  border-right: 0;
}

.chart-container-small h3 {
  margin-bottom: 12px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 680;
  text-align: left;
}

.chart-container-small canvas {
  max-width: 164px !important;
  max-height: 164px !important;
  margin: 0 auto;
}

.system-console {
  display: grid;
  width: 100%;
  grid-template-columns: minmax(300px, 0.68fr) minmax(620px, 1.55fr);
  align-items: start;
  gap: 16px;
}

.proxy-panel,
.config-panel {
  min-width: 0;
}

.proxy-list {
  display: flex;
  flex-direction: column;
}

.proxy-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px 18px;
  min-height: 64px;
  border-bottom: 1px solid var(--line);
  padding: 11px 18px;
}

.proxy-item:last-child {
  border-bottom: 0;
}

.proxy-info {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
}

.proxy-status {
  flex-shrink: 0;
}

.proxy-status.healthy {
  background: var(--success);
}

.proxy-status.unhealthy {
  background: var(--danger);
}

.proxy-status.disabled {
  background: #949bad;
}

.proxy-url {
  overflow: hidden;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.proxy-name,
.proxy-meta {
  color: var(--muted);
  font-size: 11px;
}

.proxy-meta {
  grid-column: 1;
}

.proxy-actions {
  display: flex;
  grid-column: 2;
  grid-row: 1 / span 2;
  gap: 6px;
}

.config-form {
  display: flex;
  flex-direction: column;
}

/* ==================== 赠送节点页（上下布局） ==================== */

.bonus-stack {
  display: flex;
  width: 100%;
  flex-direction: column;
  gap: 16px;
}

.bonus-sources-panel,
.bonus-nodes-panel {
  min-width: 0;
  width: 100%;
}

.bonus-list {
  display: flex;
  flex-direction: column;
  max-height: 280px;
  overflow: auto;
}

.bonus-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px 16px;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

.bonus-item:last-child {
  border-bottom: 0;
}

.bonus-item.is-selected {
  background: var(--primary-soft);
}

.bonus-source-btn {
  display: flex;
  width: 100%;
  min-width: 0;
  align-items: flex-start;
  gap: 10px;
  border: 0;
  background: transparent;
  padding: 0;
  text-align: left;
  cursor: pointer;
  color: inherit;
  font: inherit;
}

.bonus-source-btn:hover strong {
  color: var(--primary-strong);
}

.bonus-dot {
  width: 8px;
  height: 8px;
  margin-top: 6px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--muted);
}

.bonus-dot.good { background: var(--success); }
.bonus-dot.warn { background: var(--warning); }
.bonus-dot.bad { background: var(--danger); }
.bonus-dot.off { background: var(--line-strong); }

.bonus-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.bonus-copy strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 720;
}

.bonus-url,
.bonus-meta,
.bonus-msg {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
  word-break: break-all;
}

.bonus-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.bonus-nodes-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 12px 18px;
  background: var(--surface-soft);
}

.bonus-filter-group {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.bonus-filter-chip {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}

.bonus-filter-chip:hover {
  border-color: var(--primary);
  color: var(--ink);
}

.bonus-filter-chip.is-active {
  border-color: transparent;
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.bonus-scope-hint {
  color: var(--muted);
  font-size: 12px;
}

.bonus-nodes-body {
  min-height: 280px;
  padding: 14px 18px 18px;
}

.bonus-node-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 14px;
  margin-bottom: 12px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 620;
}

.bonus-node-stats-hint {
  color: var(--muted);
  font-weight: 500;
}

.bonus-node-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.bonus-node-table {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
  table-layout: fixed;
}

.bonus-node-table col.col-check { width: 48px; }
.bonus-node-table col.col-status { width: 72px; }
.bonus-node-table col.col-name { width: auto; }
.bonus-node-table col.col-type { width: 96px; }
.bonus-node-table col.col-addr { width: 240px; }
.bonus-node-table col.col-latency { width: 80px; }
.bonus-node-table col.col-time { width: 160px; }

.bonus-node-table th,
.bonus-node-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  font-size: 13px;
}

.bonus-node-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 680;
  white-space: nowrap;
}

.bonus-node-table tbody tr:last-child td {
  border-bottom: 0;
}

.bonus-node-table tbody tr.is-dead {
  opacity: 0.58;
}

.bonus-node-table tbody tr.is-picked {
  background: var(--success-soft);
}

.bonus-node-table .col-check {
  text-align: center;
}

.bonus-node-table .col-name {
  overflow: hidden;
  color: var(--ink);
  font-weight: 620;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bonus-node-table .col-addr,
.bonus-node-table .mono {
  overflow: hidden;
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bonus-alive {
  display: inline-flex;
  min-width: 44px;
  justify-content: center;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 680;
}

.bonus-alive.on {
  background: var(--success-soft);
  color: var(--success);
}

.bonus-alive.off {
  background: var(--neutral-soft);
  color: var(--muted);
}

.page-bonus .proxy-empty {
  display: flex;
  min-height: 140px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--muted);
  padding: 28px 18px;
  font-size: 13px;
  text-align: center;
}

.proxy-empty-hint {
  color: var(--placeholder);
  font-size: 12px;
}

@media (max-width: 980px) {
  .bonus-item {
    grid-template-columns: 1fr;
  }

  .bonus-actions {
    justify-content: flex-start;
  }

  .bonus-list {
    max-height: none;
  }

  .bonus-nodes-toolbar {
    align-items: stretch;
    flex-direction: column;
  }
}

/* 手动赠送节点页补充样式 */
.form-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.form-tab {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink-soft);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}

.form-tab.is-active {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary);
}

.form-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 16px;
  margin-bottom: 8px;
}

.form-grid-2 .form-group {
  margin-bottom: 12px;
}

.checkbox-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  margin: 4px 0 16px;
}

.checkbox-row .checkbox-label,
.form-group-checkbox .checkbox-label {
  margin-bottom: 0;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 600;
}

.form-group-checkbox {
  display: flex;
  align-items: flex-end;
  min-height: 62px;
  padding-bottom: 4px;
}

/* 防止 form-group label 的 display:block 把复选框撑坏 */
.form-group .checkbox-label {
  display: flex !important;
  align-items: center;
  gap: 8px;
  margin-bottom: 0;
  font-size: 13px;
  font-weight: 600;
}

.form-group .checkbox-label .checkbox-input {
  width: 17px !important;
  min-width: 17px;
  max-width: 17px;
  min-height: 17px !important;
  height: 17px !important;
  margin: 0;
  flex: 0 0 17px;
}

.is-hidden {
  display: none !important;
}

.modal-content.modal-content-lg {
  width: min(720px, 100%);
  max-width: 720px;
}

#nodeModal textarea,
#importModal textarea {
  width: 100%;
  min-height: 88px;
  resize: vertical;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
}

#nodeModal select,
#importModal select {
  width: 100%;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 650;
}

.status-pill.ok {
  background: color-mix(in srgb, var(--success) 16%, transparent);
  color: var(--success);
}

.status-pill.off {
  background: var(--surface-2, var(--line));
  color: var(--muted);
}

.bonus-table-wrapper {
  overflow: auto;
}

.bonus-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
}

.bonus-table .col-check {
  width: 44px;
  min-width: 44px;
  max-width: 44px;
  padding-left: 12px;
  padding-right: 8px;
  text-align: center;
}

.bonus-table .col-name {
  width: 34%;
  max-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bonus-table .col-type {
  width: 96px;
}

.bonus-table .col-server {
  width: 24%;
  max-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bonus-table .col-port {
  width: 72px;
}

.bonus-table .col-status {
  width: 84px;
}

.bonus-table .col-actions {
  width: 210px;
}

.bonus-table .row-check {
  width: 16px !important;
  min-width: 16px !important;
  max-width: 16px !important;
  height: 16px !important;
  min-height: 16px !important;
  margin: 0;
  padding: 0;
  vertical-align: middle;
  accent-color: var(--primary);
  cursor: pointer;
}

.bonus-table .row-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  justify-content: flex-end;
}

.bonus-table .mono {
  font-family: var(--font-mono);
  font-size: 12px;
}

.bonus-filter-group .is-active {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary);
}

.nodes-table-wrapper {
  overflow: auto;
}

.nodes-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
}

.nodes-table .col-check {
  width: 44px;
  min-width: 44px;
  max-width: 44px;
  padding-left: 12px;
  padding-right: 8px;
  text-align: center;
}

.nodes-table .col-name {
  width: 28%;
  max-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nodes-table .col-type {
  width: 90px;
}

.nodes-table .col-server {
  width: 18%;
  max-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nodes-table .col-port {
  width: 72px;
}

.nodes-table .col-accounts {
  width: 18%;
  max-width: 0;
}

.nodes-table .col-status {
  width: 84px;
}

.nodes-table .col-actions {
  width: 96px;
}

.nodes-table .row-check {
  width: 16px !important;
  min-width: 16px !important;
  max-width: 16px !important;
  height: 16px !important;
  min-height: 16px !important;
  margin: 0 auto;
  padding: 0;
  vertical-align: middle;
}

.form-hint {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

@media (max-width: 720px) {
  .form-grid-2 {
    grid-template-columns: 1fr;
  }
}

/* 节点剔除页 */
.nodes-table .accounts-cell {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 12px;
}

.nodes-table tr.is-excluded {
  opacity: 0.72;
}

.nodes-table .mono {
  font-family: var(--font-mono);
  font-size: 12px;
}

.nodes-toolbar {
  gap: 12px;
}

.node-raw-count {
  margin-left: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.config-group {
  border-bottom: 1px solid var(--line);
  padding: 22px;
}

.config-group:last-child {
  border-bottom: 0;
}

.config-group-heading {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 16px;
}

.config-group-heading h3 {
  flex-shrink: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 720;
}

.config-group-heading p {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.config-fields {
  display: flex;
  max-width: 880px;
  flex-wrap: wrap;
  align-items: start;
  gap: 18px 20px;
}

.config-item {
  min-width: 0;
}

.config-item.field-short {
  width: var(--field-short);
  flex: 0 1 var(--field-short);
}

.config-item.field-medium {
  width: var(--field-medium);
  flex: 0 1 var(--field-medium);
}

.config-item.field-long {
  width: min(100%, var(--field-long));
  max-width: var(--field-long);
  flex: 0 0 100%;
}

.config-item label,
.form-group label {
  display: block;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 680;
}

.config-item label {
  margin-bottom: 2px;
}

.form-group label {
  margin-bottom: 7px;
}

.config-help {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.config-item.field-url input,
.config-item.field-code input {
  font-family: var(--font-mono);
  font-size: 12px;
}

.form-group {
  margin-bottom: 16px;
}

.required {
  color: var(--danger);
}

.form-actions {
  margin-top: 22px;
}

.form-actions-center {
  justify-content: center;
}

.divider {
  margin: 18px 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(45, 49, 73, 0.3);
  padding: 16px;
}

.modal.show {
  display: flex;
}

.modal-content {
  width: min(440px, 100%);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-overlay);
  padding: 26px;
  animation: modal-in 190ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
.modal-content h2 {
  margin-bottom: 18px;
  color: var(--ink);
  font-size: 19px;
  font-weight: 740;
  letter-spacing: -0.015em;
}

.modal-content-sm {
  max-width: 340px;
}

.modal-content-md {
  max-width: 460px;
}

.modal-content-lg {
  max-width: 660px;
}

.modal-center {
  text-align: center;
}

.modal-hint {
  margin: -10px 0 18px;
  color: var(--muted);
  font-size: 12px;
}

.qr-box {
  display: inline-block;
  width: 202px;
  height: 202px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.subform,
.register-meta {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.subform {
  display: none;
  margin-bottom: 18px;
  padding: 14px;
}

.input-action-row {
  display: flex;
  gap: 8px;
}

.input-action-row input,
.button-row input {
  min-width: 180px;
  flex: 1;
}

.checkbox-label {
  display: flex !important;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.checkbox-input {
  width: 17px !important;
  min-height: 17px !important;
  height: 17px;
  accent-color: var(--primary);
}

.register-meta {
  margin-bottom: 16px;
  color: var(--muted);
  padding: 12px;
  font-size: 11px;
}

.meta-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.meta-row:last-child {
  margin-bottom: 0;
}

.code-chip {
  border-radius: 5px;
  background: #e9e7fb;
  color: var(--ink);
  padding: 2px 7px;
  font-family: var(--font-mono);
  font-size: 11px;
}

.loading {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(104, 84, 232, 0.2);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 760ms linear infinite;
}

.btn-primary .loading,
.btn-accent .loading,
.btn-danger .loading,
.btn-danger-solid .loading {
  border-color: rgba(255, 255, 255, 0.32);
  border-top-color: #fff;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

#toastContainer {
  position: fixed !important;
  right: 22px !important;
  bottom: 22px !important;
  z-index: var(--z-toast) !important;
  display: flex !important;
  flex-direction: column-reverse !important;
  gap: 8px !important;
  pointer-events: none !important;
}

.toast {
  min-width: 220px;
  max-width: min(360px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-overlay);
  cursor: pointer;
  opacity: 0;
  padding: 12px 15px;
  pointer-events: none;
  transform: translateY(7px);
  transition: opacity 170ms ease, transform 170ms ease;
  word-break: break-word;
}

.toast.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.toast.error {
  border-color: #efc2c7;
  background: var(--danger-soft);
  color: #992d37;
}

#toast.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
}

.copy-buffer {
  position: fixed;
  top: 0;
  left: -9999px;
  opacity: 0;
}

.danger-text {
  color: var(--danger);
  padding: 16px;
  text-align: center;
}

.confirm-body {
  margin-bottom: 20px;
}

.confirm-mark {
  display: inline-flex;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary-strong);
  font-size: 12px;
  font-weight: 800;
}

.confirm-body.is-danger .confirm-mark {
  background: var(--danger-soft);
  color: var(--danger);
}

.confirm-title {
  margin-bottom: 7px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 720;
}

.confirm-message {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

/* 独立用户管理页 */
.user-create-panel {
  margin-bottom: 14px;
}

.user-create-panel[hidden] {
  display: none;
}

.user-create-header {
  display: flex;
  min-height: 70px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  padding: 15px 18px;
}

.user-create-header h2 {
  color: var(--ink);
  font-size: 15px;
  font-weight: 720;
}

.user-create-header p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.user-create-grid {
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(220px, 300px) minmax(250px, 320px);
  align-items: end;
  justify-content: start;
  gap: 16px;
  padding: 18px;
}

.user-create-grid .form-group {
  margin-bottom: 0;
}

.permission-choice {
  display: flex;
  min-height: 42px;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  cursor: pointer;
  padding: 8px 11px;
}

.permission-choice:has(input:checked) {
  border-color: #c8c0fa;
  background: var(--primary-soft);
}

.permission-choice > span {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.permission-choice strong {
  color: var(--ink);
  font-size: 12px;
  font-weight: 680;
}

.permission-choice small {
  margin-top: 1px;
  color: var(--muted);
  font-size: 11px;
}

.user-create-actions {
  display: flex;
  justify-content: flex-start;
  border-top: 1px solid var(--line);
  padding: 13px 18px;
}

.user-directory-header {
  min-height: 76px;
}

.directory-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.directory-search {
  width: 260px;
  min-height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  padding: 8px 11px;
}

.directory-search::placeholder {
  color: var(--placeholder);
}

.directory-search:focus {
  border-color: var(--primary);
  outline: 3px solid rgba(104, 84, 232, 0.16);
}

.user-table-wrapper {
  width: 100%;
  overflow-x: auto;
}

.user-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  table-layout: auto;
}

.user-table th {
  height: 40px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--muted);
  padding: 9px 14px;
  font-size: 11px;
  font-weight: 680;
  text-align: left;
  white-space: nowrap;
}

.user-table td {
  height: 66px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
  padding: 10px 14px;
  font-size: 12px;
  vertical-align: middle;
}

.user-table tbody tr:last-child td {
  border-bottom: 0;
}

.user-table tbody tr:not(.user-empty-row):not(.user-loading-row):hover {
  background: var(--surface-soft);
}

.user-table tr.is-current-user {
  background: #fbfaff;
}

.user-identity {
  display: flex;
  min-width: 170px;
  align-items: center;
  gap: 10px;
}

.user-avatar-table {
  width: 32px;
  height: 32px;
  font-size: 12px;
}

.user-name-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.user-name-copy strong {
  overflow: hidden;
  max-width: 220px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 680;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-name-copy small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.role-badge,
.user-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 660;
  white-space: nowrap;
}

.role-badge {
  background: var(--neutral-soft);
  color: var(--muted);
  padding: 4px 7px;
}

.role-badge.is-admin {
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.user-status > span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.user-status.is-active {
  color: var(--success);
}

.user-status.is-disabled {
  color: var(--muted);
}

.account-count {
  font-variant-numeric: tabular-nums;
  font-weight: 680;
}

.user-created-at {
  color: var(--muted) !important;
  white-space: nowrap;
}

.user-actions-column {
  width: 1%;
}

.user-row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 5px;
}

.user-row-actions .btn:disabled {
  background: transparent;
}

.user-loading-row td,
.user-empty-row td {
  height: 150px;
  color: var(--muted);
  text-align: center;
}

.user-loading-row td {
  font-size: 12px;
}

.user-loading-row .loading {
  margin-right: 7px;
  vertical-align: -2px;
}

.user-empty-row td {
  padding: 28px;
}

.user-empty-row strong,
.user-empty-row span {
  display: block;
}

.user-empty-row strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}

.user-empty-row span {
  margin: 5px auto 13px;
  font-size: 12px;
}

.login-page {
  overflow: hidden;
  background: var(--surface);
}

.login-shell {
  display: grid;
  grid-template-columns: minmax(420px, 0.95fr) minmax(420px, 1.05fr);
  min-height: 100dvh;
}

.login-brand-panel {
  position: relative;
  display: flex;
  overflow: hidden;
  flex-direction: column;
  justify-content: space-between;
  background: var(--primary-soft);
  color: var(--ink);
  padding: clamp(28px, 5vw, 64px);
}

.login-brand-panel::after {
  position: absolute;
  right: -150px;
  bottom: -190px;
  width: 470px;
  height: 470px;
  border: 1px solid rgba(104, 84, 232, 0.18);
  border-radius: 50%;
  content: "";
}

.login-brand-lockup {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 14px;
}

.login-brand-mark {
  width: 76px;
  height: 76px;
  border-radius: 20px;
  box-shadow: 0 16px 38px rgba(65, 52, 145, 0.16);
}

.login-brand-lockup div {
  display: flex;
  flex-direction: column;
}

.login-brand-lockup strong {
  font-size: 15px;
  font-weight: 820;
  letter-spacing: 0.09em;
}

.login-brand-lockup span {
  margin-top: 3px;
  color: var(--nav-muted);
  font-size: 11px;
}

.login-brand-message {
  position: relative;
  z-index: 1;
  max-width: 600px;
  margin: auto 0;
  padding: 70px 0;
}

.login-brand-message > p {
  margin-bottom: 14px;
  color: var(--primary-strong);
  font-size: 12px;
  font-weight: 690;
}

.login-brand-message h1 {
  color: var(--ink);
  font-size: clamp(2.2rem, 4.2vw, 4.6rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.08;
  text-wrap: balance;
}

.login-brand-message > span {
  display: block;
  max-width: 42ch;
  margin-top: 22px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.login-runway {
  position: relative;
  z-index: 1;
  display: flex;
  width: min(360px, 72%);
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(104, 84, 232, 0.2);
  padding-top: 15px;
}

.login-runway span {
  width: 28px;
  height: 4px;
  border-radius: 999px;
  background: var(--primary);
}

.login-form-panel {
  display: grid;
  place-items: center;
  background: var(--surface);
  padding: 36px;
}

.login-form-wrap {
  width: min(380px, 100%);
}

.login-mobile-brand {
  display: none;
}

.login-header {
  margin-bottom: 28px;
}

.login-title {
  color: var(--ink);
  font-size: 28px;
  font-weight: 740;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.login-header p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.btn-login {
  width: 100%;
  min-height: 42px;
  margin-top: 2px;
}

.alert {
  margin-bottom: 18px;
  border-radius: var(--radius);
  padding: 11px 13px;
  font-size: 12px;
}

.alert-error {
  border: 1px solid #f0c8cc;
  background: var(--danger-soft);
  color: #9c2d38;
}

.login-footnote {
  margin-top: 22px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

@media (min-width: 981px) {
  .dashboard-main {
    display: flex;
    flex-direction: column;
  }

  .module-view[data-module="accounts"].is-active {
    display: flex;
    min-height: 0;
    flex: 1 1 auto;
    flex-direction: column;
  }

  .module-view[data-module="accounts"] .page-heading {
    flex: 0 0 auto;
  }

  .module-view[data-module="accounts"] .table-container {
    display: flex;
    min-height: 0;
    flex: 1 1 auto;
    flex-direction: column;
  }

  .module-view[data-module="accounts"] .table-wrapper {
    min-height: 0;
    flex: 1 1 auto;
  }

  .module-view[data-module="accounts"] table {
    min-width: 1010px;
  }

  .module-view[data-module="accounts"] thead th {
    position: sticky;
    top: 0;
    z-index: 2;
  }
}

@media (max-width: 1280px) {
  .operations-layout,
  .system-console {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 1180px) {
  .health-summary {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .health-facts > div:first-child {
    border-left: 0;
    padding-left: 0;
  }

  .workbench-layout {
    grid-template-columns: 1fr;
  }

  .notice-list {
    max-height: 290px;
  }

}

@media (max-width: 980px) {
  .admin-shell {
    width: 100%;
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
  }

  .admin-sidebar {
    position: static;
    width: 100%;
    min-width: 0;
    height: auto;
    overflow: hidden;
    border-right: 0;
    border-bottom: 1px solid var(--nav-line);
    padding: 13px 16px 10px;
  }

  .sidebar-brand {
    width: max-content;
  }

  .app-logo-sidebar {
    width: 40px;
    height: 40px;
  }

  .sidebar-nav {
    display: flex;
    width: 100%;
    max-width: 100%;
    flex: none;
    flex-direction: row;
    overflow-x: auto;
    margin-top: 14px;
    padding-bottom: 2px;
  }

  .sidebar-nav a {
    min-width: 112px;
    flex: 0 0 auto;
    justify-content: center;
  }

  .sidebar-section {
    width: 100%;
    flex: none;
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
    gap: 6px;
    margin-top: 8px;
    padding: 9px 0 0;
  }

  .sidebar-section-label {
    flex: 0 0 auto;
    padding: 0 5px;
  }

  .sidebar-action {
    min-width: max-content;
    flex: 0 0 auto;
  }

  .sidebar-user {
    display: none;
  }

  .admin-main {
    height: auto;
    min-height: calc(100dvh - 182px);
    overflow: visible;
    padding: 0 18px 36px;
  }

  .app-topbar {
    top: 0;
  }

  .page-heading {
    min-height: 100px;
  }

  .system-console {
    gap: 12px;
  }
}

@media (max-width: 800px) {
  .login-page {
    overflow: auto;
  }

  .login-shell {
    grid-template-columns: 1fr;
  }

  .login-brand-panel {
    display: none;
  }

  .login-form-panel {
    display: flex;
    min-height: 100dvh;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    padding: 24px;
  }

  .login-mobile-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 auto 54px;
    width: min(380px, 100%);
  }

  .login-mobile-brand img {
    border-radius: 12px;
  }

  .login-mobile-brand div {
    display: flex;
    flex-direction: column;
  }

  .login-mobile-brand strong {
    color: var(--ink);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.08em;
  }

  .login-mobile-brand span {
    margin-top: 2px;
    color: var(--muted);
    font-size: 11px;
  }

  .login-form-wrap {
    margin: 0 auto;
  }
}

@media (max-width: 760px) {
  .admin-main {
    padding: 0 12px 28px;
  }

  .app-topbar {
    min-height: 52px;
  }

  .topbar-product,
  .topbar-separator {
    display: none;
  }

  .page-heading {
    min-height: 0;
    align-items: stretch;
    flex-direction: column;
    gap: 16px;
    padding: 22px 0 18px;
  }

  .page-heading h1 {
    font-size: 22px;
  }

  .page-actions {
    justify-content: flex-start;
  }

  .health-summary {
    padding: 18px;
  }

  .health-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
  }

  .health-facts > div {
    border-left: 0;
    border-top: 1px solid var(--nav-line);
    padding: 12px 10px 8px 0;
  }

  .health-facts > div:nth-child(even) {
    padding-left: 12px;
  }

  .health-facts > div:nth-child(-n + 2) {
    border-top: 0;
  }

  .health-facts dd {
    font-size: 20px;
  }

  .surface-header {
    min-height: 64px;
    align-items: flex-start;
    padding: 14px;
  }

  .user-create-grid {
    grid-template-columns: 1fr 1fr;
  }

  .permission-choice {
    grid-column: 1 / -1;
  }

  .user-directory-header {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
  }

  .directory-tools,
  .directory-search {
    width: 100%;
  }

  .directory-search {
    min-width: 0;
    flex: 1 1 auto;
  }

  .user-table-wrapper {
    overflow: visible;
  }

  .user-table {
    min-width: 0;
  }

  .user-table thead {
    display: none;
  }

  .user-table,
  .user-table tbody {
    display: block;
    width: 100%;
  }

  .user-table tbody tr:not(.user-loading-row):not(.user-empty-row) {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 12px;
    border-bottom: 1px solid var(--line);
    padding: 16px 14px;
  }

  .user-table tbody tr:last-child {
    border-bottom: 0;
  }

  .user-table tbody tr:not(.user-loading-row):not(.user-empty-row) td {
    display: flex;
    height: auto;
    min-width: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    border: 0;
    padding: 0;
  }

  .user-table tbody tr:not(.user-loading-row):not(.user-empty-row) td:first-child,
  .user-table tbody tr:not(.user-loading-row):not(.user-empty-row) td:last-child {
    grid-column: 1 / -1;
  }

  .user-table tbody tr:not(.user-loading-row):not(.user-empty-row) td:first-child {
    border-bottom: 1px solid var(--line);
    padding-bottom: 12px;
  }

  .user-table tbody tr:not(.user-loading-row):not(.user-empty-row) td:last-child {
    border-top: 1px solid var(--line);
    padding-top: 13px;
  }

  .user-table .user-loading-row,
  .user-table .user-empty-row,
  .user-table .user-loading-row td,
  .user-table .user-empty-row td {
    display: block;
    width: 100%;
  }

  .user-table td[data-label]::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 10px;
    font-weight: 650;
  }

  .user-identity {
    min-width: 0;
  }

  .user-row-actions {
    width: 100%;
  }

  .user-row-actions .btn {
    flex: 1;
  }

  .attention-item {
    grid-template-columns: 9px minmax(0, 1fr) auto;
    padding: 12px 14px;
  }

  .attention-reason {
    display: none;
  }

  .quick-routes {
    grid-template-columns: 1fr;
  }

  .quick-routes a {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .quick-routes a:last-child {
    border-bottom: 0;
  }

  .subscription-control {
    grid-template-columns: 1fr 1fr;
  }

  .subscription-control input {
    grid-column: 1 / -1;
  }

  .table-toolbar {
    grid-template-columns: 1fr auto;
    gap: 10px;
  }

  .account-filters {
    grid-column: 1 / -1;
    order: 2;
  }

  .search-box {
    grid-column: 1;
    order: 1;
  }

  .result-count {
    grid-column: 2;
    order: 1;
  }

  .table-wrapper table thead {
    display: none;
  }

  .table-wrapper table,
  .table-wrapper tbody,
  .table-wrapper tr,
  .table-wrapper td {
    display: block;
    width: 100%;
  }

  .table-wrapper tbody tr[data-id] {
    position: relative;
    border-bottom: 1px solid var(--line);
    background: var(--surface);
    cursor: pointer;
    padding: 13px 14px;
  }

  .table-wrapper tbody tr[data-id]:last-child {
    border-bottom: 0;
  }

  .table-wrapper tbody tr[data-id] td {
    height: auto;
    border-bottom: 0;
    padding: 2px 0;
    white-space: normal;
  }

  .table-wrapper tbody tr[data-id] td:first-child {
    margin-bottom: 2px;
    padding-right: 84px;
  }

  .account-email {
    max-width: 100%;
    font-size: 13px;
    white-space: nowrap;
  }

  .table-wrapper tbody tr[data-id] td:nth-child(2) {
    margin-bottom: 8px;
  }

  .table-wrapper tbody tr[data-id] td:nth-child(5) {
    position: absolute;
    top: 13px;
    right: 14px;
    width: auto;
    padding: 0;
  }

  .table-wrapper tbody tr[data-id] td:nth-child(4),
  .table-wrapper tbody tr[data-id] td:nth-child(6),
  .table-wrapper tbody tr[data-id] td:last-child {
    display: none;
  }

  .table-wrapper tbody tr[data-id].expanded td:nth-child(4),
  .table-wrapper tbody tr[data-id].expanded td:nth-child(6),
  .table-wrapper tbody tr[data-id].expanded td:last-child {
    display: block;
  }

  .table-wrapper tbody tr[data-id].expanded td:nth-child(4) {
    margin-top: 10px;
    border-top: 1px solid var(--line);
    padding-top: 10px;
  }

  .table-wrapper tbody tr[data-id].expanded td:nth-child(4)::before,
  .table-wrapper tbody tr[data-id].expanded td:nth-child(6)::before {
    display: block;
    margin-bottom: 3px;
    color: var(--muted);
    font-size: 10px;
  }

  .table-wrapper tbody tr[data-id].expanded td:nth-child(4)::before {
    content: "到期时间";
  }

  .table-wrapper tbody tr[data-id].expanded td:nth-child(6)::before {
    content: "订阅";
  }

  .table-wrapper tbody tr[data-id].expanded td:last-child {
    margin-top: 10px;
  }

  .table-wrapper .actions {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .progress {
    max-width: 100%;
  }

  .traffic-overview {
    padding: 16px;
  }

  .traffic-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
  }

  .traffic-item {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 12px 0;
  }

  .traffic-item:nth-child(odd) {
    border-right: 1px solid var(--line);
    padding-right: 12px;
  }

  .traffic-item:nth-child(even) {
    padding-left: 12px;
  }

  .traffic-item:nth-last-child(-n + 2) {
    border-bottom: 0;
  }

  .chart-container {
    min-height: 330px;
    padding: 16px 12px;
  }

  .chart-container canvas {
    max-height: 264px !important;
  }

  .traffic-detail-grid {
    grid-template-columns: 1fr;
  }

  .chart-container-small {
    min-height: 220px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .chart-container-small:last-child {
    border-bottom: 0;
  }

  .config-group {
    padding: 18px 16px;
  }

  .config-group-heading p {
    max-width: none;
  }

  .config-fields {
    max-width: none;
    gap: 15px;
  }

  .config-item.field-short,
  .config-item.field-medium,
  .config-item.field-long {
    width: 100%;
    max-width: none;
    flex-basis: 100%;
  }

  .proxy-item {
    display: flex;
    align-items: stretch;
    flex-direction: column;
  }

  .proxy-meta {
    margin-left: 18px;
  }

  .proxy-actions,
  .button-row {
    justify-content: flex-start;
  }

  .modal-content {
    padding: 22px;
  }

  .form-actions {
    flex-direction: column-reverse;
  }

  .form-actions .btn {
    width: 100%;
  }

  .input-action-row {
    flex-direction: column;
  }
}

@media (max-width: 520px) {
  .admin-sidebar {
    padding: 11px 10px 9px;
  }

  .brand-copy small {
    display: none;
  }

  .sidebar-nav {
    grid-template-columns: repeat(4, minmax(104px, 1fr));
    margin-top: 11px;
  }

  .sidebar-nav a {
    gap: 7px;
    padding: 8px;
    font-size: 12px;
  }

  .page-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .page-actions .btn {
    width: 100%;
  }

  .user-create-grid {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 14px;
  }

  .permission-choice {
    grid-column: 1;
  }

  .user-create-actions {
    padding: 12px 14px;
  }

  .user-create-actions .btn {
    width: 100%;
  }

  .surface-header {
    flex-direction: column;
    gap: 10px;
  }

  .directory-tools {
    align-items: stretch;
    flex-direction: column;
  }

  .directory-tools .btn,
  .directory-search {
    width: 100%;
  }

  .surface-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .surface-actions .btn {
    flex: 1;
  }

  .coupon-item {
    align-items: flex-start;
  }

  .table-toolbar {
    grid-template-columns: 1fr;
  }

  .search-box,
  .result-count {
    grid-column: 1;
  }

  .result-count {
    text-align: left;
  }

  .subscription-control {
    grid-template-columns: 1fr;
  }

  .subscription-control input,
  .subscription-control .btn {
    grid-column: 1;
    width: 100%;
  }

  #toastContainer {
    right: 12px !important;
    bottom: 12px !important;
  }

  .login-form-panel {
    padding: 20px;
  }

  .login-mobile-brand {
    margin-bottom: 42px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ==================== 节点转换页 ==================== */
.convert-panel {
  padding: 1.25rem 1.5rem 1.75rem;
}

.convert-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 960px) {
  .convert-grid {
    grid-template-columns: 1fr;
  }
}

.convert-col .form-group {
  margin-bottom: 1rem;
}

.convert-col textarea,
.convert-col .form-input {
  width: 100%;
  box-sizing: border-box;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.5;
}

.convert-col textarea {
  min-height: 220px;
  resize: vertical;
}

#convertOutput {
  background: var(--surface-soft);
  min-height: 320px;
}

.field-hint {
  display: block;
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.convert-result-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.convert-warnings {
  margin-bottom: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--warning-soft);
  color: var(--warning);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}

.convert-warnings ul {
  margin: 0.35rem 0 0;
  padding-left: 1.2rem;
}

.convert-names {
  margin-top: 0.5rem;
  padding: 0.75rem 1rem;
  background: var(--surface-soft);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  max-height: 180px;
  overflow: auto;
}

.convert-names ul {
  margin: 0.4rem 0 0;
  padding-left: 1.2rem;
  columns: 2;
  column-gap: 1rem;
}

@media (max-width: 640px) {
  .convert-names ul {
    columns: 1;
  }
}

.convert-pull-card {
  margin-bottom: 1rem;
}

.convert-pull-card #convertPullUrl {
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.convert-panel .form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
}

