/* 明亮工作室主题：瓷白底、墨蓝强调；所有颜色只经这里的变量进入页面 */
:root {
  color-scheme: light;
  --bg: #f6f5f1;
  --surface: #ffffff;
  --surface-raised: #fbfaf7;
  --surface-hover: #f0eee8;
  --surface-sunken: #f1efe9;
  --field-bg: #ffffff;
  --canvas-bg: #e9e7e1;
  --line: #e5e1d8;
  --line-strong: #d3cdc1;
  --text: #1b1d22;
  --muted: #6b7280;
  --muted-strong: #444a57;
  --accent: #1f3a8a;
  --accent-hover: #172c6b;
  --accent-text: #1f3a8a;
  --accent-soft: rgba(31, 58, 138, 0.09);
  --accent-line: rgba(31, 58, 138, 0.4);
  --success: #1a7f5a;
  --success-soft: rgba(26, 127, 90, 0.12);
  --warning: #b45309;
  --warning-soft: rgba(180, 83, 9, 0.1);
  --warning-line: rgba(180, 83, 9, 0.4);
  --danger: #b42318;
  --danger-soft: rgba(180, 35, 24, 0.08);
  --danger-line: rgba(180, 35, 24, 0.35);
  --toast-bg: #1b1d22;
  --backdrop: rgba(27, 29, 34, 0.42);
  --shadow: 0 10px 30px rgba(27, 29, 34, 0.08);
  --header-height: 58px;
  --rail-width: 0px;
  font-family:
    Inter, "Segoe UI", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-size: 14px;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  color: inherit;
  font: inherit;
}

button,
select,
input[type="radio"],
input[type="checkbox"] {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

:focus-visible {
  outline: 2px solid var(--accent-hover);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  z-index: 200;
  top: -100px;
  left: 12px;
  padding: 9px 13px;
  border-radius: 6px;
  color: white;
  background: var(--accent);
}

.skip-link:focus {
  top: 10px;
}

.app-header {
  position: fixed;
  z-index: 100;
  inset: 0 0 auto;
  display: flex;
  height: var(--header-height);
  align-items: center;
  gap: 18px;
  padding-right: 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
}

.shell-brand {
  display: flex;
  height: 100%;
  align-items: center;
  gap: 10px;
  padding: 0 18px 0 14px;
  font-size: 16px;
  font-weight: 760;
  letter-spacing: -0.02em;
}

/* 品牌标志：镜序圆环标（PNG，透明底），由 GPT Image 2 生成后抠图 */
.brand-mark {
  display: block;
  width: 26px;
  height: 26px;
  object-fit: contain;
}

.shell-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.shell-nav a {
  display: flex;
  min-height: 32px;
  align-items: center;
  padding: 0 13px;
  border-radius: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.shell-nav a:hover {
  color: var(--text);
  background: var(--surface-hover);
}

.shell-nav a.active {
  color: var(--accent-text);
  background: var(--accent-soft);
}

.shell-account {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sandbox-state,
.wallet-pill {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  gap: 7px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  background: var(--surface);
  font-size: 11px;
}

.sandbox-state i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
}

.sandbox-state[data-mode="live"] {
  border-color: var(--accent-line);
  color: var(--accent-text);
}

.sandbox-state[data-mode="live"] i {
  background: var(--accent);
}

.wallet-pill svg {
  width: 13px;
  height: 13px;
  color: var(--accent-text);
}

.wallet-pill strong {
  color: var(--text);
  font-size: 13px;
}

.account-login {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  padding: 0 13px;
  border: 1px solid var(--accent);
  border-radius: 7px;
  color: var(--text);
  background: var(--accent-soft);
  font-size: 11px;
  font-weight: 700;
}

.account-login:hover {
  color: white;
  background: var(--accent);
}

/* 旧的左侧图标栏已停用（导航全部在顶栏），容器留空 */
.app-rail {
  display: none;
}

.policy-dialog,
.preview-dialog {
  width: min(500px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  color: var(--text);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.policy-dialog::backdrop,
.preview-dialog::backdrop {
  background: var(--backdrop);
  backdrop-filter: blur(5px);
}

.dialog-heading,
.preview-dialog > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
}

.dialog-heading span,
.preview-dialog > header span {
  color: var(--accent-text);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.dialog-heading h2,
.preview-dialog > header h2 {
  margin: 5px 0 0;
  font-size: 20px;
}

.dialog-heading button,
.preview-dialog > header button {
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted-strong);
  background: var(--surface);
}

.policy-dialog > p,
.policy-dialog > ul {
  margin: 0;
  padding: 18px 22px 0;
  color: var(--muted-strong);
  line-height: 1.7;
}

.policy-dialog > ul {
  padding: 10px 40px 24px;
}

.policy-dialog .dialog-links {
  padding: 0 22px 22px;
  font-size: 12px;
}

.policy-dialog .dialog-links a,
.shell-footer a,
.legal-dialog-actions a {
  color: var(--accent-text);
}

.legal-dialog > ul {
  padding: 10px 40px 6px;
}

.legal-dialog-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 10px 22px 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
  background: var(--surface);
  font-size: 12px;
  line-height: 1.6;
}

.legal-dialog-check input {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  accent-color: var(--accent);
}

.legal-dialog > .form-error {
  margin: 12px 22px 0;
}

.legal-dialog-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  padding: 18px 22px 22px;
  font-size: 12px;
}

.legal-dialog-actions button {
  min-height: 40px;
  padding: 0 18px;
  border: 0;
  border-radius: 7px;
  color: white;
  background: var(--accent);
  font-weight: 700;
}

.legal-dialog-actions button:disabled {
  opacity: 0.5;
}

.shell-footer {
  display: grid;
  margin-left: var(--rail-width);
  padding: 22px 38px 30px;
  gap: 8px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.shell-footer:empty {
  display: none;
}

.shell-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
}

.shell-footer p {
  margin: 0;
}

.shell-footer .footer-note {
  color: var(--muted);
  opacity: 0.85;
}

.toast {
  position: fixed;
  z-index: 300;
  right: 18px;
  bottom: 18px;
  max-width: min(380px, calc(100vw - 36px));
  padding: 12px 15px;
  border: 1px solid var(--toast-bg);
  border-radius: 8px;
  color: white;
  background: var(--toast-bg);
  box-shadow: 0 14px 40px rgba(27, 29, 34, 0.25);
  font-size: 12px;
}

.empty-message {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 8px;
  background: var(--line-strong);
  background-clip: padding-box;
}
