:root {
  --ink: #0c0d0c;
  --panel: #141713;
  --panel-soft: #1b1f1a;
  --gold: #d9ad55;
  --gold-light: #f3d993;
  --ivory: #f4eedf;
  --muted: #a9a799;
  --jade: #3e796a;
  --red: #8e2d24;
  --line: rgba(222, 181, 94, .24);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--ink); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ivory);
  background:
    radial-gradient(circle at 76% 26%, rgba(65, 97, 73, .22), transparent 30%),
    radial-gradient(circle at 15% 78%, rgba(111, 45, 32, .18), transparent 32%),
    linear-gradient(145deg, #111410, #090a09 70%);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", sans-serif;
  overflow-x: hidden;
}

button, input { font: inherit; }
button { color: inherit; }
.hidden { display: none !important; }
.grain {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .2;
  background-image:
    repeating-linear-gradient(18deg, transparent 0 5px, rgba(255,255,255,.018) 6px 7px),
    repeating-linear-gradient(102deg, transparent 0 11px, rgba(218,174,86,.022) 12px 13px);
}

.site-header {
  width: min(1440px, calc(100% - 64px));
  height: 92px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.brand { color: inherit; text-decoration: none; display: flex; align-items: center; gap: 14px; }
.brand-seal {
  width: 48px; height: 48px; display: grid; place-items: center;
  border: 1px solid var(--gold); color: var(--gold-light); background: #641f1a;
  box-shadow: inset 0 0 0 4px #240c0a, 0 8px 30px rgba(0,0,0,.3);
  font: 700 25px "STKaiti", "KaiTi", serif;
}
.brand strong { display: block; letter-spacing: .15em; font-size: 17px; }
.brand small { display: block; color: var(--muted); font-size: 11px; margin-top: 4px; letter-spacing: .12em; }
.header-right { display: flex; align-items: center; gap: 14px; }
.catalog-count { color: #8f9388; font-size: 12px; letter-spacing: .08em; }
.player-pill { border: 1px solid var(--line); background: #191b18; border-radius: 999px; padding: 9px 14px; font-size: 13px; }
.player-pill::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 8px; border-radius: 50%; background: #77b995; box-shadow: 0 0 12px #77b995; }
.text-button { border: 0; background: transparent; color: #b9b8ae; cursor: pointer; padding: 8px; font-size: 12px; }
.text-button:hover { color: var(--gold-light); }
.compliance-banner {
  width: min(1440px, calc(100% - 64px));
  margin: 14px auto 0;
  padding: 9px 14px;
  border: 1px solid rgba(217, 173, 85, .24);
  background: rgba(21, 24, 20, .78);
  color: #bcb9ac;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
}
.compliance-banner a {
  color: #d8c08a;
  text-decoration: none;
  white-space: nowrap;
}
.compliance-banner a:hover {
  color: var(--gold-light);
  text-decoration: underline;
}

main { width: min(1440px, calc(100% - 64px)); min-height: calc(100vh - 158px); margin: 0 auto; }
.login-view { min-height: 720px; display: grid; grid-template-columns: .92fr 1.08fr; align-items: center; gap: 8vw; }
.login-copy { max-width: 670px; padding: 60px 0 90px 5vw; position: relative; z-index: 2; }
.eyebrow { color: var(--gold); font-size: 12px; font-weight: 700; letter-spacing: .24em; margin: 0 0 24px; }
.eyebrow span { width: 32px; height: 1px; background: var(--gold); display: inline-block; vertical-align: middle; margin-right: 12px; }
h1 { margin: 0; font: 500 clamp(54px, 6vw, 94px)/1.12 "FZShuTi", "STKaiti", "KaiTi", serif; letter-spacing: .04em; }
h1 em { font-style: normal; color: var(--gold-light); text-shadow: 0 10px 38px rgba(214,170,77,.16); }
.lead { max-width: 560px; margin: 32px 0 42px; color: #bbb9ad; line-height: 1.95; font-size: 15px; }
.compliance-note {
  max-width: 560px;
  margin: -20px 0 34px;
  padding: 11px 14px;
  border: 1px solid rgba(217, 173, 85, .28);
  background: rgba(21, 24, 20, .78);
  color: #d7d4c7;
  font-size: 13px;
  line-height: 1.75;
}
.login-form label { display: block; font-size: 12px; color: #8f9288; letter-spacing: .12em; margin-bottom: 10px; }
.input-row { display: flex; width: min(570px, 100%); border-bottom: 1px solid #655532; padding-bottom: 10px; gap: 12px; }
.input-row input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ivory); font-size: 20px; padding: 13px 4px; }
.input-row input::placeholder { color: #555850; }
.input-row button, .selection-bar button {
  border: 1px solid #f1d58b; background: linear-gradient(135deg, #c79640, #795421);
  padding: 12px 22px; color: #17130b; font-weight: 800; cursor: pointer; letter-spacing: .06em;
  box-shadow: 0 12px 34px rgba(142,100,31,.2); transition: transform .18s, filter .18s;
}
.input-row button:hover, .selection-bar button:not(:disabled):hover { transform: translateY(-2px); filter: brightness(1.08); }
.input-row button span { margin-left: 12px; }
.form-error { min-height: 22px; color: #e58c7f; font-size: 13px; margin: 12px 0 0; }
.rule-notes { display: flex; gap: 24px; margin-top: 44px; color: #8f9289; font-size: 11px; }
.rule-notes span { display: flex; align-items: center; gap: 8px; }
.rule-notes b { color: var(--gold); font-size: 10px; border-bottom: 1px solid var(--gold); padding-bottom: 3px; }

.login-visual { position: relative; height: 680px; display: grid; place-items: center; perspective: 1100px; }
.halo { position: absolute; width: 620px; height: 620px; border-radius: 50%; border: 1px solid rgba(217,173,85,.15); box-shadow: inset 0 0 120px rgba(214,173,83,.06); }
.halo::before, .halo::after { content: ""; position: absolute; inset: 11%; border: 1px dashed rgba(217,173,85,.15); border-radius: 50%; }
.halo::after { inset: 29%; border-style: solid; }
.back-card, .draw-back-card {
  position: absolute; width: 260px; aspect-ratio: 2/3; border-radius: 15px;
  background:
    linear-gradient(45deg, transparent 47%, rgba(224,183,89,.18) 48% 52%, transparent 53%),
    linear-gradient(-45deg, transparent 47%, rgba(224,183,89,.15) 48% 52%, transparent 53%),
    radial-gradient(circle, #27352e, #111713 72%);
  background-size: 30px 30px, 30px 30px, auto;
  border: 7px solid #17120a; outline: 2px solid var(--gold);
  box-shadow: inset 0 0 0 5px #4d3a1e, inset 0 0 0 7px #d0a853, 0 35px 65px rgba(0,0,0,.55);
  display: grid; place-items: center;
}
.back-card::before, .draw-back-card::before { content: ""; position: absolute; inset: 30px; border: 1px solid rgba(234,197,113,.62); }
.back-card i, .draw-back-card i { width: 104px; height: 104px; display: grid; place-items: center; border-radius: 50%; border: 2px solid var(--gold); background: #70231d; color: #f3dd9d; font: 700 60px "STKaiti", serif; box-shadow: inset 0 0 0 9px #250b09; }
.back-card span { position: absolute; bottom: 47px; color: #c9aa65; font: 17px "STKaiti", serif; letter-spacing: .32em; }
.back-one { transform: translateX(-112px) rotateY(14deg) rotateZ(-8deg); }
.back-two { z-index: 2; transform: translateY(-20px); }
.back-three { transform: translateX(112px) rotateY(-14deg) rotateZ(8deg); }
.login-visual>p { position: absolute; bottom: 55px; color: #777b72; font: 14px "STKaiti", serif; letter-spacing: .35em; }

.draw-view { padding: 52px 0 70px; min-height: 760px; }
.draw-heading { text-align: center; }
.draw-heading .eyebrow { margin-bottom: 14px; }
.draw-heading h2 { margin: 0; font: 500 clamp(38px, 4vw, 58px) "STKaiti", "KaiTi", serif; letter-spacing: .09em; }
.draw-heading>p:last-child { color: var(--muted); font-size: 13px; margin-top: 13px; }
.undrawn-stage { display: flex; flex-direction: column; align-items: center; padding-top: 28px; }
.draw-deck { width: 560px; height: 440px; position: relative; perspective: 1000px; }
.ritual-ring { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); border-radius: 50%; border: 1px solid rgba(218,176,87,.16); }
.ring-one { width: 500px; height: 260px; }
.ring-two { width: 390px; height: 390px; border-style: dashed; animation: slow-spin 22s linear infinite; }
.draw-back-card { width: 190px; top: 55px; left: calc(50% - 95px); }
.draw-back-card i { width: 72px; height: 72px; font-size: 40px; }
.draw-back-card.left { transform: translateX(-130px) rotate(-11deg); }
.draw-back-card.center { z-index: 2; transform: translateY(-18px); }
.draw-back-card.right { transform: translateX(130px) rotate(11deg); }
.draw-button { border: 0; background: transparent; cursor: pointer; text-align: center; color: var(--ivory); padding: 0; }
.draw-button span { display: block; width: 180px; padding: 15px 22px; margin: auto; border: 1px solid var(--gold-light); background: linear-gradient(135deg, #b77b2e, #66441b); color: #130e07; font-weight: 900; letter-spacing: .16em; box-shadow: 0 14px 40px rgba(153,102,35,.24); }
.draw-button small { display: block; color: #74786f; margin-top: 12px; font-size: 11px; }
.draw-button:disabled { cursor: wait; opacity: .58; }

.cards-stage { max-width: 1180px; margin: 34px auto 0; }
.skill-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(18px, 3vw, 46px); align-items: start; }
.skill-card { position: relative; border: 0; padding: 0; background: transparent; color: inherit; text-align: center; cursor: pointer; transform: translateY(28px); opacity: 0; animation: card-arrive .7s cubic-bezier(.2,.75,.2,1) forwards; }
.skill-card:nth-child(2) { animation-delay: .16s; }
.skill-card:nth-child(3) { animation-delay: .32s; }
.skill-card img { display: block; width: 100%; border-radius: 14px; box-shadow: 0 25px 55px rgba(0,0,0,.5); transition: transform .28s, filter .28s, box-shadow .28s; }
.skill-card:hover img { transform: translateY(-8px); box-shadow: 0 32px 70px rgba(0,0,0,.64); }
.skill-card.selected img { transform: translateY(-14px); box-shadow: 0 0 0 3px var(--gold-light), 0 35px 85px rgba(202,156,64,.22); }
.skill-card.selected::after { content: "待选"; position: absolute; top: 15px; right: 15px; padding: 7px 11px; background: #9b3026; border: 1px solid #f0cf85; color: #fff4d8; font-size: 12px; font-weight: 800; letter-spacing: .12em; }
.skill-card.is-chosen img { box-shadow: 0 0 0 3px var(--gold-light), 0 35px 85px rgba(202,156,64,.28); }
.skill-card.is-dimmed { filter: grayscale(.8) brightness(.35); pointer-events: none; }
.selection-bar { display: flex; align-items: center; justify-content: space-between; max-width: 760px; margin: 38px auto 0; padding: 17px 18px 17px 24px; border: 1px solid var(--line); background: rgba(21,24,20,.92); box-shadow: 0 18px 50px rgba(0,0,0,.28); }
.selection-bar p { margin: 0; color: #aaa99e; font-size: 13px; }
.selection-bar button { min-width: 150px; }
.selection-bar button:disabled { cursor: not-allowed; filter: grayscale(1); opacity: .35; }

.chosen-stage { max-width: 970px; margin: 36px auto 0; display: grid; grid-template-columns: minmax(280px, 410px) 1fr; gap: clamp(32px, 6vw, 85px); align-items: center; }
.chosen-card { position: relative; }
.chosen-card img { width: 100%; display: block; border-radius: 15px; box-shadow: 0 0 0 3px var(--gold), 0 40px 95px rgba(0,0,0,.62); animation: chosen-rise .75s cubic-bezier(.2,.8,.2,1); }
.chosen-card::after { content: "已选定"; position: absolute; top: 18px; right: 18px; background: #8d2d24; color: #f8e5b8; border: 1px solid var(--gold); padding: 8px 12px; font-size: 12px; font-weight: 800; letter-spacing: .16em; }
.chosen-copy .chosen-seal { color: var(--gold); font-size: 12px; letter-spacing: .25em; }
.chosen-copy h3 { margin: 15px 0 25px; font: 500 clamp(38px, 4vw, 60px) "STKaiti", serif; color: var(--gold-light); }
.chosen-copy dl { margin: 0; }
.chosen-copy dt { color: #8c9087; font-size: 11px; letter-spacing: .18em; margin-top: 24px; }
.chosen-copy dd { margin: 8px 0 0; color: #d1cec0; font-size: 15px; line-height: 1.85; }
.chosen-copy .locked-note { margin-top: 34px; padding: 16px 18px; border-left: 2px solid var(--gold); background: rgba(213,171,83,.06); color: #a5a499; font-size: 12px; line-height: 1.7; }
.redraw-panel { margin-top: 34px; }
.redraw-panel .locked-note { margin-top: 0; }
.redraw-button {
  min-width: 170px;
  margin-top: 14px;
  padding: 12px 18px;
  border: 1px solid var(--gold-light);
  background: linear-gradient(135deg, #c79640, #795421);
  color: #17130b;
  cursor: pointer;
  font-weight: 800;
  letter-spacing: .08em;
}
.redraw-button:hover:not(:disabled) { transform: translateY(-2px); filter: brightness(1.08); }
.redraw-button:disabled {
  cursor: not-allowed;
  border-color: rgba(217, 173, 85, .24);
  background: #24231d;
  color: #7d7b70;
}
.centered { text-align: center; }

footer { width: min(1440px, calc(100% - 64px)); min-height: 66px; margin: 0 auto; padding: 12px 0; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 18px; color: #656960; font-size: 11px; }
footer a { color: #8f928a; text-decoration: none; }
footer a:hover { color: var(--gold); }
.footer-notice, .footer-links { display: flex; align-items: center; gap: 16px; }
.footer-notice { color: #8d9086; }
.footer-notice a { white-space: nowrap; }
.toast { position: fixed; z-index: 20; left: 50%; bottom: 28px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; background: #211c13; border: 1px solid var(--gold); color: #f2e5c4; padding: 12px 18px; font-size: 13px; transition: .25s; }
.toast.show { transform: translate(-50%,0); opacity: 1; }

@keyframes slow-spin { to { transform: translate(-50%,-50%) rotate(360deg); } }
@keyframes card-arrive { to { transform: translateY(0); opacity: 1; } }
@keyframes chosen-rise { from { transform: translateY(28px) scale(.96); opacity: 0; } }

@media (max-width: 980px) {
  .login-view { grid-template-columns: 1fr; min-height: auto; }
  .login-copy { padding: 80px 6vw 40px; max-width: 760px; }
  .login-visual { height: 580px; }
  .skill-cards { gap: 14px; }
  .chosen-stage { grid-template-columns: 340px 1fr; }
}

@media (max-width: 700px) {
  .site-header, .compliance-banner, main, footer { width: min(100% - 30px, 1440px); }
  .site-header { height: 74px; }
  .compliance-banner { flex-direction: column; gap: 4px; margin-top: 10px; }
  .brand-seal { width: 41px; height: 41px; }
  .brand strong { font-size: 15px; }
  .catalog-count { display: none; }
  .login-copy { padding: 60px 2px 25px; }
  h1 { font-size: 52px; }
  .lead { margin: 24px 0 32px; }
  .input-row { flex-direction: column; border: 0; }
  .input-row input { border-bottom: 1px solid #655532; }
  .input-row button { padding: 15px; }
  .rule-notes { display: grid; gap: 12px; margin-top: 30px; }
  .login-visual { height: 470px; transform: scale(.78); margin: -40px -60px; }
  .draw-view { padding-top: 38px; }
  .draw-deck { transform: scale(.75); margin: -45px 0; }
  .skill-cards { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; padding: 18px 9vw 30px; margin: 0 -15px; gap: 22px; }
  .skill-card { flex: 0 0 76vw; scroll-snap-align: center; }
  .selection-bar { position: sticky; bottom: 12px; z-index: 5; margin-top: 8px; padding: 12px; flex-direction: column; gap: 11px; text-align: center; }
  .selection-bar button { width: 100%; }
  .chosen-stage { grid-template-columns: 1fr; padding: 0 7vw; }
  .chosen-card { max-width: 390px; margin: auto; }
  .chosen-copy { text-align: center; }
  .chosen-copy dl, .chosen-copy .locked-note { text-align: left; }
  .redraw-button { width: 100%; }
  footer, .footer-notice, .footer-links { flex-direction: column; gap: 9px; align-items: flex-start; }
  footer { padding: 18px 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}
