* {
  box-sizing: border-box;
}

:root {
  --bg: #eef2f4;
  --panel: #ffffff;
  --line: #dfe6ea;
  --text: #16222b;
  --muted: #6a7a86;
  --primary: #0b7a75;
  --primary-dark: #08645f;
  --primary-soft: #e2f2f0;
  --amber: #b26a00;
  --amber-soft: #fff3dc;
  --red: #c0392b;
  --red-soft: #fdeceb;
  --green: #1f8a4c;
  --green-soft: #e3f4e9;
  --shadow: 0 1px 2px rgba(15, 35, 45, .06), 0 8px 24px rgba(15, 35, 45, .06);
  --radius: 8px;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

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

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

.muted {
  color: var(--muted);
}

.center {
  text-align: center;
}

/* ---------- 通用按钮 ---------- */

.btn {
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 8px 16px;
  font-weight: 600;
  background: transparent;
  transition: background .15s, border-color .15s, color .15s, transform .05s;
}

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

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

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-ghost {
  border-color: var(--line);
  background: var(--panel);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: #c4d0d7;
  background: #f7fafb;
}

.btn-lg {
  padding: 11px 22px;
  font-size: 16px;
}

.btn-generate {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  line-height: 1.2;
}

#btn-generate-main {
  font-size: 18px;
}

#btn-generate-sub {
  font-size: 14px;
  font-weight: 400;
  opacity: 1;
}

.btn-sm {
  padding: 6px 10px;
  font-size: 13px;
}

.btn-block {
  display: block;
  width: 100%;
}

.icon-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  width: 32px;
  height: 32px;
  border-radius: var(--radius);
}

.icon-btn:hover {
  background: #eef3f5;
  color: var(--text);
}

/* ---------- 登录 / 注册 ---------- */

.auth-view {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(circle at 18% 16%, rgba(11, 122, 117, .10), transparent 34%),
    radial-gradient(circle at 84% 78%, rgba(178, 106, 0, .09), transparent 32%),
    var(--bg);
}

.auth-panel {
  width: min(420px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}

.brand-block.small {
  margin-bottom: 0;
}

.brand-block h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1.25;
}

.brand-block p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.brand-block strong {
  display: block;
  font-size: 16px;
}

.brand-mark {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--primary), #14928b);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0;
}

.brand-mark.small {
  width: 34px;
  height: 34px;
  flex-basis: 34px;
  font-size: 14px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 18px;
}

.auth-tab {
  border: 0;
  background: #f5f8fa;
  padding: 9px 0;
  color: var(--muted);
  font-weight: 600;
}

.auth-tab.active {
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-form label,
.gen-form label.field {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: #33424d;
  font-weight: 600;
}

.auth-form input,
.gen-form textarea,
.gen-form select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  background: #fff;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

.auth-form input:focus,
.gen-form textarea:focus,
.gen-form select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(11, 122, 117, .12);
}

/* ---------- 顶栏与布局 ---------- */

.topbar {
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar-inner {
  max-width: 1500px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar-brand-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 5px 10px 5px 5px;
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}

.user-name {
  font-weight: 600;
  font-size: 13px;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.balance-chip {
  display: flex;
  align-items: baseline;
  gap: 8px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  border-radius: var(--radius);
  padding: 7px 12px;
  white-space: nowrap;
}

.balance-chip span {
  font-size: 12px;
  color: #3f7d78;
}

.balance-chip strong {
  font-size: 15px;
}

.layout {
  max-width: 1500px;
  margin: 0 auto;
  padding: 24px 20px 56px;
  display: grid;
  grid-template-columns: 380px minmax(0, 1fr);
  gap: 20px;
  align-items: stretch;
}

.panel.form-panel {
  position: sticky;
  top: 76px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.panel-head h2 {
  margin: 0;
  font-size: 18px;
}

.panel-head p {
  margin: 4px 0 0;
  font-size: 13px;
}

.price-tag {
  background: var(--amber-soft);
  color: var(--amber);
  border-radius: var(--radius);
  padding: 6px 10px;
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
}

/* ---------- 生成表单 ---------- */

.gen-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  grid-column: 1 / -1;
}

.gen-form .full,
.form-foot.full {
  grid-column: 1 / -1;
}

.gen-form .sub-label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 400;
}

.image-upload {
  display: flex;
  align-items: center;
  gap: 10px;
}

.media-panel {
  border: 1px dashed #c4d0d7;
  border-radius: var(--radius);
  padding: 10px;
  background: #fbfdfe;
}

.media-panel-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.media-panel .composer-media {
  margin-top: 4px;
}

.prompt-composer {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.prompt-composer textarea {
  width: 100%;
}

.prompt-composer.dragover {
  outline: 2px dashed var(--primary);
  outline-offset: 2px;
  border-radius: var(--radius);
}

.composer-media {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
  max-height: 150px;
  overflow-y: auto;
  padding: 2px;
}

.composer-item {
  position: relative;
  width: 64px;
  flex: 0 0 64px;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: #f2f6f8;
}

.composer-item img {
  width: 100%;
  height: 64px;
  object-fit: cover;
  display: block;
}

.composer-item .media-icon {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--muted);
  background: #eef3f5;
}

.composer-item .media-name {
  font-size: 10px;
  padding: 2px 4px;
  color: var(--muted);
  word-break: break-all;
  max-height: 26px;
  overflow: hidden;
}

.image-previews {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.image-preview {
  position: relative;
  width: 72px;
  height: 72px;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}

.image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.image-preview .remove-img {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, .6);
  color: #fff;
  font-size: 12px;
  line-height: 18px;
  padding: 0;
}

.composer-item .remove-img {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, .7);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.segmented {
  display: flex;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.segmented button {
  flex: 1;
  border: 0;
  background: #f5f8fa;
  padding: 9px 8px;
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}

.segmented button + button {
  border-left: 1px solid var(--line);
}

.segmented button.active {
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.switch-row {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-weight: 400;
}

.switch-row input {
  display: none;
}

.switch {
  width: 40px;
  height: 22px;
  border-radius: 11px;
  background: #cdd7dd;
  position: relative;
  transition: background .15s;
  flex: 0 0 40px;
}

.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: left .15s;
}

.switch-row input:checked + .switch {
  background: var(--primary);
}

.switch-row input:checked + .switch::after {
  left: 21px;
}

.form-foot {
  display: flex;
  align-items: center;
  gap: 14px;
}

.form-foot .muted {
  font-size: 13px;
}

/* ---------- 任务列表 ---------- */

.task-list {
  display: grid;
  gap: 12px;
}

.task-more {
  text-align: center;
  margin-top: 16px;
}

.task-more .btn {
  min-width: 140px;
}

.task-empty {
  border: 1px dashed #c8d3da;
  border-radius: var(--radius);
  padding: 34px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

.task-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  display: grid;
  gap: 10px;
  background: #fbfdfe;
}

.task-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.task-id {
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.task-prompt {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.task-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--card-min, 170px), 1fr));
  gap: 14px;
}

.task-grid.size-small {
  --card-min: 140px;
}

.task-grid.size-medium {
  --card-min: 170px;
}

.task-grid.size-large {
  --card-min: 220px;
}

.panel-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.grid-size {
  display: flex;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.grid-size button {
  border: 0;
  background: #f5f8fa;
  padding: 6px 10px;
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
}

.grid-size button + button {
  border-left: 1px solid var(--line);
}

.grid-size button.active {
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.task-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fbfdfe;
  display: flex;
  flex-direction: column;
}

.task-card-body {
  padding: 8px 10px;
  display: grid;
  gap: 4px;
}

.task-prompt-line {
  margin: 0;
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}

.task-model-line {
  margin: 0;
  font-size: 11px;
  color: #33424d;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}

.task-error-line {
  margin: 0;
  font-size: 11px;
  color: var(--red);
  word-break: break-all;
  line-height: 1.4;
}

.task-video-wrap {
  position: relative;
  aspect-ratio: 9 / 16;
  background: #0d1418;
}

.task-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  cursor: pointer;
}

.task-hover-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 5px;
  width: 72px;
  opacity: 0;
  transition: opacity .15s;
  z-index: 2;
}

.task-hover-actions .btn-sm {
  padding: 4px 6px;
  font-size: 11px;
}

.task-hover-actions .btn {
  background: rgba(255, 255, 255, .12);
  color: #fff;
  border-color: rgba(255, 255, 255, .25);
}

.task-hover-actions .btn-primary {
  background: rgba(11, 122, 117, .85);
  border-color: transparent;
}

.task-hover-actions .btn-ghost {
  background: rgba(0, 0, 0, .55);
  color: #fff;
  border-color: rgba(255, 255, 255, .25);
}

.task-hover-actions .btn-danger {
  background: rgba(220, 38, 38, .75);
  border-color: transparent;
}

.task-hover-actions .btn:hover {
  background: rgba(255, 255, 255, .22);
}

.task-video-wrap:hover .task-hover-actions {
  opacity: 1;
}

.task-status-chip {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 2;
}

.task-thumb-box {
  aspect-ratio: 9 / 16;
  width: 100%;
  position: relative;
  background: #101c24;
  color: #cfe0e8;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 13px;
}

.task-thumb-box.failed {
  background: var(--red-soft);
  color: var(--red);
}

.task-retry {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
}

.spinner {
  width: 26px;
  height: 26px;
  border: 3px solid rgba(255, 255, 255, .22);
  border-top-color: #6cd0c4;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.task-thumb-box.failed .spinner {
  display: none;
}

.task-thumb-error {
  font-size: 10px;
  padding: 0 8px;
  text-align: center;
  color: var(--red);
  word-break: break-all;
  max-height: 40px;
  overflow: hidden;
}

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

.badge {
  display: inline-block;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.badge-success {
  background: var(--green-soft);
  color: var(--green);
}

.badge-pending,
.badge-submitting,
.badge-processing,
.badge-queued {
  background: var(--amber-soft);
  color: var(--amber);
}

.badge-failed {
  background: var(--red-soft);
  color: var(--red);
}

.task-error {
  margin: 0;
  font-size: 12px;
  color: var(--red);
  word-break: break-all;
}

.points-plus {
  color: var(--green);
  font-weight: 700;
}

.points-minus {
  color: var(--red);
  font-weight: 700;
}

/* ---------- API 接入 ---------- */

.api-section {
  max-width: 1500px;
  margin: 0 auto;
  padding: 0 20px 56px;
}

.api-create {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.api-create input {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 9px 12px;
}

.key-new {
  background: var(--primary-soft);
  border: 1px solid #bfe0dc;
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 14px;
}

.key-warn {
  margin: 0 0 8px;
  color: var(--amber);
  font-size: 13px;
  font-weight: 600;
}

.key-value-row {
  display: flex;
  gap: 8px;
}

.key-value-row input {
  flex: 1;
  border: 1px solid #bfe0dc;
  border-radius: var(--radius);
  padding: 8px 10px;
  background: #fff;
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
}

.key-list {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.key-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  background: #fbfdfe;
}

.key-item .key-name {
  font-weight: 600;
}

.key-item .key-meta {
  font-size: 12px;
  color: var(--muted);
}

.key-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.api-docs {
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.api-docs-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.api-docs h3 {
  margin: 0;
  font-size: 14px;
}

.api-docs pre {
  margin: 0;
  padding: 14px;
  background: #17232c;
  color: #d9e6ed;
  border-radius: var(--radius);
  overflow-x: auto;
  font-size: 12px;
  line-height: 1.6;
  font-family: Consolas, "Courier New", monospace;
}

/* ---------- 充值弹窗 ---------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-mask {
  position: absolute;
  inset: 0;
  background: rgba(15, 30, 40, .45);
}

.modal-card {
  position: relative;
  width: min(440px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: 0 18px 50px rgba(15, 30, 40, .25);
  padding: 22px;
}

.records-list {
  max-height: 60vh;
  overflow-y: auto;
}

.watch-card {
  max-width: 520px;
}

.watch-card video {
  width: 100%;
  max-height: 70vh;
  background: #000;
  border-radius: var(--radius);
  display: block;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.modal-head h3 {
  margin: 0;
  font-size: 18px;
}

.confirm-message {
  margin: 0 0 18px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.7;
}

.confirm-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.pay-disabled-note {
  margin: 0 0 16px;
  background: var(--amber-soft);
  color: var(--amber);
  border: 1px solid #f0d9a8;
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 13px;
}

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

.amount-grid button {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f5f8fa;
  padding: 12px 4px;
  font-weight: 700;
  white-space: nowrap;
}

.amount-grid button.active {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.pay-methods {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.pay-method {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f5f8fa;
  padding: 12px 6px;
  display: grid;
  justify-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 13px;
}

.pay-method.active {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.pay-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
}

.pay-icon.mock {
  background: #607d8b;
}

.pay-icon.alipay {
  background: #1677ff;
}

.pay-icon.wechat {
  background: #07c160;
}

.pay-qr {
  width: 200px;
  height: 200px;
  margin: 18px auto 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #fff;
}

.pay-qr img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.pay-qr-fallback {
  width: 100%;
  height: 100%;
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  word-break: break-all;
}

#pay-status {
  font-weight: 700;
  color: var(--primary-dark);
  margin: 8px 0 14px;
}

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  background: #16222b;
  color: #fff;
  padding: 10px 18px;
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .2);
  font-size: 14px;
  max-width: min(520px, calc(100vw - 40px));
}

/* ---------- 响应式 ---------- */

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

@media (max-width: 640px) {
  .topbar-inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .top-actions {
    width: 100%;
    justify-content: space-between;
  }

  .gen-form {
    grid-template-columns: 1fr;
  }

  .field-row {
    grid-template-columns: 1fr;
  }

  .api-create,
  .key-value-row {
    flex-direction: column;
  }

  .amount-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .layout {
    padding: 16px 12px 40px;
  }

  .panel {
    padding: 16px;
  }
}

/* ---------- 深色模式 ---------- */

html.dark {
  --bg: #0e141a;
  --panel: #151d25;
  --line: #26323c;
  --text: #e7eef3;
  --muted: #94a6b4;
  --primary: #17b3a8;
  --primary-dark: #2cc6ba;
  --primary-soft: #123f3c;
  --amber: #e0a24b;
  --amber-soft: #3a2c12;
  --red: #ff6b5e;
  --red-soft: #3a1a18;
  --green: #4cc38a;
  --green-soft: #143325;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .3);
}

html.dark .auth-view {
  background:
    radial-gradient(circle at 18% 16%, rgba(23, 179, 168, .12), transparent 34%),
    radial-gradient(circle at 84% 78%, rgba(224, 162, 75, .10), transparent 32%),
    var(--bg);
}

html.dark input,
html.dark select,
html.dark textarea {
  background: #0f161d;
  color: var(--text);
  border-color: var(--line);
}

html.dark .segmented button,
html.dark .grid-size button,
html.dark .amount-grid button,
html.dark .pay-method {
  background: #1b2530;
  color: var(--muted);
}

html.dark .task-card,
html.dark .media-panel,
html.dark .composer-item,
html.dark .key-item {
  background: #121a22;
}

html.dark .task-item {
  background: #121a22;
}

html.dark .btn-ghost {
  background: #1b2530;
  color: var(--text);
  border-color: var(--line);
}

html.dark .btn-ghost:hover {
  background: #243140;
}

html.dark .task-prompt-line,
html.dark .task-model-line {
  color: #aebdca;
}
