/*
 * 成员空间主题系统。
 * 主题决定构件、材质与动效语法；光相只改变阿莱忒娅之庭内部的照明。
 */

.garden-memory-bloom {
  display: none;
}

body.theme-studio-open {
  overflow: hidden;
}

/* 阿斯忒拉：固定暗相工业界面。 */
html[data-surface="member"][data-member-active="true"][data-member-theme="astera"] {
  --theme-thread: rgba(226, 236, 231, 0.34);
  --theme-veil: rgba(15, 23, 26, 0.82);
  --theme-warmth: #e8f10c;
  --theme-code-surface: rgba(0, 0, 0, 0.18);
}

/* 阿莱忒娅之庭昼相：珍珠灰、雾蓝、忆紫与极少的暖金。 */
html[data-surface="member"][data-member-active="true"][data-member-theme="garden"][data-member-scheme="light"] {
  --canvas: #cbd6dd;
  --canvas-rgb: 203, 214, 221;
  --surface-rgb: 222, 230, 235;
  --surface-1: #dce4e9;
  --surface-2: #c2ced6;
  --surface-3: #b3c1cb;
  --surface-glass: rgba(222, 230, 235, 0.78);
  --text-1: #202a35;
  --text-2: #4d5d6c;
  --text-3: #5f7080;
  --line: rgba(47, 62, 77, 0.16);
  --line-strong: rgba(47, 62, 77, 0.36);
  --accent: #6e5f8b;
  --accent-rgb: 110, 95, 139;
  --accent-ink: #f5f7f8;
  --accent-secondary: #88aabe;
  --scan: #7899ad;
  --glow: rgba(114, 147, 168, 0.2);
  --shadow: 0 20px 58px rgba(43, 57, 70, 0.14);
  --garden-silver: #8397a6;
  --garden-cold: #88aabe;
  --garden-cold-rgb: 136, 170, 190;
  --garden-violet: #796b97;
  --garden-violet-rgb: 121, 107, 151;
  --garden-violet-ink: #584a76;
  --garden-gold: #9b7f45;
  --garden-gold-ink: #6f5726;
  --garden-rose: #a97584;
  --garden-sheet: rgba(219, 227, 232, 0.76);
  --garden-sheet-strong: rgba(233, 238, 241, 0.88);
  --garden-plane-fog: rgba(190, 205, 215, 0.82);
  --garden-plane-focus: rgba(218, 227, 232, 0.9);
  --garden-thread-soft: rgba(93, 113, 128, 0.52);
  --garden-code: #131c26;
  --garden-code-text: #dce5ec;
  --theme-thread: rgba(91, 112, 128, 0.58);
  --theme-veil: rgba(219, 227, 232, 0.78);
  --theme-warmth: #9b7f45;
  --theme-code-surface: #131c26;
  --member-color-scheme: light;
  --status-success: #467562;
  --status-warning: #84652f;
  --status-danger: #914e5b;
  --status-info: #4d7189;
}

/* 阿莱忒娅之庭夜相：银白长河熄灭后的深靛极夜，不使用哥特黑。 */
html[data-surface="member"][data-member-active="true"][data-member-theme="garden"][data-member-scheme="dark"] {
  --canvas: #0a0f18;
  --canvas-rgb: 10, 15, 24;
  --surface-rgb: 17, 23, 34;
  --surface-1: #111722;
  --surface-2: #182130;
  --surface-3: #202c3d;
  --surface-glass: rgba(17, 23, 34, 0.78);
  --text-1: #e5eaf0;
  --text-2: #9eabba;
  --text-3: #6f7d8e;
  --line: rgba(203, 215, 228, 0.13);
  --line-strong: rgba(203, 215, 228, 0.32);
  --accent: #9b92ba;
  --accent-rgb: 155, 146, 186;
  --accent-ink: #090d15;
  --accent-secondary: #7394b5;
  --scan: #82a5c3;
  --glow: rgba(115, 148, 181, 0.2);
  --shadow: 0 24px 68px rgba(0, 0, 0, 0.36);
  --garden-silver: #b5c3d3;
  --garden-cold: #7394b5;
  --garden-cold-rgb: 115, 148, 181;
  --garden-violet: #9b92ba;
  --garden-violet-rgb: 155, 146, 186;
  --garden-violet-ink: #b4abd0;
  --garden-gold: #c0ab70;
  --garden-gold-ink: #d0bd86;
  --garden-rose: #a56c7e;
  --garden-sheet: rgba(17, 23, 34, 0.74);
  --garden-sheet-strong: rgba(21, 28, 41, 0.9);
  --garden-plane-fog: rgba(17, 24, 37, 0.78);
  --garden-plane-focus: rgba(23, 32, 47, 0.88);
  --garden-thread-soft: rgba(181, 195, 211, 0.43);
  --garden-code: #070b12;
  --garden-code-text: #d6e0e9;
  --theme-thread: rgba(181, 195, 211, 0.43);
  --theme-veil: rgba(17, 23, 34, 0.76);
  --theme-warmth: #c0ab70;
  --theme-code-surface: #070b12;
  --member-color-scheme: dark;
  --status-success: #7ea593;
  --status-warning: #b59a65;
  --status-danger: #b97884;
  --status-info: #779ab6;
}

html[data-surface="member"][data-member-active="true"][data-member-theme="garden"] {
  color-scheme: var(--member-color-scheme, inherit);
}

/* 主题工坊：三套真实构图预览，而不是颜色圆点或下拉框。 */
.theme-studio-overlay {
  position: fixed;
  z-index: 240;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 28px;
}

.theme-studio__backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: color-mix(in srgb, var(--canvas) 76%, transparent);
  backdrop-filter: blur(18px) saturate(0.82);
  cursor: default;
}

.theme-studio {
  position: relative;
  width: min(1120px, 100%);
  min-height: 630px;
  overflow: hidden;
  padding: 31px 34px 25px;
  background:
    linear-gradient(134deg, rgba(var(--accent-rgb), 0.075), transparent 34%),
    color-mix(in srgb, var(--surface-1) 97%, transparent);
  box-shadow: none;
  clip-path: polygon(0 19px, 21px 0, 94% 0, 100% 35px, 99% 92%, 93% 100%, 2% 98%, 0 84%);
  filter: drop-shadow(0 34px 72px rgba(0, 0, 0, 0.34));
  isolation: isolate;
}

.theme-studio::before {
  position: absolute;
  z-index: 3;
  top: 0;
  left: 21px;
  width: 36%;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent);
  content: "";
}

.theme-studio::after {
  position: absolute;
  z-index: -1;
  right: -8%;
  bottom: -18%;
  width: 58%;
  height: 54%;
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(var(--accent-rgb), 0.045), transparent 62%);
  clip-path: polygon(12% 0, 100% 18%, 82% 100%, 0 78%);
  content: "";
  transform: rotate(-6deg);
}

.theme-studio__thread {
  position: absolute;
  z-index: -1;
  inset: 0;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: var(--line);
  stroke-width: 1;
  pointer-events: none;
}

.theme-studio__thread path:nth-child(2) {
  stroke: color-mix(in srgb, var(--accent) 48%, transparent);
  stroke-dasharray: 2 9;
}

.theme-studio__thread circle {
  fill: var(--theme-warmth);
  stroke: none;
}

.theme-studio__head {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 30px;
  padding: 0 3px 21px;
  border-bottom: 1px solid var(--line-strong);
}

.theme-studio__head span {
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 9px;
  letter-spacing: 0.16em;
}

.theme-studio__head h2 {
  margin-top: 8px;
  font-family: var(--font-sacred);
  font-size: 31px;
  font-weight: 420;
  letter-spacing: -0.03em;
}

.theme-studio__head p {
  margin-top: 5px;
  color: var(--text-3);
  font-size: 10px;
}

.theme-studio__head > button {
  position: relative;
  width: 42px;
  height: 42px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
}

.theme-studio__head > button::before {
  position: absolute;
  inset: 4px;
  border: 1px solid var(--line);
  content: "";
  clip-path: polygon(0 7px, 8px 0, 100% 0, 92% 100%, 0 88%);
}

.theme-studio__head > button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.2;
}

.theme-family-fieldset,
.theme-phase-fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.theme-family-fieldset > legend {
  padding: 20px 2px 11px;
  color: var(--text-2);
  font-family: var(--font-ui);
  font-size: 10px;
  letter-spacing: 0.06em;
}

.theme-family-grid {
  display: grid;
  gap: 17px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.theme-choice-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.theme-family-card {
  position: relative;
  min-width: 0;
  min-height: 212px;
  display: grid;
  align-content: end;
  overflow: hidden;
  padding: 0 19px 17px;
  border: 0;
  background: rgba(var(--canvas-rgb), 0.2);
  color: var(--text-2);
  clip-path: polygon(0 12px, 13px 0, 92% 0, 100% 20px, 97% 100%, 6% 95%, 0 78%);
  cursor: pointer;
  isolation: isolate;
  transition: color 200ms ease, transform 300ms var(--ease-ceremonial);
}

.theme-family-card::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  border: 1px solid var(--line);
  background: linear-gradient(132deg, rgba(var(--accent-rgb), 0.035), transparent 66%);
  content: "";
  clip-path: inherit;
}

.theme-family-card::after {
  position: absolute;
  z-index: 3;
  right: 15px;
  bottom: 0;
  left: 15px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--theme-card-accent), transparent);
  content: "";
  opacity: 0;
  transform: scaleX(0.28);
  transition: opacity 180ms ease, transform 320ms var(--ease-ceremonial);
}

.theme-family-card:has(input:checked) {
  color: var(--text-1);
  transform: translateY(-3px);
}

.theme-family-card:has(input:checked)::after {
  opacity: 1;
  transform: scaleX(1);
}

.theme-family-card:has(input:focus-visible)::before {
  border-color: var(--theme-card-accent);
  box-shadow: inset 0 0 0 1px var(--theme-card-accent);
}

.theme-family-card--astera {
  --theme-card-accent: #e8f10c;
  background: #0b1113;
  color: #aeb8b7;
}

.theme-family-card--astera:has(input:checked) {
  color: #f0f4f1;
}

.theme-family-card--garden {
  --theme-card-accent: var(--garden-violet, #897ea3);
  background: linear-gradient(146deg, rgba(239, 243, 246, 0.92), rgba(200, 213, 223, 0.62));
  color: #5f6d7a;
}

.theme-family-card--garden:has(input:checked) {
  color: #34404c;
}

html[data-member-theme="garden"][data-member-scheme="dark"] .theme-family-card--garden {
  background: linear-gradient(146deg, rgba(25, 33, 47, 0.94), rgba(43, 51, 69, 0.68));
  color: #9eabba;
}

html[data-member-theme="garden"][data-member-scheme="dark"] .theme-family-card--garden:has(input:checked) {
  color: #e5eaf0;
}

.theme-family-card__art {
  position: absolute;
  z-index: -1;
  inset: 0;
  opacity: 0.92;
}

.theme-family-card__art svg {
  width: 100%;
  height: 100%;
  overflow: visible;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-family-card--astera .theme-preview-plane {
  fill: rgba(232, 241, 12, 0.025);
  stroke: rgba(226, 236, 231, 0.22);
}

.theme-family-card--astera .theme-preview-contour {
  stroke: rgba(226, 236, 231, 0.2);
  stroke-width: 1;
}

.theme-family-card--astera .theme-preview-live {
  stroke: #e8f10c;
  stroke-width: 1.4;
}

.theme-family-card--astera circle {
  fill: #e8f10c;
  stroke: none;
}

.theme-family-card--garden .theme-preview-veil {
  fill: rgba(255, 255, 255, 0.22);
  stroke: rgba(105, 122, 139, 0.23);
}

.theme-family-card--garden .theme-preview-thread {
  stroke: #8c9baa;
  stroke-width: 1;
}

.theme-family-card--garden .theme-preview-bloom {
  fill: rgba(137, 126, 163, 0.08);
  stroke: #897ea3;
}

.theme-family-card--garden .theme-preview-ice {
  stroke: #9cb9cc;
  stroke-dasharray: 3 5;
}

.theme-family-card--garden circle {
  fill: #a58d51;
  stroke: none;
}

.theme-family-card--white-oath {
  --theme-card-accent: #c66274;
  background: #151722;
  color: #d9d5cc;
}

.theme-family-card--white-oath:has(input:checked) {
  color: #f8f5ec;
}

.theme-family-card--white-oath .theme-preview-still-night { fill: #151722; stroke: none; }
.theme-family-card--white-oath .theme-preview-still-paper { fill: #e9e6de; stroke: none; }
.theme-family-card--white-oath .theme-preview-still-crimson { fill: rgba(198, 98, 116, 0.58); stroke: none; }
.theme-family-card--white-oath .theme-preview-still-cyan { stroke: #91c2c8; stroke-width: 1.5; }
.theme-family-card--white-oath .theme-preview-still-slice { fill: rgba(81, 88, 117, 0.48); stroke: #151722; }
.theme-family-card--white-oath .theme-preview-still-seam { stroke: #b59652; stroke-width: 1; }
.theme-family-card--white-oath circle { fill: #c66274; stroke: #f8f5ec; stroke-width: 1; }

@media (max-width: 960px) {
  .theme-family-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .theme-family-card--white-oath { grid-column: 1 / -1; min-height: 180px; }
}

.theme-family-card__copy {
  position: relative;
  z-index: 2;
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.theme-family-card__copy small {
  color: currentColor;
  font-family: var(--font-display);
  font-size: 8px;
  letter-spacing: 0.12em;
  opacity: 0.62;
}

.theme-family-card__copy b {
  margin-top: 5px;
  font-family: var(--font-sacred);
  font-size: 19px;
  font-weight: 480;
}

.theme-family-card__copy em {
  margin-top: 2px;
  font-size: 9px;
  font-style: normal;
  opacity: 0.72;
}

.theme-family-card__state {
  position: absolute;
  top: 14px;
  right: 15px;
  color: currentColor;
  font-family: var(--font-data);
  font-size: 9px;
  opacity: 0.45;
}

.theme-phase-fieldset {
  position: relative;
  margin-top: 22px;
  padding-top: 17px;
  border-top: 1px solid var(--line);
  transition: opacity 220ms ease;
}

.theme-phase-fieldset[disabled] {
  opacity: 0.38;
}

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

.theme-phase-fieldset__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.theme-phase-fieldset__head > span {
  color: var(--text-2);
  font-size: 10px;
  letter-spacing: 0.06em;
}

.theme-phase-fieldset__head output {
  color: var(--text-3);
  font-size: 9px;
}

.theme-phase-track {
  position: relative;
  width: min(470px, 100%);
  display: grid;
  gap: 42px;
  margin: 13px auto 0;
  grid-template-columns: repeat(3, 1fr);
}

.theme-phase-track::before,
.theme-phase-track::after {
  position: absolute;
  z-index: -1;
  right: 8%;
  left: 8%;
  height: 1px;
  content: "";
}

.theme-phase-track::before {
  top: 23px;
  background: linear-gradient(90deg, var(--line), var(--garden-violet, var(--accent)), var(--line));
  transform: rotate(-1.5deg);
}

.theme-phase-track::after {
  top: 29px;
  background: linear-gradient(90deg, transparent, var(--line-strong), transparent);
  transform: rotate(1.2deg);
}

.theme-phase-track label {
  position: relative;
  min-height: 73px;
  display: grid;
  place-items: start center;
  color: var(--text-3);
  cursor: pointer;
}

.theme-phase-track svg {
  width: 44px;
  height: 44px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1;
}

.theme-phase-track circle {
  fill: var(--canvas);
  stroke: currentColor;
}

.theme-phase-track span {
  margin-top: 4px;
  font-size: 9px;
  letter-spacing: 0.05em;
}

.theme-phase-track label:has(input:checked) {
  color: var(--garden-violet, var(--accent));
}

.theme-phase-track label:has(input:checked) circle {
  fill: var(--garden-gold, var(--accent));
  stroke: var(--garden-gold, var(--accent));
}

.theme-phase-track label:has(input:focus-visible) {
  outline: 0;
  box-shadow: inset 0 0 0 1px currentColor;
}

.theme-studio__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 14px;
  padding-top: 11px;
  border-top: 1px solid var(--line);
  color: var(--text-3);
  font-size: 8px;
}

.theme-studio__foot b {
  color: var(--text-2);
  font-weight: 500;
}

.profile-menu > .profile-menu__action--appearance > svg:first-child {
  color: var(--accent);
}

/* 阿斯忒拉下修正曾经依赖浅色路由的硬编码材质。 */
html[data-surface="member"][data-member-active="true"][data-member-theme="astera"] .sacred-orbit {
  background: radial-gradient(ellipse, rgba(var(--accent-rgb), 0.09), transparent 64%);
  box-shadow: 0 0 34px rgba(var(--accent-rgb), 0.09);
}

html[data-surface="member"][data-member-active="true"][data-member-theme="astera"] .model-focus {
  background:
    linear-gradient(131deg, rgba(255, 255, 255, 0.018), rgba(var(--model-accent-rgb), 0.07) 50%, rgba(255, 255, 255, 0.012)),
    rgba(var(--surface-rgb), 0.72);
  box-shadow: none;
}

html[data-surface="member"][data-member-active="true"][data-member-theme="astera"] .masthead-progress {
  background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.075), rgba(var(--canvas-rgb), 0.38));
}

html[data-surface="member"][data-member-active="true"][data-member-theme="astera"] .view--models .masthead-title h1,
html[data-surface="member"][data-member-active="true"][data-member-theme="astera"] .view--guide .masthead-title h1 {
  font-family: var(--font-display);
  font-weight: 520;
}
