:root {
  color-scheme: light dark;
  font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
  color: #1d1a19;
  background: #faf8f6;
  --brand-primary: #c89b5b;
  --brand-hover: #d0a35c;
  --brand-active: #a9783f;
  --brand-gold: #b8894a;
  --tea-deep: #8e6238;
  --brand-soft: #fff7e6;
  --brand-text: var(--tea-deep);
  --text-on-brand: #2c2114;
  --action-primary: #8e6238;
  --action-primary-hover: #a9783f;
  --action-primary-active: #76502f;
  --text-on-action: #fffaf2;
  --gold-primary: var(--brand-gold);
  --gold-text: var(--tea-deep);
  --gold-soft: #fff8ec;
  --status-error: #b42335;
  --status-error-soft: #fff0f2;
  --text-primary: #1d1a19;
  --text-secondary: #554f4b;
  --text-tertiary: #7a726d;
  --text-disabled: #aaa19b;
  --text-muted: var(--text-tertiary);
  --surface-page: #faf8f6;
  --surface-card: #ffffff;
  --surface-hover: #f5f0eb;
  --surface-selected: #fff7e6;
  --border-default: #e7dfd9;
  --border-subtle: #f0e9e4;
  --border-strong: #d6cbc4;
  --canvas: var(--surface-page);
  --paper: var(--surface-card);
  --muted-panel: var(--surface-hover);
  --quiet-panel: var(--surface-hover);
  --ink: var(--text-primary);
  --muted: var(--text-muted);
  --secondary: var(--text-secondary);
  --line: var(--border-default);
  --input-line: var(--border-strong);
  --button: var(--action-primary);
  --button-hover: var(--action-primary-hover);
  --button-active: var(--action-primary-active);
  --button-text: var(--text-on-action);
  --focus: var(--brand-primary);
  --error: var(--status-error);
  --error-panel: var(--status-error-soft);
  --shadow: rgba(61, 42, 33, 0.09);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--canvas);
  color: var(--ink);
  transition:
    background-color 160ms ease,
    color 160ms ease;
}
.access-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  width: min(520px, calc(100% - 36px));
  margin: 0 auto;
  padding: 10vh 0 48px;
}
.access-shell > header {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 8px;
}
.mark {
  display: grid;
  width: 40px;
  min-width: 40px;
  height: 40px;
  flex: 0 0 40px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  box-shadow: 0 8px 22px var(--shadow);
  font-weight: 700;
  color: var(--gold-text);
}
.access-shell h1 {
  margin: 0;
  color: var(--brand-text);
  font-size: 25px;
}
.access-shell header p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.access-panel {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper);
  padding: 25px;
  box-shadow: 0 16px 38px var(--shadow);
}
label {
  display: block;
  margin-bottom: 18px;
}
label span {
  display: block;
  margin-bottom: 7px;
  color: var(--secondary);
  font-size: 12px;
  font-weight: 500;
}
input {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--input-line);
  border-radius: 5px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
}
input:focus {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}
button:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
button {
  width: 100%;
  min-height: 42px;
  border: 0;
  border-radius: 5px;
  background: var(--button);
  color: var(--button-text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
button:not(:disabled):hover {
  background: var(--button-hover);
}
button:not(:disabled):active {
  background: var(--button-active);
}
button:disabled {
  cursor: wait;
  opacity: 0.65;
}
.error {
  margin: -4px 0 16px;
  padding: 9px 11px;
  border-left: 3px solid var(--error);
  background: var(--error-panel);
  color: var(--error);
  font-size: 11px;
}
@media (max-width: 700px) {
  .access-shell {
    grid-template-columns: 1fr;
    padding-top: 7vh;
  }
  .access-shell > header {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    align-items: center;
  }
  .access-panel {
    padding: 20px 17px;
  }
  input {
    font-size: 16px;
  }
  button {
    min-height: 44px;
  }
}
.theme-picker {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  width: 216px;
  margin-left: auto;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--quiet-panel);
}
.theme-picker button {
  min-height: 31px;
  padding: 0 6px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}
.theme-picker button.active {
  background: var(--brand-soft);
  color: var(--brand-text);
  box-shadow: 0 1px 3px var(--shadow);
}
html[data-theme='dark'] {
  color-scheme: dark;
  background: #101110;
  color: #f3f1ef;
  --brand-primary: #c89b5b;
  --brand-hover: #d0a35c;
  --brand-active: #a9783f;
  --brand-gold: #b8894a;
  --tea-deep: #d9aa69;
  --brand-soft: rgba(200, 155, 91, 0.12);
  --brand-text: var(--tea-deep);
  --text-on-brand: #18130d;
  --action-primary: #8e6238;
  --action-primary-hover: #a9783f;
  --action-primary-active: #76502f;
  --text-on-action: #fffaf2;
  --gold-primary: var(--brand-gold);
  --gold-text: #e1b97d;
  --gold-soft: rgba(184, 137, 74, 0.11);
  --status-error: #ff6675;
  --status-error-soft: rgba(255, 102, 117, 0.12);
  --text-primary: #f3f1ef;
  --text-secondary: #d7d2ce;
  --text-tertiary: #9d9690;
  --text-disabled: #6f6a66;
  --text-muted: var(--text-tertiary);
  --surface-page: #101110;
  --surface-card: #171817;
  --surface-hover: #23241f;
  --surface-selected: #241f17;
  --border-default: #2c2d2a;
  --border-subtle: #232421;
  --border-strong: #3c3d39;
  --canvas: var(--surface-page);
  --paper: var(--surface-card);
  --muted-panel: var(--surface-hover);
  --quiet-panel: var(--surface-hover);
  --ink: var(--text-primary);
  --muted: var(--text-muted);
  --secondary: var(--text-secondary);
  --line: var(--border-default);
  --input-line: var(--border-strong);
  --button: var(--action-primary);
  --button-hover: var(--action-primary-hover);
  --button-active: var(--action-primary-active);
  --button-text: var(--text-on-action);
  --focus: var(--brand-primary);
  --error: var(--status-error);
  --error-panel: var(--status-error-soft);
  --shadow: rgba(0, 0, 0, 0.3);
}
html[data-theme='dark'] .theme-picker button.active {
  background: var(--brand-soft);
  color: var(--brand-text);
}
@media (max-width: 700px) {
  .theme-picker {
    grid-column: 1 / -1;
    width: 100%;
    margin: 4px 0 0;
  }
  .theme-picker button {
    min-height: 44px;
  }
}

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