:root {
  color-scheme: dark;
  --bg: #0c1117;
  --surface: #151b23;
  --surface-soft: #10161e;
  --surface-tint: #17251f;
  --line: #273241;
  --line-strong: #3a4657;
  --text: #e7edf4;
  --muted: #9ba8b7;
  --accent: #30c29b;
  --accent-strong: #72e0bd;
  --blue: #6fa0ff;
  --amber: #e2ad54;
  --rose: #ed7f9b;
  --shadow: none;
  --ai-disclaimer-height: 28px;
  --advisor-panel-height: calc(100vh - 126px - var(--ai-disclaimer-height));
}

* { box-sizing: border-box; }

html { min-width: 320px; }

body {
  margin: 0;
  min-height: 100vh;
  padding-bottom: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

.app-shell {
  width: min(1680px, 100%);
  margin: 0 auto;
  padding: 20px;
}

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

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

.ui-icon {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.qq-group-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border: 1px solid rgba(48, 194, 155, 0.42);
  border-radius: 8px;
  padding: 0 12px;
  color: #07110e;
  background: var(--accent-strong);
  font-size: 13px;
  font-weight: 850;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.qq-group-link:hover {
  border-color: var(--accent-strong);
  background: #8ef0d1;
}

.qq-group-link:focus-visible {
  outline: 3px solid rgba(114, 224, 189, 0.35);
  outline-offset: 2px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-icon {
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  border: 1px solid rgba(114, 224, 189, 0.34);
  border-radius: 14px;
  background: var(--surface-soft);
  object-fit: cover;
  box-shadow: 0 0 0 3px rgba(48, 194, 155, 0.08);
}

.brand-copy {
  min-width: 0;
}

.app-tabs {
  display: inline-flex;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.app-tab {
  min-width: 96px;
  height: 34px;
  border: 0;
  border-radius: 6px;
  padding: 0 14px;
  color: var(--muted);
  background: transparent;
  font-size: 13px;
  font-weight: 850;
}

.app-tab.is-active {
  color: #ffffff;
  background: var(--accent);
}

.app-view[hidden] {
  display: none;
}

.brand h1,
.section-title h2,
.hero-panel h2,
h3,
p {
  margin-top: 0;
}

.brand h1 {
  margin-bottom: 0;
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.ai-disclaimer-bar {
  position: fixed;
  z-index: 80;
  right: 0;
  bottom: 0;
  left: 0;
  min-height: 24px;
  border-top: 1px solid transparent;
  padding: 4px 12px;
  background: transparent;
  color: var(--muted);
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
  backdrop-filter: none;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.status,
.count-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  border: 1px solid #bfe3da;
  border-radius: 999px;
  padding: 4px 10px;
  color: var(--accent-strong);
  background: #e9f8f4;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.search-panel {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(520px, 0.85fr);
  gap: 14px;
  align-items: end;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

label span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: #fbfdff;
  outline: none;
}

input,
select {
  height: 42px;
  padding: 0 12px;
}

textarea {
  min-height: 112px;
  resize: vertical;
  padding: 12px;
  line-height: 1.55;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(40, 160, 132, 0.14);
}

.search-controls {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1fr auto;
  gap: 10px;
  align-items: end;
}

.workspace {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.advisor-layout {
  display: grid;
  grid-template-columns: minmax(360px, 0.78fr) minmax(0, 1.22fr);
  gap: 14px;
  align-items: stretch;
}

.advisor-card {
  display: flex;
  flex-direction: column;
  height: var(--advisor-panel-height);
  min-height: 0;
  max-height: var(--advisor-panel-height);
  overflow: hidden;
}

.advisor-card .ai-form {
  flex: 1 1 auto;
  min-height: 0;
}

.panel,
.hero-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel {
  padding: 16px;
}

.hero-panel {
  padding: 24px;
  background: linear-gradient(135deg, #ffffff 0%, #eef8f5 65%, #fff7eb 100%);
}

.hero-character-head {
  display: flex;
  align-items: center;
  gap: 18px;
}

.hero-avatar {
  flex: 0 0 auto;
}

.hero-avatar-image {
  display: grid;
  place-items: center;
  width: 96px;
  height: 96px;
  border: 1px solid #bfe3da;
  border-radius: 8px;
  background: #f8fbfd;
  color: var(--accent-strong);
  object-fit: cover;
  object-position: top center;
  font-size: 34px;
  font-weight: 900;
}

.hero-character-copy {
  min-width: 0;
}

.hero-panel h2 {
  margin-bottom: 12px;
  font-size: 36px;
  line-height: 1.15;
  letter-spacing: 0;
}

.section-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.section-title h2 {
  margin-bottom: 0;
  font-size: 20px;
  line-height: 1.25;
}

h3 {
  margin-bottom: 12px;
  font-size: 16px;
  line-height: 1.3;
}

.result-pane {
  position: sticky;
  top: 14px;
}

.result-list {
  display: grid;
  gap: 8px;
  max-height: calc(100vh - 210px);
  overflow: auto;
  padding-right: 2px;
}

.result-card {
  position: relative;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 86px;
  padding: 12px 12px 12px 76px;
  background: #fbfdff;
  color: inherit;
  text-align: left;
}

.result-avatar {
  position: absolute;
  top: 12px;
  left: 12px;
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border: 1px solid #cad9e3;
  border-radius: 8px;
  background: #f8fbfd;
  color: var(--accent-strong);
  object-fit: cover;
  object-position: top center;
  font-size: 20px;
  font-weight: 900;
}

.result-card:hover,
.result-card.is-active {
  border-color: #a8dcd0;
  background: var(--surface-tint);
}

.result-card strong {
  display: block;
  margin: 6px 0 5px;
  overflow-wrap: anywhere;
  font-size: 15px;
  line-height: 1.25;
}

.result-type {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border-radius: 999px;
  padding: 2px 8px;
  color: #ffffff;
  background: var(--accent);
  font-size: 11px;
  font-weight: 800;
}

.result-type.type-card { background: var(--blue); }
.result-type.type-memory { background: var(--amber); }
.result-type.type-companion { background: var(--rose); }
.result-type.type-mechanic { background: #6979d6; }
.result-type.type-tag { background: #718096; }

.mini-meta,
.muted {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.detail-pane {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.summary-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(260px, 0.75fr);
  gap: 14px;
}

.progression-grid {
  grid-template-columns: minmax(0, 0.85fr) minmax(360px, 1.15fr);
}

.panel.compact {
  min-height: 138px;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border: 1px solid #cad9e3;
  border-radius: 999px;
  padding: 3px 9px;
  background: #f8fbfd;
  color: #374b5c;
  font-size: 12px;
  font-weight: 650;
}

.lookup-ref {
  cursor: help;
}

.tag.lookup-ref {
  border-color: #a8dcd0;
  color: var(--accent-strong);
  background: #eef8f5;
}

.lookup-ref:hover,
.lookup-ref:focus-visible {
  border-color: var(--accent);
  color: var(--accent-strong);
  background: #e2f4ef;
  outline: none;
}

.lookup-inline {
  display: inline;
  border-bottom: 1px dotted var(--accent);
  color: var(--accent-strong);
  font-weight: 750;
}

.lookup-inline:hover,
.lookup-inline:focus-visible {
  background: #e9f8f4;
}

.lookup-popover {
  position: fixed;
  z-index: 50;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface);
  box-shadow: 0 16px 38px rgba(36, 52, 70, 0.16);
  color: var(--text);
}

.lookup-popover[hidden] {
  display: none;
}

.lookup-popover-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.lookup-popover strong {
  display: block;
  margin-bottom: 5px;
  overflow-wrap: anywhere;
  font-size: 15px;
  line-height: 1.35;
}

.lookup-popover p {
  margin: 8px 0 10px;
  color: #34495a;
  font-size: 13px;
  line-height: 1.65;
  white-space: pre-wrap;
}

.info-list {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 9px 12px;
  margin: 0;
  font-size: 14px;
}

.info-list dt {
  color: var(--muted);
}

.info-list dd {
  margin: 0;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.friend-name {
  margin-bottom: 6px;
  font-size: 20px;
  font-weight: 850;
}

.stat-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 10px;
}

.stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 10px;
  background: #fbfdff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.stat-chip strong {
  color: var(--text);
}

.progression-list {
  display: grid;
  gap: 8px;
}

.progression-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fbfdff;
}

.progression-item p {
  margin: 6px 0 0;
  color: #34495a;
  font-size: 13px;
  line-height: 1.6;
}

.progression-item strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 13px;
  line-height: 1.35;
}

.threshold-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.threshold-list span {
  display: inline-flex;
  min-height: 26px;
  border: 1px solid #cad9e3;
  border-radius: 999px;
  padding: 3px 9px;
  background: #f8fbfd;
  color: #374b5c;
  font-size: 12px;
  font-weight: 650;
}

.mode-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.tab,
.ghost-button,
.primary-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.tab {
  min-height: 34px;
  padding: 0 11px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.tab.is-active {
  border-color: var(--accent);
  color: #ffffff;
  background: var(--accent);
}

.ghost-button {
  height: 42px;
  min-width: 70px;
  padding: 0 14px;
  color: var(--accent-strong);
  background: #f4fbf9;
  font-weight: 800;
}

.primary-button {
  height: 38px;
  min-width: 76px;
  border-color: var(--accent);
  padding: 0 16px;
  color: #ffffff;
  background: var(--accent);
  font-weight: 850;
}

.ghost-button:hover,
.primary-button:hover,
.tab:hover {
  filter: brightness(0.98);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
}

.card-item,
.evidence-item,
.team-result,
.advice-block {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}

.card-item {
  padding: 14px;
}

.card-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
}

.card-title strong {
  font-size: 15px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.badge {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 3px 8px;
  color: #ffffff;
  background: var(--blue);
  font-size: 11px;
  font-weight: 800;
}

.entry {
  margin-top: 10px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
  color: #34495a;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.entry-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.ai-form {
  display: grid;
  grid-template-rows: minmax(0, 2fr) minmax(0, 7fr) auto;
  gap: 10px;
  min-height: 0;
}

.query-field {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
}

.query-field textarea {
  min-height: 0;
  resize: none;
}

.choice-section {
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfdff;
  overflow: hidden;
}

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

.choice-head h3 {
  margin-bottom: 0;
}

.role-pool-section {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  min-height: 0;
}

.mode-section {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  padding: 8px;
}

.mode-section .choice-head {
  align-items: center;
  margin-bottom: 0;
}

.mode-section .mini-meta {
  display: none;
}

.role-pool-head-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--accent-strong);
  background: var(--surface-soft);
}

.icon-button:hover,
.icon-button:focus-visible {
  border-color: rgba(48, 194, 155, 0.45);
  background: rgba(48, 194, 155, 0.1);
}

.expand-icon {
  width: 16px;
  height: 16px;
  background:
    linear-gradient(currentColor, currentColor) left top / 7px 2px no-repeat,
    linear-gradient(currentColor, currentColor) left top / 2px 7px no-repeat,
    linear-gradient(currentColor, currentColor) right top / 7px 2px no-repeat,
    linear-gradient(currentColor, currentColor) right top / 2px 7px no-repeat,
    linear-gradient(currentColor, currentColor) left bottom / 7px 2px no-repeat,
    linear-gradient(currentColor, currentColor) left bottom / 2px 7px no-repeat,
    linear-gradient(currentColor, currentColor) right bottom / 7px 2px no-repeat,
    linear-gradient(currentColor, currentColor) right bottom / 2px 7px no-repeat;
}

.role-pool-section.is-expanded .expand-icon {
  background:
    linear-gradient(currentColor, currentColor) 3px 3px / 6px 2px no-repeat,
    linear-gradient(currentColor, currentColor) 3px 3px / 2px 6px no-repeat,
    linear-gradient(currentColor, currentColor) calc(100% - 3px) 3px / 6px 2px no-repeat,
    linear-gradient(currentColor, currentColor) calc(100% - 3px) 3px / 2px 6px no-repeat,
    linear-gradient(currentColor, currentColor) 3px calc(100% - 3px) / 6px 2px no-repeat,
    linear-gradient(currentColor, currentColor) 3px calc(100% - 3px) / 2px 6px no-repeat,
    linear-gradient(currentColor, currentColor) calc(100% - 3px) calc(100% - 3px) / 6px 2px no-repeat,
    linear-gradient(currentColor, currentColor) calc(100% - 3px) calc(100% - 3px) / 2px 6px no-repeat;
}

.role-pool-bulk-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.bulk-action-button {
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  color: var(--accent-strong);
  background: #ffffff;
  font-size: 12px;
  font-weight: 800;
}

.bulk-action-button:hover:not(:disabled) {
  border-color: #a8dcd0;
  background: var(--surface-tint);
}

.bulk-action-button:disabled {
  cursor: not-allowed;
  color: #9aa9b5;
  background: #f3f6f8;
}

.role-pool-tools {
  margin-bottom: 10px;
}

.role-search-field input {
  height: 38px;
}

body.role-pool-expanded {
  overflow: hidden;
}

body.role-pool-expanded .advisor-card {
  z-index: 130;
  overflow: visible;
}

.role-pool-section.is-expanded {
  position: fixed;
  z-index: 120;
  inset: 18px;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  padding: 16px;
  background: var(--surface);
  box-shadow: 0 0 0 100vmax rgba(7, 11, 16, 0.72);
  overflow: hidden;
}

.role-pool-section.is-expanded .character-choice-grid {
  grid-template-columns: repeat(auto-fill, minmax(178px, 1fr));
  min-height: 0;
  max-height: none;
}

.role-pool-section.is-expanded .role-search-field input {
  height: 42px;
}

.role-pool-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.role-pool-summary span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 10px;
  color: var(--muted);
  background: var(--surface);
  font-size: 12px;
  font-weight: 750;
}

.role-pool-summary strong {
  margin-left: 5px;
  color: var(--text);
  overflow-wrap: anywhere;
}

.choice-grid {
  display: grid;
  gap: 8px;
  min-height: 0;
}

.character-choice-grid {
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  min-height: 0;
  max-height: none;
  overflow: auto;
  padding-right: 2px;
}

.mode-choice-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  justify-content: stretch;
  gap: 8px;
  align-items: center;
  overflow: auto;
  padding-right: 0;
}

.choice-card {
  position: relative;
  min-height: 92px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 12px 11px 38px;
  background: var(--surface);
  color: inherit;
  text-align: left;
}

.choice-card:hover {
  border-color: #a8dcd0;
  background: var(--surface-tint);
}

.choice-card.is-selected {
  border-color: var(--accent);
  background: #e9f8f4;
  box-shadow: inset 0 0 0 1px rgba(40, 160, 132, 0.18);
}

.choice-card.is-owned {
  border-color: #91d7c9;
  background: #eef8f5;
}

.choice-card.is-banned {
  border-color: #e5b3bf;
  background: #fff5f7;
}

.choice-card::before {
  content: "";
  position: absolute;
  top: 13px;
  left: 12px;
  width: 16px;
  height: 16px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: #ffffff;
}

.choice-card.is-selected::before {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: inset 0 0 0 3px #ffffff;
}

.role-choice-card {
  min-height: 148px;
  padding: 10px;
}

.role-choice-card::before {
  display: none;
}

.mode-choice-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 0;
  width: 100%;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px 9px;
  color: var(--text);
  background: var(--surface);
  font-size: 12px;
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
}

.mode-choice-button:hover {
  border-color: #a8dcd0;
  background: var(--surface-tint);
}

.mode-choice-button.is-selected {
  border-color: rgba(114, 224, 189, 0.52);
  background: var(--surface);
  box-shadow: none;
}

.mode-choice-check {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: #ffffff;
}

.mode-choice-button.is-selected .mode-choice-check {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: inset 0 0 0 2px #ffffff;
}

.role-pool-empty {
  grid-column: 1 / -1;
  display: grid;
  place-items: center;
  min-height: 180px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 13px;
  font-weight: 800;
}

.choice-card strong {
  display: block;
  margin-bottom: 5px;
  overflow-wrap: anywhere;
  font-size: 14px;
  line-height: 1.3;
}

.choice-card .mini-meta {
  display: block;
}

.role-choice-main {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.role-choice-avatar {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid #cad9e3;
  border-radius: 8px;
  background: #f8fbfd;
  color: var(--accent-strong);
  object-fit: cover;
  object-position: top center;
  font-size: 18px;
  font-weight: 900;
}

.role-choice-copy {
  min-width: 0;
}

.choice-card .tag-row {
  margin-top: 6px;
}

.choice-card .tag {
  min-height: 20px;
  padding: 1px 6px;
  font-size: 10px;
}

.choice-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 8px;
}

.choice-action {
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #ffffff;
  font-size: 12px;
  font-weight: 850;
}

.choice-action:hover {
  border-color: #a8dcd0;
  color: var(--accent-strong);
}

.choice-action.is-owned {
  border-color: var(--accent);
  color: #ffffff;
  background: var(--accent);
}

.choice-action.is-banned {
  border-color: var(--rose);
  color: #ffffff;
  background: var(--rose);
}

.advisor-result-panel {
  min-width: 0;
}

.advisor-result-panel {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  height: var(--advisor-panel-height);
  min-height: 0;
  max-height: var(--advisor-panel-height);
  overflow: hidden;
}

.advisor-card {
  grid-column: 1;
}

.advisor-result-body {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  flex-direction: column;
  gap: 12px;
}

.advisor-output {
  display: block;
  flex: 1 1 0;
  min-height: 0;
  overflow: auto;
  padding-right: 2px;
  overscroll-behavior: contain;
}

.advisor-output > .muted {
  margin: 0;
}

.evidence-list {
  display: grid;
  gap: 8px;
  min-width: 0;
  max-height: 420px;
  overflow: auto;
  padding-right: 2px;
}

.evidence-item {
  padding: 11px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.evidence-item strong {
  display: block;
  margin-top: 6px;
  overflow-wrap: anywhere;
}

.evidence-item p {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.advice-block {
  padding: 12px;
  width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
}

.advisor-output .advice-block {
  min-height: 100%;
  overflow: visible;
}

.advice-block h3 {
  margin-top: 18px;
  margin-bottom: 8px;
}

.advice-block h3:first-child {
  margin-top: 0;
}

.markdown-body {
  color: var(--text);
  font-size: 14px;
  line-height: 1.72;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body p,
.markdown-body ul {
  margin: 0 0 12px;
}

.markdown-body h2 {
  font-size: 22px;
  line-height: 1.25;
}

.markdown-body h3 {
  margin-top: 18px;
  font-size: 17px;
}

.markdown-body h4 {
  margin-top: 14px;
  font-size: 15px;
}

.markdown-body ul {
  padding-left: 18px;
}

.markdown-body li {
  margin-bottom: 6px;
  overflow-wrap: anywhere;
}

.markdown-body code {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1px 5px;
  background: var(--surface-soft);
  color: var(--accent-strong);
  font-size: 0.92em;
}

.team-result {
  margin-top: 10px;
  padding: 12px;
}

.team-roster-spotlight {
  display: grid;
  gap: 14px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #101820;
}

.team-roster-group {
  display: grid;
  gap: 10px;
  justify-items: center;
  width: 100%;
  min-width: 0;
}

.team-roster-group + .team-roster-group {
  border-top: 1px solid rgba(191, 227, 218, 0.2);
  padding-top: 14px;
}

.team-roster-meta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 0;
  color: var(--text);
  font-size: 14px;
}

.team-roster-meta strong {
  overflow-wrap: anywhere;
}

.team-roster-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(92px, 128px));
  justify-content: center;
  gap: 12px;
  width: 100%;
}

.team-roster-member {
  display: grid;
  justify-items: center;
  gap: 8px;
  min-width: 0;
}

.team-roster-avatar {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border: 1px solid #bfe3da;
  border-radius: 8px;
  background: #f8fbfd;
  color: var(--accent-strong);
  object-fit: cover;
  object-position: center;
  font-size: 28px;
  font-weight: 900;
}

.team-roster-member strong {
  max-width: 100%;
  overflow-wrap: anywhere;
  text-align: center;
  font-size: 14px;
  line-height: 1.25;
}

.info-list.wide {
  grid-template-columns: 70px minmax(0, 1fr);
}

.evidence-points {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.stream-output {
  flex: 1 1 auto;
  min-height: 260px;
  overflow: auto;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text);
  font: inherit;
}

.stream-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.stream-head strong {
  font-size: 14px;
}

.deep-thinking-panel {
  position: sticky;
  top: 0;
  z-index: 2;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}

.trace-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  border: 0;
  border-radius: 8px;
  padding: 11px 12px;
  color: inherit;
  background: transparent;
  text-align: left;
}

.trace-toggle strong {
  display: block;
  font-size: 15px;
  line-height: 1.25;
}

.trace-toggle:hover,
.trace-toggle:focus-visible {
  background: var(--surface-tint);
  outline: none;
}

.deep-thinking-panel.is-expanded {
  border-color: #a8dcd0;
  background: #eef8f5;
}

.deep-thinking-panel.is-collapsed .agent-trace {
  display: none;
}

.agent-trace {
  display: grid;
  gap: 6px;
  min-width: 0;
  max-height: min(36vh, 460px);
  overflow: auto;
  margin: 0 12px 12px;
  padding-right: 2px;
}

.trace-step {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: #fbfdff;
}

.trace-running {
  border-color: #a8dcd0;
  background: #eef8f5;
}

.trace-streaming {
  border-color: #b8c9ef;
  background: #f2f6ff;
}

.trace-done {
  border-color: var(--line);
}

.trace-error {
  border-color: #e5b3bf;
  background: #fff5f7;
}

.trace-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 850;
}

.trace-icon::before {
  content: "•";
}

.trace-running .trace-icon::before,
.trace-streaming .trace-icon::before {
  content: "";
  width: 13px;
  height: 13px;
  border: 2px solid rgba(48, 194, 155, 0.25);
  border-top-color: var(--accent);
  border-radius: 999px;
  animation: trace-spin 0.8s linear infinite;
}

.trace-done .trace-icon::before {
  content: "✓";
}

.trace-error .trace-icon::before {
  content: "!";
  color: var(--rose);
}

.trace-line {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.35;
  white-space: nowrap;
}

.trace-line strong {
  flex: 0 0 auto;
  color: var(--muted);
}

.trace-line span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.answer-view {
  display: grid;
  gap: 16px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.65;
}

.answer-title,
.answer-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.answer-title h2,
.answer-heading h3,
.answer-section h3 {
  margin: 0;
  line-height: 1.25;
}

.answer-title h2 {
  font-size: 22px;
}

.answer-heading h3,
.answer-section h3 {
  font-size: 17px;
}

.answer-section {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.answer-summary {
  margin: 0;
  color: #34495a;
}

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

.answer-table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  table-layout: fixed;
}

.answer-table th,
.answer-table td {
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
  vertical-align: top;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.answer-table tr:last-child th,
.answer-table tr:last-child td {
  border-bottom: 0;
}

.answer-table th {
  width: 112px;
  color: #405568;
  background: var(--surface-soft);
  font-weight: 850;
  text-align: left;
}

.answer-list,
.member-role-list {
  margin: 0;
  padding-left: 18px;
}

.answer-list li,
.member-role-list li {
  margin: 0 0 6px;
}

.answer-list li:last-child,
.member-role-list li:last-child {
  margin-bottom: 0;
}

.member-role-list li {
  display: grid;
  gap: 2px;
}

.citation-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.citation-ref {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 8px;
  background: var(--surface-soft);
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 850;
}

.evidence-summary-table p {
  margin: 4px 0 0;
  color: #34495a;
}

.status.usage-status {
  justify-content: flex-start;
  gap: 9px;
  min-height: 34px;
  border-color: rgba(114, 224, 189, 0.5);
  border-radius: 8px;
  padding: 6px 12px;
  background: linear-gradient(135deg, rgba(114, 224, 189, 0.24), rgba(48, 194, 155, 0.14));
  color: #dffdf4;
  white-space: nowrap;
}

.usage-stat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #dffdf4;
  font-size: 12px;
  font-weight: 850;
  line-height: 1;
}

.usage-stat strong {
  color: #ffffff;
  font-size: 14px;
  line-height: 1;
}

.usage-status > .ui-icon,
.usage-stat .ui-icon {
  color: var(--accent-strong);
}

.usage-divider {
  width: 1px;
  height: 16px;
  background: rgba(114, 224, 189, 0.34);
}

.result-vote {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  border: 1px solid rgba(114, 224, 189, 0.28);
  border-radius: 8px;
  padding: 10px;
  background: #111820;
}

.result-vote-head,
.result-vote-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.result-vote-head {
  justify-content: space-between;
}

.result-vote-head h3 {
  margin: 0;
  font-size: 14px;
  line-height: 1.3;
}

.vote-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 78px;
  min-height: 34px;
  border: 1px solid rgba(114, 224, 189, 0.46);
  border-radius: 8px;
  padding: 6px 10px;
  background: var(--accent);
  color: #07110e;
  font-size: 13px;
  font-weight: 850;
}

.vote-button-dislike {
  border-color: rgba(237, 127, 155, 0.48);
  background: var(--rose);
  color: #1c0810;
}

.vote-button:hover:not(:disabled),
.vote-button.is-active {
  border-color: rgba(255, 255, 255, 0.62);
  filter: brightness(1.08);
  box-shadow: 0 0 0 3px rgba(114, 224, 189, 0.18);
}

.vote-button-dislike:hover:not(:disabled),
.vote-button-dislike.is-active {
  box-shadow: 0 0 0 3px rgba(237, 127, 155, 0.18);
}

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

@media (max-width: 1280px) {
  .workspace {
    grid-template-columns: 300px minmax(0, 1fr);
  }

  .advisor-layout {
    grid-template-columns: minmax(300px, 0.82fr) minmax(0, 1.18fr);
  }
}

@media (max-width: 940px) {
  .app-shell {
    padding: 14px 14px calc(14px + var(--ai-disclaimer-height));
  }

  .topbar,
  .topbar-actions,
  .search-panel,
  .workspace,
  .summary-grid,
  .advisor-layout {
    display: grid;
    grid-template-columns: 1fr;
  }

  .advisor-card,
  .advisor-result-panel {
    grid-column: auto;
    grid-row: auto;
  }

  .advisor-card {
    height: auto;
    min-height: auto;
    max-height: none;
    overflow: visible;
  }

  .advisor-result-panel {
    height: auto;
    min-height: auto;
    max-height: none;
    overflow: visible;
  }

  .ai-form {
    grid-template-rows: auto auto auto;
  }

  .query-field textarea {
    min-height: 104px;
    resize: vertical;
  }

  .advisor-result-body,
  .advisor-output,
  .advisor-output .advice-block {
    min-height: auto;
  }

  .advisor-output {
    flex: 0 0 auto;
  }

  .result-pane {
    position: static;
  }

  .result-list {
    max-height: 360px;
  }

  .search-controls {
    grid-template-columns: 1fr 1fr;
  }

  .hero-panel h2 {
    font-size: 30px;
  }

  .topbar-actions {
    justify-items: start;
  }

  .status.usage-status {
    width: 100%;
    flex-wrap: wrap;
  }

  .result-vote {
    align-items: stretch;
    flex-direction: column;
  }

  .result-vote-head {
    justify-content: flex-start;
  }

  .brand {
    width: 100%;
  }
}

@media (max-width: 560px) {
  .search-controls {
    grid-template-columns: 1fr;
  }

  .section-title {
    display: grid;
  }

  .choice-head {
    display: grid;
  }

  .role-pool-head-actions,
  .role-pool-bulk-actions {
    justify-content: flex-start;
  }

  .mode-tabs {
    justify-content: flex-start;
  }

  .hero-character-head {
    align-items: flex-start;
  }

  .hero-avatar-image {
    width: 72px;
    height: 72px;
  }

  .team-roster-spotlight {
    padding: 12px;
  }

  .team-roster-group + .team-roster-group {
    padding-top: 12px;
  }

  .team-roster-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .team-roster-avatar {
    width: 58px;
    height: 58px;
  }

  .app-tabs {
    width: 100%;
  }

  .qq-group-link {
    width: 100%;
  }

  .brand-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
  }

  .brand h1 {
    font-size: 24px;
  }

  .app-tab {
    flex: 1 1 0;
    min-width: 0;
  }

  .character-choice-grid,
  .mode-choice-grid {
    grid-template-columns: 1fr;
  }

  .mode-choice-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: stretch;
  }

  .character-choice-grid {
    min-height: 300px;
  }

  .role-pool-section.is-expanded {
    inset: 8px;
    padding: 12px;
  }

  .role-pool-section.is-expanded .character-choice-grid {
    grid-template-columns: repeat(auto-fill, minmax(136px, 1fr));
  }
}

body {
  background:
    linear-gradient(180deg, rgba(48, 194, 155, 0.05), transparent 260px),
    var(--bg);
}

.app-shell {
  max-width: 1720px;
}

.topbar {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #111820;
}

.panel,
.hero-panel,
.search-panel,
.app-tabs,
.result-card,
.card-item,
.evidence-item,
.team-result,
.advice-block,
.choice-section,
.choice-card,
.choice-action,
.bulk-action-button,
.tab,
.ghost-button,
input,
select,
textarea,
.lookup-popover,
.deep-thinking-panel,
.trace-step,
.trace-data pre,
.answer-table-wrap {
  box-shadow: none;
}

.panel,
.hero-panel,
.search-panel,
.app-tabs,
.result-card,
.card-item,
.evidence-item,
.team-result,
.advice-block,
.choice-section,
.choice-card,
.stat-chip,
.progression-item,
.threshold-list span,
.answer-table-wrap,
.deep-thinking-panel,
.trace-step {
  background: var(--surface);
}

.hero-panel {
  background:
    linear-gradient(135deg, rgba(48, 194, 155, 0.12), rgba(111, 160, 255, 0.07) 48%, rgba(226, 173, 84, 0.08)),
    var(--surface);
}

input,
select,
textarea,
.bulk-action-button,
.choice-action,
.ghost-button,
.tab {
  background: var(--surface-soft);
}

input::placeholder,
textarea::placeholder {
  color: #697688;
}

input:focus,
select:focus,
textarea:focus {
  background: #121a23;
  box-shadow: 0 0 0 3px rgba(48, 194, 155, 0.16);
}

.status,
.count-pill {
  border-color: rgba(48, 194, 155, 0.32);
  color: var(--accent-strong);
  background: rgba(48, 194, 155, 0.12);
}

.app-tab.is-active,
.primary-button,
.tab.is-active,
.choice-action.is-owned,
.result-type,
.trace-index {
  color: #07110e;
  background: var(--accent);
}

.primary-button {
  border-color: var(--accent);
}

.result-type.type-card { background: var(--blue); color: #081120; }
.result-type.type-memory { background: var(--amber); color: #171006; }
.result-type.type-companion { background: var(--rose); color: #1c0810; }
.result-type.type-mechanic { background: #b096ff; color: #100a1d; }
.result-type.type-tag { background: #93a4b7; color: #0b1118; }

.eyebrow,
.lookup-inline,
.trace-data summary {
  color: var(--accent-strong);
}

.tag,
.threshold-list span,
.citation-ref {
  border-color: var(--line);
  color: #c7d1dd;
  background: #10161e;
}

.tag.lookup-ref,
.choice-card.is-selected,
.choice-card.is-owned,
.result-card:hover,
.result-card.is-active,
.bulk-action-button:hover:not(:disabled),
.choice-card:hover,
.trace-toggle:hover,
.trace-toggle:focus-visible,
.lookup-inline:hover,
.lookup-inline:focus-visible,
.deep-thinking-panel.is-expanded,
.trace-running {
  border-color: rgba(48, 194, 155, 0.45);
  background: rgba(48, 194, 155, 0.1);
}

.choice-card.is-banned,
.trace-error {
  border-color: rgba(237, 127, 155, 0.5);
  background: rgba(237, 127, 155, 0.1);
}

.trace-streaming {
  border-color: rgba(111, 160, 255, 0.5);
  background: rgba(111, 160, 255, 0.1);
}

.choice-card::before {
  background: #0d131a;
}

.choice-card.is-selected::before {
  box-shadow: inset 0 0 0 3px #0d131a;
}

.mini-meta,
.muted,
label span,
.info-list dt,
.trace-head span,
.trace-meta,
.evidence-points {
  color: var(--muted);
}

.lookup-popover,
.lookup-popover p,
.progression-item p,
.entry,
.trace-main p,
.trace-data pre,
.answer-summary,
.evidence-summary-table p {
  color: #c4ceda;
}

.entry,
.progression-item,
.answer-table th,
.answer-table td {
  border-color: var(--line);
}

.answer-table th {
  color: #cbd5df;
  background: #111820;
}

.advisor-result-panel {
  max-height: var(--advisor-panel-height);
  overflow: hidden;
}

.advisor-result-body,
.advisor-output,
.advisor-output .advice-block,
.answer-view,
.answer-section,
.answer-title,
.answer-heading {
  min-width: 0;
}

.advisor-output {
  overflow: auto;
  padding-right: 2px;
  overscroll-behavior: contain;
}

.advisor-output .advice-block {
  overflow: visible;
}

.answer-title,
.answer-heading,
.stream-head,
.trace-head {
  flex-wrap: wrap;
}

.answer-title .mini-meta,
.answer-heading .result-type,
.stream-head .mini-meta {
  max-width: 100%;
  overflow-wrap: anywhere;
}

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

.answer-table th {
  width: 104px;
}

.answer-list,
.member-role-list {
  min-width: 0;
}

.answer-list li,
.member-role-list li,
.citation-row,
.stream-output,
.markdown-body,
.trace-main,
.trace-data,
.evidence-item,
.card-item,
.choice-card,
.result-card {
  max-width: 100%;
}

.stream-output {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #0d131a;
}

.deep-thinking-panel {
  background: #111820;
}

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(114, 224, 189, 0.54) rgba(16, 22, 30, 0.42);
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-track {
  border-radius: 8px;
  background: rgba(16, 22, 30, 0.42);
}

*::-webkit-scrollbar-thumb {
  min-height: 40px;
  border: 2px solid rgba(16, 22, 30, 0.42);
  border-radius: 8px;
  background: rgba(114, 224, 189, 0.46);
  background-clip: padding-box;
}

*::-webkit-scrollbar-thumb:hover {
  background: rgba(114, 224, 189, 0.68);
  background-clip: padding-box;
}

*::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
}

*::-webkit-scrollbar-corner {
  background: transparent;
}

@media (max-width: 940px) {
  .topbar {
    padding: 14px;
  }

  .advisor-result-panel {
    max-height: none;
    overflow: visible;
  }

  .advisor-output {
    max-height: none;
    overflow: visible;
  }
}

@media (max-width: 560px) {
  .answer-table,
  .answer-table tbody,
  .answer-table tr,
  .answer-table th,
  .answer-table td {
    display: block;
    width: 100%;
  }

  .answer-table th {
    border-bottom: 0;
    padding-bottom: 4px;
  }

  .answer-table td {
    padding-top: 4px;
  }

  .answer-table tr:not(:last-child) td {
    border-bottom: 1px solid var(--line);
  }
}

.panel,
.hero-panel,
.search-panel,
.result-card,
.card-item,
.evidence-item,
.team-result,
.advice-block,
.choice-section,
.choice-card,
.progression-item,
.answer-table-wrap,
.deep-thinking-panel,
.trace-step {
  --shine-opacity: 0;
  --shine-x: 50%;
  --shine-y: 50%;
  --shine-background-x: 50%;
  --shine-background-y: 50%;
  --shine-from-center: 0;
  --shine-accent: var(--accent-strong);
  --shine-layer-opacity: 0.18;
  --shine-glare-opacity: 0.15;
  --shine-space: 5%;
  --shine-angle: 133deg;
  --shine-imgsize: 20%;
  --shine-foil: none;
  --shine-sunpillar-1: hsl(2deg, 100%, 73%);
  --shine-sunpillar-2: hsl(53deg, 100%, 69%);
  --shine-sunpillar-3: hsl(93deg, 100%, 69%);
  --shine-sunpillar-4: hsl(176deg, 100%, 76%);
  --shine-sunpillar-5: hsl(228deg, 100%, 74%);
  --shine-sunpillar-6: hsl(283deg, 100%, 73%);
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

.panel::after,
.hero-panel::after,
.search-panel::after,
.result-card::after,
.card-item::after,
.evidence-item::after,
.team-result::after,
.advice-block::after,
.choice-section::after,
.choice-card::after,
.progression-item::after,
.answer-table-wrap::after,
.deep-thinking-panel::after,
.trace-step::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
  pointer-events: none;
  opacity: calc(var(--shine-opacity) * var(--shine-layer-opacity));
  background-image:
    var(--shine-foil),
    repeating-linear-gradient(
      0deg,
      var(--shine-sunpillar-1) calc(var(--shine-space) * 1),
      var(--shine-sunpillar-2) calc(var(--shine-space) * 2),
      var(--shine-sunpillar-3) calc(var(--shine-space) * 3),
      var(--shine-sunpillar-4) calc(var(--shine-space) * 4),
      var(--shine-sunpillar-5) calc(var(--shine-space) * 5),
      var(--shine-sunpillar-6) calc(var(--shine-space) * 6),
      var(--shine-sunpillar-1) calc(var(--shine-space) * 7)
    ),
    repeating-linear-gradient(
      var(--shine-angle),
      #0e152e 0%,
      hsl(180deg 10% 60%) 3.8%,
      hsl(180deg 29% 66%) 4.5%,
      hsl(180deg 10% 60%) 5.2%,
      #0e152e 10%,
      #0e152e 12%
    ),
    radial-gradient(
      farthest-corner circle at var(--shine-x) var(--shine-y),
      rgba(255, 255, 255, 0.34) 0%,
      rgba(255, 255, 255, 0.14) 16%,
      rgba(0, 0, 0, 0.08) 52%,
      rgba(0, 0, 0, 0.28) 120%
    );
  background-position:
    center center,
    0% var(--shine-background-y),
    calc(var(--shine-background-x) + (var(--shine-background-y) * 0.2)) var(--shine-background-y),
    var(--shine-x) var(--shine-y);
  background-size:
    var(--shine-imgsize),
    200% 700%,
    300% 100%,
    200% 100%;
  background-blend-mode: color-burn, hue, hard-light, screen;
  filter: brightness(calc((var(--shine-from-center) * 0.06) + 0.7)) contrast(1.55) saturate(1.24);
  mix-blend-mode: color-dodge;
  transition:
    opacity 0.28s ease,
    background-position 0.36s ease,
    filter 0.28s ease;
}

  .panel::before,
  .hero-panel::before,
  .search-panel::before,
.result-card::before,
.card-item::before,
.evidence-item::before,
.team-result::before,
.advice-block::before,
.choice-section::before,
.progression-item::before,
.answer-table-wrap::before,
.deep-thinking-panel::before,
.trace-step::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
  pointer-events: none;
  opacity: calc(var(--shine-opacity) * var(--shine-glare-opacity));
  background-image: radial-gradient(
    farthest-corner circle at var(--shine-x) var(--shine-y),
    hsl(0deg, 0%, 75%) 5%,
    hsl(200deg, 5%, 35%) 60%,
    hsl(320deg, 40%, 10%) 150%
  );
  background-position: center center;
  background-size: 170% 170%;
  filter: brightness(1.5) contrast(1.4) saturate(1);
  mix-blend-mode: multiply;
  transition:
    opacity 0.28s ease,
    background-position 0.36s ease;
}

.panel > *,
.hero-panel > *,
.search-panel > *,
.result-card > *,
.card-item > *,
.evidence-item > *,
.team-result > *,
.advice-block > *,
.choice-section > *,
.choice-card > *,
.progression-item > *,
.answer-table-wrap > *,
.deep-thinking-panel > *,
.trace-step > * {
  position: relative;
  z-index: 2;
}

.choice-card::before {
  z-index: 3;
}

.choice-card::after {
  z-index: 1;
}

.result-card,
.card-item,
.evidence-item,
.team-result,
.advice-block,
.choice-card,
.progression-item,
.answer-table-wrap,
.deep-thinking-panel,
.trace-step {
  --shine-layer-opacity: 0.32;
  --shine-glare-opacity: 0.26;
}

.result-card:hover,
.card-item:hover,
.evidence-item:hover,
.choice-card:hover,
.progression-item:hover,
.trace-step:hover {
  border-color: color-mix(in srgb, var(--shine-accent) 54%, var(--line));
}

.choice-card.is-banned {
  --shine-accent: var(--rose);
}

.advisor-card .choice-card.is-selected,
.advisor-card .choice-card.is-owned,
.advisor-card .choice-card.is-banned,
.result-pane .result-card:hover,
.result-pane .result-card.is-active {
  background: var(--surface);
}

.advisor-card .choice-section,
.advisor-card .choice-card,
.advisor-card .choice-card:hover,
.advisor-card .choice-card.is-selected,
.advisor-card .choice-card.is-owned,
.advisor-card .choice-card.is-banned,
.result-pane,
.result-pane .result-card,
.result-pane .result-card:hover,
.result-pane .result-card.is-active {
  background: var(--surface) !important;
}

.result-type.type-card,
.trace-streaming,
.hero-panel {
  --shine-accent: var(--blue);
}

.result-type.type-memory {
  --shine-accent: var(--amber);
}

@media (hover: none) {
  .panel,
  .hero-panel,
  .search-panel,
  .result-card,
  .card-item,
  .evidence-item,
  .team-result,
  .advice-block,
  .choice-section,
  .choice-card,
  .progression-item,
  .answer-table-wrap,
  .deep-thinking-panel,
  .trace-step {
    --shine-opacity: 0;
  }

  .panel,
  .hero-panel,
  .search-panel,
  .choice-section {
    --shine-opacity: 0;
  }

.panel::before,
.hero-panel::before,
.search-panel::before,
  .result-card::before,
  .card-item::before,
  .evidence-item::before,
  .team-result::before,
  .advice-block::before,
  .choice-section::before,
  .progression-item::before,
  .answer-table-wrap::before,
  .deep-thinking-panel::before,
  .trace-step::before {
    opacity: 0.05;
  }
}

@media (prefers-reduced-motion: reduce) {
  .panel,
  .hero-panel,
  .search-panel,
  .result-card,
  .card-item,
  .evidence-item,
  .team-result,
  .advice-block,
  .choice-section,
  .choice-card,
  .progression-item,
  .answer-table-wrap,
  .deep-thinking-panel,
  .trace-step {
    --shine-opacity: 0 !important;
  }

  .panel::before,
  .panel::after,
  .hero-panel::before,
  .hero-panel::after,
  .search-panel::before,
  .search-panel::after,
  .result-card::before,
  .result-card::after,
  .card-item::before,
  .card-item::after,
  .evidence-item::before,
  .evidence-item::after,
  .team-result::before,
  .team-result::after,
  .advice-block::before,
  .advice-block::after,
  .choice-section::before,
  .choice-section::after,
  .choice-card::after,
  .progression-item::before,
  .progression-item::after,
  .answer-table-wrap::before,
  .answer-table-wrap::after,
  .deep-thinking-panel::before,
  .deep-thinking-panel::after,
  .trace-step::before,
  .trace-step::after {
    transition: none !important;
  }
}
