:root {
  --ink: #171916;
  --ink-soft: #454a43;
  --paper: #f5f2e9;
  --paper-deep: #ebe5d7;
  --panel: rgba(255, 253, 247, 0.92);
  --panel-strong: #fffdf8;
  --line: rgba(44, 48, 42, 0.13);
  --line-strong: rgba(44, 48, 42, 0.24);
  --jade: #315f53;
  --jade-strong: #24493f;
  --gold: #ae8849;
  --gold-soft: #d7bd85;
  --violet: #62548c;
  --danger: #9e4d44;
  --shadow: 0 18px 60px rgba(31, 35, 29, 0.10);
  --shadow-soft: 0 8px 24px rgba(31, 35, 29, 0.08);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 11px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 10% 0%, rgba(174, 136, 73, 0.11), transparent 32rem),
    radial-gradient(circle at 90% 10%, rgba(49, 95, 83, 0.10), transparent 30rem),
    var(--paper);
  color: var(--ink);
  font-family: "Noto Serif TC", "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", serif;
}

body {
  min-height: 100dvh;
}

button,
input,
select {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.app-shell {
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.topbar {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(18px, 4vw, 52px);
  background: rgba(250, 248, 241, 0.88);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 30;
}

.brand-block,
.account-strip {
  display: flex;
  align-items: center;
}

.brand-block {
  gap: 12px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(145deg, var(--jade), var(--jade-strong));
  color: #fff;
  font-size: 21px;
  box-shadow: var(--shadow-soft);
}

.brand-title {
  font-weight: 800;
  letter-spacing: 0.18em;
  font-size: 18px;
}

.test-badge {
  display: inline-flex;
  margin-left: 6px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(158, 77, 68, 0.12);
  color: var(--danger);
  font-family: "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  font-size: 9px;
  letter-spacing: 0.08em;
  vertical-align: middle;
}

.brand-subtitle {
  color: #777c73;
  font-size: 11px;
  letter-spacing: 0.08em;
  margin-top: 2px;
}

.account-strip {
  gap: 10px;
}

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 35%, #f3dfbd 0 24%, transparent 25%),
    radial-gradient(circle at 50% 118%, #53685f 0 55%, transparent 56%),
    #d8ded8;
  border: 1px solid rgba(36, 73, 63, 0.16);
}

.account-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.account-label {
  font-size: 10px;
  color: #8a8d86;
  letter-spacing: 0.08em;
}

#player-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

.text-button,
.link-button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--jade);
  cursor: pointer;
}

.text-button {
  padding: 8px 10px;
  border-radius: 9px;
}

.text-button:hover {
  background: rgba(49, 95, 83, 0.08);
}

.main-shell {
  min-height: 0;
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
}

.sidebar {
  border-right: 1px solid var(--line);
  padding: 26px 16px 24px;
  background: rgba(239, 235, 224, 0.72);
  min-height: 0;
  overflow-y: auto;
}

.sidebar-caption {
  padding: 0 12px 10px;
  color: #878b83;
  font-size: 11px;
  letter-spacing: 0.18em;
}

.main-nav {
  display: grid;
  gap: 7px;
}

.nav-item {
  width: 100%;
  min-height: 48px;
  border: 1px solid transparent;
  border-radius: 13px;
  background: transparent;
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  cursor: pointer;
  text-align: left;
  transition: 140ms ease;
}

.nav-item:hover:not(:disabled),
.nav-item.active {
  color: var(--jade-strong);
  background: rgba(255, 253, 247, 0.78);
  border-color: rgba(49, 95, 83, 0.12);
  box-shadow: 0 6px 20px rgba(49, 95, 83, 0.07);
}

.nav-item:disabled {
  cursor: default;
  opacity: 0.38;
}

.nav-primary:not(:disabled) {
  background: linear-gradient(135deg, var(--jade), var(--jade-strong));
  color: #fff;
  box-shadow: 0 10px 28px rgba(36, 73, 63, 0.18);
}

.nav-primary:hover:not(:disabled) {
  color: #fff;
  border-color: transparent;
  transform: translateY(-1px);
}

.nav-icon {
  width: 29px;
  height: 29px;
  flex: 0 0 29px;
  display: grid;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 9px;
  font-size: 12px;
  opacity: 0.75;
}

.sidebar-note {
  margin: 24px 10px 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: #7c8179;
  font-size: 12px;
  line-height: 1.75;
}

.workspace {
  min-width: 0;
  min-height: 0;
  overflow: auto;
}

.content-view {
  width: min(1180px, calc(100% - 52px));
  min-height: 100%;
  margin: 0 auto;
  padding: 38px 0 54px;
}

.site-footer {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 10px clamp(18px, 4vw, 52px);
  border-top: 1px solid var(--line);
  color: #898d86;
  font-size: 11px;
  background: rgba(250, 248, 241, 0.82);
}

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

.section-heading {
  margin-bottom: 22px;
}

.section-heading h1,
.section-heading h2,
.section-heading h3 {
  margin: 3px 0 0;
  line-height: 1.25;
}

.section-heading h1 {
  font-size: clamp(28px, 4vw, 44px);
}

.section-heading h2 {
  font-size: clamp(23px, 3vw, 32px);
}

.section-kicker,
.eyebrow {
  display: block;
  color: var(--gold);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.muted {
  color: #7b8078;
}

.small {
  font-size: 12px;
}

.hidden {
  display: none !important;
}

.auth-layout {
  min-height: calc(100dvh - 180px);
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 430px);
  gap: clamp(40px, 7vw, 96px);
  align-items: center;
}

.auth-copy {
  max-width: 620px;
}

.auth-copy h1 {
  margin: 12px 0 18px;
  font-size: clamp(38px, 6vw, 72px);
  line-height: 1.08;
  letter-spacing: -0.03em;
  font-weight: 750;
}

.auth-copy p {
  max-width: 560px;
  color: #676c65;
  font-size: 16px;
  line-height: 1.9;
}

.auth-card {
  padding: 30px;
  min-width: 0;
  width: 100%;
}

label {
  display: block;
  margin: 14px 0 7px;
  color: #5c615a;
  font-size: 12px;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  outline: none;
  transition: 120ms ease;
}

input:focus,
select:focus {
  border-color: rgba(49, 95, 83, 0.55);
  box-shadow: 0 0 0 3px rgba(49, 95, 83, 0.09);
}

.action {
  min-height: 44px;
  border: 0;
  border-radius: 11px;
  padding: 10px 16px;
  cursor: pointer;
  font-weight: 800;
  transition: 140ms ease;
}

.action:hover {
  transform: translateY(-1px);
}

.action:disabled {
  cursor: default;
  opacity: 0.48;
  transform: none;
  box-shadow: none;
}

.action-primary {
  width: 100%;
  margin-top: 22px;
  color: #fff;
  background: linear-gradient(135deg, var(--jade), var(--jade-strong));
  box-shadow: 0 10px 24px rgba(36, 73, 63, 0.18);
}

.action-secondary {
  color: var(--jade-strong);
  background: rgba(49, 95, 83, 0.09);
  border: 1px solid rgba(49, 95, 83, 0.12);
}

.action-gold {
  color: #fff;
  background: linear-gradient(135deg, #b8914c, #8c6b35);
}

.link-button {
  width: 100%;
  padding: 12px;
  margin-top: 6px;
  font-size: 12px;
}

.page-header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-end;
  margin-bottom: 24px;
}

.page-header p {
  max-width: 680px;
  margin: 7px 0 0;
  color: #72766f;
  line-height: 1.7;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.75fr);
  gap: 18px;
}

.hero-card {
  min-height: 260px;
  padding: clamp(24px, 4vw, 38px);
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 90% 10%, rgba(215, 189, 133, 0.22), transparent 18rem),
    linear-gradient(145deg, rgba(255, 253, 247, 0.97), rgba(244, 239, 226, 0.95));
}

.hero-card::after {
  content: "道";
  position: absolute;
  right: 24px;
  bottom: -42px;
  font-size: 190px;
  color: rgba(49, 95, 83, 0.045);
  line-height: 1;
  pointer-events: none;
}

.hero-rank {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 10px 0 18px;
}

.rank-name {
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 800;
  letter-spacing: 0.04em;
}

.cultivation-stage {
  margin-bottom: 12px;
  color: var(--jade-strong);
  font-size: clamp(17px, 2.5vw, 22px);
  font-weight: 750;
  letter-spacing: 0.025em;
  line-height: 1.55;
}

.route-pill,
.status-pill,
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.route-pill {
  color: var(--jade-strong);
  background: rgba(49, 95, 83, 0.09);
}

.status-pill {
  color: #7f5d21;
  background: rgba(174, 136, 73, 0.13);
}

.progress-block {
  max-width: 660px;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
  color: #747971;
  font-size: 12px;
}

.progress-track {
  width: 100%;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(49, 95, 83, 0.09);
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--jade), #6f9588);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.hero-actions .action {
  min-width: 128px;
}

.stats-panel {
  padding: 22px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.stat-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.58);
}

.stat-label {
  color: #868a83;
  font-size: 10px;
  letter-spacing: 0.08em;
}

.stat-value {
  margin-top: 5px;
  font-size: 20px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.quick-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.quick-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 253, 247, 0.68);
  cursor: pointer;
  transition: 140ms ease;
  text-align: left;
}

.quick-card:hover {
  transform: translateY(-2px);
  background: var(--panel-strong);
  box-shadow: var(--shadow-soft);
}

.quick-title {
  display: block;
  font-weight: 800;
}

.quick-desc {
  display: block;
  color: #7b8078;
  font-size: 11px;
  line-height: 1.55;
  margin-top: 5px;
}

.test-loop-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(250px, 0.75fr);
  gap: 18px;
}

.cultivation-panel {
  grid-row: span 2;
  padding: clamp(22px, 3vw, 32px);
}

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

.cultivation-heading .section-heading p,
.weekly-panel .section-heading p,
.resonance-panel .section-heading p {
  margin: 6px 0 0;
  color: #7b8078;
  font-size: 12px;
  line-height: 1.65;
}

.wallet-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(70px, 1fr));
  gap: 8px;
  min-width: min(100%, 310px);
}

.wallet-strip > div {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.55);
}

.wallet-strip span,
.wallet-strip b {
  display: block;
}

.wallet-strip span {
  color: #8a8e86;
  font-size: 9px;
  letter-spacing: 0.08em;
}

.wallet-strip b {
  margin-top: 4px;
  font-size: 15px;
}

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

.activity-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.52);
}

.activity-card.complete {
  border-color: rgba(49, 95, 83, 0.22);
  background: rgba(49, 95, 83, 0.055);
}

.activity-head,
.activity-foot,
.resonance-meta,
.weekly-tier {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.activity-order {
  color: var(--gold);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.activity-card h4 {
  margin: 3px 0 0;
  font-size: 14px;
}

.activity-card p {
  min-height: 38px;
  margin: 8px 0;
  color: #777c74;
  font-size: 11px;
  line-height: 1.55;
}

.activity-state {
  flex: 0 0 auto;
  color: #777c74;
  font-size: 10px;
  font-weight: 800;
}

.progress-track.compact {
  height: 7px;
}

.activity-foot {
  margin-top: 9px;
  color: #82867f;
  font-size: 9px;
}

.mini-action {
  appearance: none;
  border: 1px solid rgba(49, 95, 83, 0.2);
  border-radius: 999px;
  padding: 6px 10px;
  background: var(--jade);
  color: #fff;
  cursor: pointer;
  font-size: 10px;
  font-weight: 800;
}

.mini-action:disabled {
  cursor: default;
  opacity: 0.5;
}

.weekly-panel,
 .resonance-panel,
 .milestone-panel {
  padding: 20px;
}

.milestone-panel {
  grid-column: 1 / -1;
}

.milestone-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.milestone-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.5);
}

.milestone-card.unlocked {
  border-color: rgba(174, 136, 73, 0.28);
  background: rgba(174, 136, 73, 0.055);
}

.milestone-card b,
.milestone-card small {
  display: block;
}

.milestone-card b {
  margin-top: 3px;
  font-size: 13px;
}

.milestone-card small {
  margin-top: 4px;
  color: #858980;
  font-size: 9px;
  line-height: 1.4;
}

.weekly-score {
  margin: 12px 0 8px;
  color: #777c74;
  font-size: 12px;
}

.weekly-score b {
  color: var(--ink);
  font-size: 22px;
}

.weekly-tiers {
  display: grid;
  gap: 7px;
}

.weekly-tier {
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.5);
}

.weekly-tier.unlocked {
  border-color: rgba(174, 136, 73, 0.24);
}

.weekly-tier b,
.weekly-tier span {
  display: block;
}

.weekly-tier span {
  margin-top: 2px;
  color: #858980;
  font-size: 9px;
}

.resonance-meta {
  margin: 14px 0 7px;
  color: #777c74;
  font-size: 11px;
}

.surge-live {
  color: #8b5b13;
  font-weight: 800;
}

.resonance-track .progress-fill {
  background: linear-gradient(90deg, var(--violet), var(--gold));
}

.settings-panel,
.inventory-panel,
.breakthrough-panel,
.techniques-panel,
.crafting-panel {
  padding: clamp(22px, 4vw, 34px);
}

.settings-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  width: 100%;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 106px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.5);
}

.settings-row > div {
  min-width: 0;
}

.settings-row .muted {
  overflow-wrap: anywhere;
}

.rename-settings-slot {
  grid-column: 1;
}

.danger-button {
  color: #fff;
  background: var(--danger);
}

.rename-settings-slot {
  display: block;
}

.rename-settings-slot[hidden] {
  display: none;
}

.rename-card {
  padding: 18px;
  border: 1px solid rgba(49, 95, 83, 0.18);
  border-radius: 14px;
  background: rgba(245, 242, 233, 0.72);
}

.rename-card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.rename-card-heading h3 {
  margin: 0;
}

.rename-price {
  color: var(--jade-strong);
  font-weight: 800;
  white-space: nowrap;
}

.rename-meta {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.rename-meta-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.rename-meta-label {
  color: #777c74;
  font-size: 12px;
}

.rename-notice,
.rename-payment-instructions,
.rename-preview-card {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 11px;
  background: rgba(49, 95, 83, 0.08);
  line-height: 1.7;
}

.rename-notice.warning {
  color: #744b16;
  background: rgba(174, 136, 73, 0.13);
}

.rename-notice.success,
.rename-notice.approved {
  color: var(--jade-strong);
  background: rgba(49, 95, 83, 0.10);
}

.rename-payment-instructions strong,
.rename-payment-instructions p {
  display: block;
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.rename-payment-instructions p {
  margin-top: 5px;
  color: #646961;
}

.rename-payment-summary {
  margin-top: 12px;
}

.rename-payment-qr {
  display: grid;
  justify-items: center;
  gap: 8px;
  margin: 14px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.58);
}

.rename-payment-qr img {
  display: block;
  width: min(100%, 320px);
  height: auto;
  border-radius: 8px;
}

.rename-payment-qr figcaption,
.rename-payment-method-title {
  color: #646961;
  font-size: 12px;
}

.rename-payment-method-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 6px 0 4px;
}

.rename-payment-method-tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 9px;
  border: 1px solid rgba(49, 95, 83, 0.22);
  border-radius: 999px;
  background: rgba(49, 95, 83, 0.08);
  color: var(--jade-strong);
  font-size: 12px;
  font-weight: 700;
}

.rename-request-form,
.rename-payment-form {
  display: grid;
  gap: 10px;
}

.rename-request-form label,
.rename-payment-form label {
  margin-bottom: 0;
}

.rename-payment-form textarea {
  width: 100%;
  min-height: 82px;
  padding: 10px 12px;
  resize: vertical;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  font: inherit;
  outline: none;
}

.rename-payment-form textarea:focus {
  border-color: rgba(49, 95, 83, 0.55);
  box-shadow: 0 0 0 3px rgba(49, 95, 83, 0.09);
}

.rename-notes {
  margin: 2px 0 4px;
  padding-left: 20px;
  color: #666b63;
  font-size: 12px;
  line-height: 1.7;
}

.rename-preview:empty {
  display: none;
}

.rename-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 4px;
}

.rename-submit {
  width: auto;
  margin-top: 0;
}

.rename-loading {
  padding: 16px;
  color: #777c74;
  text-align: center;
}

.inventory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
}

.item-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.60);
}

.item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.item-name {
  font-weight: 800;
}

.item-qty {
  color: var(--jade-strong);
  font-weight: 800;
}

.item-meta {
  margin-top: 8px;
  color: #82867f;
  font-size: 11px;
}

.item-desc {
  margin-top: 10px;
  color: #666b64;
  line-height: 1.65;
  font-size: 12px;
}

.empty-state {
  text-align: center;
  padding: 56px 20px;
  color: #82867f;
  border: 1px dashed var(--line-strong);
  border-radius: 16px;
}

.break-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.break-choice {
  position: relative;
  overflow: hidden;
  min-height: 210px;
  border: 1px solid var(--line);
  border-radius: 19px;
  padding: 24px;
  cursor: pointer;
  text-align: left;
  transition: 150ms ease;
}

.break-choice:hover:not(.disabled) {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.break-choice.normal {
  background:
    radial-gradient(circle at 90% 15%, rgba(255, 231, 178, 0.65), transparent 13rem),
    #fbf5e8;
}

.break-choice.heaven {
  background:
    radial-gradient(circle at 90% 15%, rgba(158, 142, 218, 0.30), transparent 13rem),
    #f2eff9;
}

.break-choice.disabled {
  cursor: default;
  opacity: 0.48;
  filter: grayscale(0.35);
}

.break-choice-tag {
  display: inline-flex;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.break-choice h3 {
  margin: 16px 0 8px;
  font-size: 25px;
}

.break-choice p {
  max-width: 440px;
  color: #6f746d;
  line-height: 1.65;
  margin: 0;
}

.requirement-card {
  display: grid;
  gap: 13px;
}

.requirement-row {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.requirement-row:last-child {
  border-bottom: 0;
}

.requirement-label {
  color: #8a8e87;
  font-size: 11px;
  font-weight: 800;
}

.requirement-value {
  line-height: 1.65;
}

.form-stack {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.tech-scroll {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 14px;
  align-items: stretch;
}

.tech-entry {
  height: 500px;
  min-width: 0;
  padding: 18px;
  border-radius: 15px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
  cursor: default;
  transition: 130ms ease;
}

.tech-entry:hover {
  background: #fffdf8;
  border-color: rgba(174, 136, 73, 0.28);
  box-shadow: var(--shadow-soft);
}

.tech-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  font-weight: 800;
}

.tech-level {
  flex: 0 0 auto;
  color: #84724f;
  font-size: 11px;
}

.tech-summary {
  min-height: 3.3em;
  margin: 0;
  color: #6f746d;
  line-height: 1.65;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.tech-training-progress {
  display: grid;
  gap: 6px;
}

.tech-training-progress-head,
.tech-card-training-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--ink-soft);
  font-size: 12px;
}

.tech-training-progress .progress-track {
  margin: 0;
}

.tech-skill-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.tech-skill-slot {
  min-height: 88px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fffdf8;
  display: grid;
  align-content: start;
  gap: 4px;
  color: var(--ink-soft);
  cursor: help;
}

.tech-skill-slot:hover,
.tech-skill-slot:focus-visible {
  border-color: rgba(49, 95, 83, 0.34);
  box-shadow: 0 0 0 2px rgba(49, 95, 83, 0.08);
  outline: none;
}

.tech-skill-slot.is-locked {
  background: #f5f7f8;
  color: #72808a;
}

.tech-skill-slot-label {
  font-size: 11px;
  font-weight: 700;
  color: #6b7f89;
}

.tech-skill-slot strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
}

.tech-skill-slot.is-locked strong {
  color: #66747d;
}

.tech-skill-state {
  margin-top: auto;
  font-size: 11px;
  font-weight: 700;
  color: #567d53;
}

.tech-skill-slot.is-locked .tech-skill-state {
  color: #8b7b6d;
}

.tech-card-training {
  min-height: 64px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(248, 251, 252, 0.76);
}

.tech-card-training-head span {
  color: #71838d;
}

.tech-card-revealed {
  min-height: 29px;
  margin-top: 7px;
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
}

.tech-card-revealed > span:not(.tech-no-revealed) {
  flex: 0 0 27px;
  width: 27px;
  height: 27px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  background: #edf6fa;
  color: #2f6d8b;
  font-weight: 700;
}

.tech-no-revealed {
  color: #7d8b92;
  font-size: 12px;
}

.tech-card-actions {
  min-height: 42px;
  margin-top: auto;
  display: flex;
  align-items: flex-end;
}

.tech-card-actions .action {
  width: 100%;
}

.tech-equipped-note {
  width: 100%;
  min-height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(49, 95, 83, 0.18);
  border-radius: 11px;
  background: rgba(237, 246, 250, 0.72);
  color: var(--jade-strong);
  font-weight: 800;
}

@media (max-width: 760px) {
  .tech-scroll {
    grid-template-columns: 1fr;
  }

  .tech-entry {
    height: 520px;
  }
}

@media (max-width: 520px) {
  .tech-entry {
    height: 540px;
    padding: 14px;
  }

  .tech-skill-slot {
    min-height: 92px;
    padding: 9px 10px;
  }
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(24, 28, 24, 0.45);
  backdrop-filter: blur(6px);
}

.modal {
  width: min(520px, 100%);
  max-height: min(78dvh, 720px);
  overflow-y: auto;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel-strong);
  box-shadow: 0 28px 90px rgba(18, 22, 18, 0.30);
}

.tech-select-list {
  display: grid;
  gap: 9px;
  margin-top: 16px;
}

.tech-choice {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #faf7ef;
  cursor: pointer;
}

.tech-choice:hover {
  border-color: rgba(49, 95, 83, 0.28);
  background: #fffdf8;
}

.close-btn {
  width: 100%;
  min-height: 42px;
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #f0ece2;
  cursor: pointer;
}

@media (max-width: 980px) {
  .main-shell {
    grid-template-columns: 210px minmax(0, 1fr);
  }

  .content-view {
    width: calc(100% - 32px);
    max-width: 980px;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .auth-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 30px;
  }

  .auth-copy {
    max-width: 680px;
  }

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

  .test-loop-grid {
    grid-template-columns: 1fr;
  }

  .cultivation-panel {
    grid-row: auto;
  }

  .milestone-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

}

@media (max-width: 760px) {
  html,
  body,
  .app-shell,
  .main-shell,
  .workspace {
    width: 100%;
    max-width: 100vw;
  }

  .topbar {
    min-height: 64px;
    padding: 10px 14px;
    width: 100%;
    max-width: 100vw;
  }

  .brand-subtitle,
  .account-label {
    display: none;
  }

  .brand-title {
    font-size: 15px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 12px;
  }

  .account-strip {
    gap: 6px;
  }

  .avatar {
    width: 32px;
    height: 32px;
  }

  .main-shell {
    display: block;
    overflow-x: clip;
  }

  .sidebar {
    position: sticky;
    top: 64px;
    z-index: 25;
    width: 100%;
    max-width: 100vw;
    min-width: 0;
    padding: 8px 10px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    overflow-x: auto;
    background: rgba(239, 235, 224, 0.94);
    backdrop-filter: blur(12px);
  }

  .sidebar-caption,
  .sidebar-note {
    display: none;
  }

  .main-nav {
    display: flex;
    gap: 7px;
    width: max-content;
    max-width: none;
  }

  .nav-item {
    width: auto;
    min-height: 40px;
    padding: 7px 10px;
    border-radius: 11px;
    white-space: nowrap;
  }

  .nav-icon {
    width: 25px;
    height: 25px;
    flex-basis: 25px;
    border-radius: 8px;
  }

  .workspace {
    overflow: visible;
    min-width: 0;
  }

  .content-view {
    width: calc(100% - 24px);
    max-width: 720px;
    padding: 24px 0 38px;
  }

  .auth-layout {
    min-height: auto;
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .auth-copy h1 {
    font-size: clamp(34px, 12vw, 52px);
  }

  .auth-copy p {
    font-size: 14px;
  }

  .page-header {
    display: block;
  }

  .dashboard-grid,
  .break-choice-grid {
    grid-template-columns: 1fr;
  }

  .quick-grid {
    grid-template-columns: 1fr 1fr;
  }

  .cultivation-heading {
    display: block;
  }

  .wallet-strip {
    margin-top: 14px;
  }

  .activity-grid {
    grid-template-columns: 1fr;
  }

  .milestone-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

  .site-footer {
    display: none;
  }

  input,
  select {
    font-size: 16px;
  }

  .workspace {
    padding-bottom: env(safe-area-inset-bottom);
  }
}

@media (max-width: 520px) {
  .brand-block {
    gap: 8px;
  }

  .account-copy {
    max-width: 88px;
  }

  #player-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .text-button {
    padding-inline: 6px;
  }

  .content-view {
    width: calc(100% - 18px);
    max-width: 520px;
  }

  .auth-card,
  .settings-panel,
  .inventory-panel,
  .breakthrough-panel,
  .techniques-panel,
  .crafting-panel {
    padding: 19px;
    border-radius: 18px;
  }

  .quick-grid {
    grid-template-columns: 1fr;
  }

  .wallet-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    min-width: 0;
  }

  .milestone-list {
    grid-template-columns: 1fr;
  }

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

  .hero-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .hero-actions .action {
    width: 100%;
  }

  .requirement-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .tech-header {
    display: block;
  }

  .tech-level {
    display: inline-block;
    margin-top: 6px;
  }
}

/* 霽藍仙境：首頁與聊天室共用的藍白視覺語言。 */
:root {
  --ink: #173654;
  --ink-soft: #42617d;
  --paper: #eaf4ff;
  --paper-deep: #dceaf9;
  --panel: rgba(255, 255, 255, .94);
  --panel-strong: #ffffff;
  --line: rgba(38, 91, 151, .16);
  --line-strong: rgba(38, 91, 151, .30);
  --jade: #2e70b5;
  --jade-strong: #174c88;
  --gold: #9b7737;
  --gold-soft: #d9bf84;
  --violet: #5674a9;
  --danger: #aa4b59;
  --shadow: 0 20px 52px rgba(34, 80, 141, .13);
  --shadow-soft: 0 8px 24px rgba(38, 83, 143, .10);
}
html, body {
  font-size: 17px;
  line-height: 1.65;
  background: radial-gradient(ellipse at 85% 0%, rgba(158, 202, 244, .48), transparent 36rem),
              radial-gradient(ellipse at 10% 25%, rgba(255,255,255,.82), transparent 35rem),
              linear-gradient(160deg, #f7fbff, #e5f1ff 58%, #dceafa);
}
button, input, select, textarea { font-size: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible, .break-choice:focus-visible {
  outline: 3px solid #4b91d0;
  outline-offset: 3px;
}
.topbar { background: rgba(249, 253, 255, .94); }
.brand-mark, .nav-primary:not(:disabled), .action-primary {
  background: linear-gradient(140deg, #5ca5df, #2566a9 55%, #184983);
  color: #fff;
  box-shadow: 0 10px 24px rgba(31, 91, 161, .22);
}
.sidebar { background: linear-gradient(180deg, rgba(232, 245, 255,.96), rgba(211, 230, 250,.88)); }
.nav-item { min-height: 54px; font-size: 17px; font-weight: 700; }
.nav-item:hover:not(:disabled), .nav-item.active {
  background: rgba(255,255,255,.94); color: var(--jade-strong);
  border-color: rgba(45, 112, 181, .27);
  box-shadow: 0 7px 22px rgba(38,83,143,.11);
}
.nav-icon { font-size: 15px; width: 32px; height: 32px; flex-basis: 32px; }
.brand-title { font-size: 22px; }
#player-name { font-size: 17px; }
.brand-subtitle, .account-label, .sidebar-caption, .sidebar-note, .site-footer,
.section-kicker, .eyebrow, .small, .muted, .item-meta, .item-desc,
.requirement-label, .break-choice-tag, .quick-desc, .stat-label, .wallet-label {
  font-size: max(14px, 0.84rem);
}
.sidebar-caption { color: #486989; }
.sidebar-note, .muted, .page-header p, .auth-copy p, .item-desc, .item-meta,
.break-choice p { color: #476684; }
.action { min-height: 50px; padding: 12px 18px; font-size: 17px; border-radius: 13px; }
.action-secondary { background: #e5f1ff; border-color: #bed8ee; }
.action-gold { background: linear-gradient(130deg, #d5b576, #9b7737); }
.link-button, .text-button { font-size: 15px; font-weight: 700; }
.panel, .item-card, .settings-row { border-color: var(--line); }
input, select, textarea { min-height: 48px; font-size: 17px; background: #fff; }
label { font-size: 16px; color: #385a7d; }
input:focus, select:focus, textarea:focus { border-color: #5294cb; box-shadow: 0 0 0 3px rgba(55,127,193,.13); }
.break-choice { border-color: #c7daef; }
.break-choice.normal { background: radial-gradient(circle at 90% 10%, rgba(230,243,255,.9), transparent 13rem), #fafdff; }
.break-choice.heaven { background: radial-gradient(circle at 90% 10%, rgba(237,211,155,.28), transparent 13rem), #edf5ff; }
.break-choice h3 { color: #245c96; }
.break-choice.disabled { opacity: .72; filter: none; cursor: not-allowed; }
.requirement-label { color: #527394; }
.site-footer { background: rgba(246,251,255,.9); color: #597694; }
@media (max-width: 760px) {
  .sidebar { background: rgba(230, 243, 255, .96); }
  .nav-item { min-height: 44px; padding: 9px 13px; font-size: 16px; }
  .brand-title { font-size: 18px; }
  .auth-copy p { font-size: 16px; }
  .content-view { padding-top: 26px; }
}

/* 主要面板的說明文字不能沿用舊版 9–12px；修行卡片一併回到雲白系。 */
.hero-card {
  background: radial-gradient(circle at 92% 6%, rgba(180, 215, 244, .55), transparent 19rem),
              linear-gradient(145deg, #ffffff, #e7f3ff);
}
.hero-card::after { color: rgba(45, 112, 181, .07); }
.quick-card, .tech-entry, .tech-choice {
  background: rgba(250, 253, 255, .92);
  border-color: var(--line);
}
.quick-card:hover, .tech-entry:hover, .tech-choice:hover {
  background: #ffffff;
  border-color: rgba(48, 118, 186, .35);
}
.close-btn { background: #e7f2fe; color: var(--ink); font-size: 16px; }
.route-pill { background: #deeeff; color: var(--jade-strong); }
.status-pill { background: #f5edd8; }
.progress-meta, .weekly-score, .resonance-meta, .tech-summary, .tech-detail,
.requirement-value, .activity-card p, .activity-state,
.activity-foot, .cultivation-heading .section-heading p,
.weekly-panel .section-heading p, .resonance-panel .section-heading p,
.quick-desc, .item-desc, .item-meta { color: var(--ink-soft); }
.progress-track { background: rgba(63, 126, 186, .13); }
.progress-fill { background: linear-gradient(90deg, #4b9fd7, #276cae); }
.route-pill, .status-pill, .badge, .progress-meta, .quick-desc,
.cultivation-heading .section-heading p, .weekly-panel .section-heading p,
.resonance-panel .section-heading p, .activity-order, .activity-state,
.activity-foot, .weekly-score, .weekly-tier span, .wallet-strip span,
.milestone-card small, .resonance-meta, .item-meta, .item-desc,
.tech-level, .tech-detail { font-size: 14px; line-height: 1.55; }
.activity-card h4, .item-name, .tech-header, .milestone-card b { font-size: 16px; }
.activity-card p, .quick-desc, .tech-summary { font-size: 15px; line-height: 1.7; }
.activity-grid { gap: 12px; }
.activity-card { padding: 16px; }
.activity-foot, .activity-head, .weekly-tier, .resonance-meta { flex-wrap: wrap; }
.stat-label { font-size: 14px; color: #527394; }
.stat-value { font-size: 23px; }
.wallet-strip span { color: #527394; }
.mini-action { min-height: 38px; padding: 8px 13px; font-size: 14px; }
.milestone-card small, .weekly-tier span { color: #587694; }
.slot-btn, .tech-choice { font-size: 16px; }

/* 公開測試告知與註冊前的明示同意。 */
.legal-inline-notice { padding:12px; background:#fff8e9; border:1px solid #e7d4ab; border-radius:4px; color:#75552f; font-size:14px; line-height:1.7; }
.legal-inline-notice a,.legal-consent a,.legal-footer-links a { color:#23648a; text-underline-offset:2px; }
.legal-consent { display:flex; align-items:flex-start; flex-wrap:wrap; gap:5px; font-size:14px; line-height:1.65; margin:12px 0; color:#38596b; }
.legal-consent input { width:18px; height:18px; margin:3px 5px 0 0; flex-shrink:0; }
.legal-footer-links { display:flex; align-items:center; justify-content:center; flex-wrap:wrap; gap:8px 15px; }
.settings-row .action { display:inline-flex; text-align:center; align-items:center; justify-content:center; text-decoration:none; }
.announcement-list { display:grid; gap:14px; }
.announcement-card { padding:20px 22px; }
.announcement-card-head { display:flex; align-items:baseline; justify-content:space-between; gap:14px; flex-wrap:wrap; margin-bottom:10px; }
.announcement-card h2 { margin:0; font-size:20px; }
.announcement-card time { color:#6a8295; font-size:13px; }
.announcement-card p { margin:0; white-space:pre-wrap; overflow-wrap:anywhere; line-height:1.8; }
.announcement-loading,.announcement-empty,.announcement-error { padding:20px 22px; }
.announcement-error { color:#8a3f3f; }
.legal-consent { display:block; padding:12px; margin:12px 0; border:1px solid #cee0e8; background:#f7fbfd; border-radius:4px; }
.legal-consent p { margin:0 0 9px; }
.legal-check { display:flex; align-items:flex-start; gap:8px; margin:10px 0; font-size:14px; line-height:1.6; }
.legal-check input { width:18px; height:18px; flex:0 0 18px; margin:3px 0 0; }

