﻿:root {
  --ink: #19253f;
  --red: #9e302c;
  --line: #dac6a5;
  --cream: #fffaf0;
  --night: #101b32;
  --gold: #cba66b;
  --paper: #f8f0e2;
}

@font-face { font-family: "Ranli Serif SC"; src: url('fonts/noto-serif-sc-subset.woff2') format('woff2'); font-style: normal; font-weight: 100 900; font-display: swap; }

body {
  color: var(--ink);
  background:
    radial-gradient(ellipse at 7% 72%, #c5b89b26, transparent 31%),
    radial-gradient(ellipse at 90% 90%, #c59c7226, transparent 29%),
    linear-gradient(180deg, #f4e9d5, #fffaf2 420px, #f7f0e4);
}

body::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 242px;
  pointer-events: none;
  background:
    radial-gradient(circle at 78% 10%, #d9846d56 0 27px, transparent 28px),
    radial-gradient(circle at 76% 10%, #d5b07426 0 110px, transparent 112px),
    radial-gradient(circle at 58% 43%, #bf986a32 0 1px, transparent 2px),
    radial-gradient(circle at 28% 20%, #d5b07458 0 1px, transparent 2px),
    linear-gradient(145deg, #172743, #101b32 62%, #26304b);
  box-shadow: inset 0 -36px 46px -38px #c0956e;
}

.shell { position: relative; z-index: 1; width: min(100%, 1220px); padding-top: 14px; }
.bazi-masthead { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 74px; margin: 0 14px 14px; }
.bazi-brand { display: flex; align-items: center; gap: 14px; color: #f3dfb9; font-size: clamp(25px, 3vw, 37px); font-weight: 700; letter-spacing: .14em; white-space: nowrap; text-shadow: 0 2px 12px #050a18aa; }
.bazi-brand-mark { display: grid; place-items: center; width: 44px; height: 44px; border: 2px solid #e7bc81; border-radius: 12px; color: #f8e6c2; background: #9e302c; box-shadow: inset 0 0 0 3px #9e302c, inset 0 0 0 4px #f2cd9a, 0 5px 12px #050a1844; font-size: 26px; letter-spacing: 0; }
.account-strip { margin: 0; }
.account-strip a { color: #f2dfc3; font-size: 14px; font-weight: 500; }
.account-strip a:hover, .account-strip a:focus-visible { color: #fff; }

.top-tabs { margin: 0 14px 30px; gap: 12px; }
.top-tabs button { height: 54px; border: 1px solid #c89c69; background: linear-gradient(#fff9ed, #f8eddb); color: #1c2b48; box-shadow: 0 3px 0 #b89a6b4d, inset 0 1px #fff; font-weight: 600; }
.top-tabs button:hover, .top-tabs button:focus-visible { border-color: #9e302c; transform: translateY(-1px); }
.top-tabs button.active { border-color: #ddac76; background: linear-gradient(125deg, #aa342e, #8b2429); box-shadow: 0 8px 17px #6e1c294d, inset 0 1px #edb089; color: #fff7e9; }

.hero-card { border: 2px solid #d4a46d; border-radius: 23px; background: radial-gradient(circle at 76% 0%, #ca6d4e, transparent 36%), linear-gradient(120deg, #76222a, #aa3b31 52%, #8d292b); box-shadow: 0 13px 26px #52212b2c, inset 0 0 0 4px #fff3de20; }
.hero-card::after { right: -52px; bottom: -74px; width: 410px; height: 160px; border-color: #f3ce9f42; box-shadow: 0 -20px 0 -16px #f3ce9f55, 0 -42px 0 -34px #f3ce9f33; }
.hero-copy h2 { color: #fff1ce; font-weight: 700; letter-spacing: .07em; }
.hero-actions button { border: 1px solid #f4c792; background: #fff2d8; color: #902d28; }

.pillar-cards { gap: 14px; margin-top: 24px; }
.pillar-card { border-color: #b89263; background: linear-gradient(180deg, #1d2c4a 0 50px, #fff9ed 51px); box-shadow: inset 0 0 0 3px #f9edda, 0 8px 16px #503c2624; }
.pillar-card h3 { color: #fff0ce; font-weight: 700; letter-spacing: .1em; }
.pillar-big + .pillar-line { border-color: #ddcbb2; }
.pillar-tag { color: #493b31; background: #f1dfc6; }

.data-card, .panel { border-color: #cdb48c; background: #fffaf1ed; box-shadow: 0 7px 18px #6d48221b, inset 0 1px #fff; }
.section-heading h2 { color: #1b2946; font-weight: 700; letter-spacing: .025em; }
.section-heading h2::before { background: linear-gradient(#d46747, #8b252b); }
.section-heading span, .muted { color: #776454; }
th { background: #eee1cb; color: #685742; }
td { border-color: #e4d3b9; }
td:first-child span, .pillar-tag { border: 1px solid #e8d2ac; }
.column { border-color: #d8be8e; background: #fff4df; }
.column:nth-child(2) { background: #f4f5e8; }
.column:nth-child(3) { background: #fff0e5; }
.column:nth-child(4) { background: #edf5f4; }
.strength-card, .relation-group, .transit-card, .info-item, .book-result, .detail-report-panel { border-color: #dec6a3; }
.relation-group { background: #fbefd9; }
.luck-period { border-color: #d7bc90; background: linear-gradient(#fff8e9, #f9eedb); }
.luck-period:hover { border-color: #a24535; box-shadow: 0 4px 14px #74352224; }
.shensha-dialog { border-color: #c89c69; background: #fff8e9; }
.shensha-dialog::backdrop { background: #101b32b5; }
input, select { border-color: #cdb48c; background: #fffdf7; }
input:focus, select:focus { outline-color: #b65043; }
button[type="submit"], .detail-report-panel > button { background: #9e302c; }
.secondary { border-color: #bd9a6c; color: #85332e; background: #fff8e9; }
.membership-plans button { border-color: #d2ac7c; background: #fcf0dc; }
.membership-plans button:hover { border-color: #a43a30; background: #fae6cf; }
.book-option { border-left-color: #792d2d; background: linear-gradient(105deg, #c7a577, #fff1cf 18%, #d9b889); }
.book-option.active { outline-color: #9e302c; }

.records-panel.panel { max-width: 1020px; }
.records-panel > .muted { max-width: 700px; line-height: 1.7; }
#records { display: grid; gap: 18px; }
.record { position: relative; align-items: stretch; gap: 16px; padding: 18px; border: 1px solid #cfae80; border-radius: 18px; background: linear-gradient(120deg, #fffaf0, #fbefd9); box-shadow: 0 8px 22px #6c482124; }
.record-open { display: grid; grid-template-columns: 118px minmax(0,1fr) auto; align-items: center; gap: 26px; min-width: 0; min-height: 160px; padding: 8px 16px 8px 8px; border: 0; background: transparent; text-align: left; }
.record-open:hover .record-enter, .record-open:focus-visible .record-enter { color: #fff; background: #9e302c; }
.record-open:focus-visible, .record-remove:focus-visible { outline: 3px solid #aa423b; outline-offset: 3px; }
.record-book { position: relative; display: grid; place-items: center; width: 103px; height: 138px; border: 2px solid #b9805b; border-left: 10px solid #a5543f; border-radius: 5px 12px 12px 5px; background: radial-gradient(circle at 75% 15%, #ffe5ae, transparent 35%), linear-gradient(135deg, #c9765a, #f8d5ab 48%, #d59168); box-shadow: 5px 8px 0 #9c6c4740, 7px 12px 16px #442c2440, inset 0 0 0 6px #f7d8ac; color: #79302c; font-size: 50px; font-weight: 700; }
.record-book::after { content: ""; position: absolute; inset: 17px 18px; border: 1px solid #9e5b44; border-radius: 50%; }
.record-details { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.record-name { color: #1d2c4a; font-size: clamp(26px, 3vw, 40px); font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; }
.record-date { color: #263653; font-size: clamp(17px, 2vw, 25px); font-weight: 600; line-height: 1.4; }
.record-enter { display: inline-flex; align-items: center; justify-content: center; min-width: 126px; min-height: 49px; padding: 8px 15px; border: 1px solid #bb8355; border-radius: 28px; background: #fff4df; color: #7f302d; font-size: 19px; font-weight: 700; white-space: nowrap; transition: background .15s, color .15s; }
.record-enter::before { content: "›"; display: grid; place-items: center; width: 28px; height: 28px; margin-right: 8px; border-radius: 50%; background: #b74735; color: white; font-size: 28px; line-height: 1; }
.record-remove { align-self: end; flex: none; padding: 6px 4px; color: #8b4236; text-decoration: underline; text-underline-offset: 3px; }
.record-remove:hover { color: #5b161e; }

@media (max-width: 760px) {
  body::before { height: 170px; }
  .shell { padding-top: 8px; }
  .bazi-masthead { min-height: 61px; margin: 0 3px 10px; }
  .bazi-brand { gap: 8px; font-size: 24px; letter-spacing: .04em; }
  .bazi-brand-mark { width: 33px; height: 33px; border-radius: 9px; font-size: 19px; }
  .account-strip a { font-size: 11px; }
  .top-tabs { margin-bottom: 18px; gap: 5px; }
  .top-tabs button { height: 43px; font-size: 13px; }
  .pillar-cards { gap: 7px; }
  .pillar-card { background: linear-gradient(180deg, #1d2c4a 0 43px, #fff9ed 44px); }
  .record-open { grid-template-columns: 78px minmax(0,1fr); gap: 14px; min-height: 122px; }
  .record-book { width: 72px; height: 98px; font-size: 37px; }
  .record-book::after { inset: 12px; }
  .record-enter { grid-column: 2; justify-self: start; min-height: 38px; font-size: 14px; }
  .record-date { font-size: 16px; }
}

@media (max-width: 560px) {
  .bazi-brand { font-size: 19px; }
  .account-strip { max-width: 42%; text-align: right; }
  .top-tabs { gap: 3px; }
  .top-tabs button { padding: 0 2px; font-size: 11px; }
  .pillar-card { background: linear-gradient(180deg, #1d2c4a 0 37px, #fff9ed 38px); }
  .record { padding: 10px; flex-direction: column; gap: 5px; }
  .record-open { width: 100%; grid-template-columns: 70px minmax(0,1fr); gap: 12px; }
  .record-book { width: 65px; height: 89px; font-size: 33px; }
  .record-name { font-size: 24px; }
  .record-date { font-size: 14px; }
  .record-enter { min-width: 105px; padding: 5px 10px; }
  .record-remove { margin-right: 4px; }
}

@media print {
  body, body::before { background: #fff; }
  .bazi-masthead { display: none; }
  .hero-card { print-color-adjust: exact; }
}

body { position: relative; min-height: 100vh; background-color: #f8f0e2; background-image: radial-gradient(circle at 18% 35%, #fffaf0 0, transparent 42%), radial-gradient(circle at 85% 70%, #e9dac355 0, transparent 40%), linear-gradient(#f5ebdd, #fbf5ea 380px, #f8efdf); }
body::before { height: 254px; background: #101b32 url('assets/mystic-header.png') center 39% / cover no-repeat; box-shadow: inset 0 -35px 28px -31px #e7d3b8; }
body::after { content: ""; position: absolute; z-index: 0; left: 0; right: 0; bottom: 0; height: 240px; pointer-events: none; background: url('assets/mystic-footer.png') center bottom / cover no-repeat; }
.shell { width: min(100%, 1100px); padding: 16px 22px 245px; }
.bazi-masthead { min-height: 85px; margin: 0 5px 9px; }
.bazi-brand { font-family: "Ranli Serif SC", "Songti SC", "SimSun", serif; font-size: clamp(34px, 4vw, 50px); font-weight: 700; letter-spacing: .09em; color: #f7dbac; }
.bazi-brand-mark { display: none; }
.account-strip a { display: inline-block; padding: 7px 12px; border: 1px solid #d4af785c; border-radius: 18px; background: #101b3269; color: #f5dbad; }
.top-tabs { position: relative; z-index: 1; margin: 0 4px 18px; gap: 11px; }
.top-tabs button { height: 51px; border: 1.5px solid #d2a777; border-radius: 999px; background: linear-gradient(180deg, #fffaf0, #efdfc9); font-family: "Ranli Serif SC", "Songti SC", "SimSun", serif; font-size: clamp(14px, 1.7vw, 20px); color: #19243e; box-shadow: 0 4px 10px #1d23313d, inset 0 1px #fff; }
.top-tabs button.active { border-color: #f4d3a1; background: linear-gradient(155deg, #9b292d, #6e1b27); color: #ffe3b5; box-shadow: 0 0 0 2px #8c633b, 0 7px 15px #2a14284a; }
.hero-card { min-height: 150px; padding: 16px 28px; gap: 26px; border: 2px solid #e5bd85; border-radius: 24px; background: radial-gradient(ellipse at 70% 115%, #c0645040, transparent 46%), linear-gradient(108deg, #77242a, #9a3432 58%, #76252d); box-shadow: 0 0 0 3px #9b632d80, inset 0 0 0 4px #f7deb91c, 0 13px 24px #3d202235; }
.hero-card::after { width: min(50%, 500px); height: 130px; right: 4px; bottom: 0; transform: none; border: 0; border-radius: 0; box-shadow: none; background: url('assets/hero-clouds.svg') right bottom / contain no-repeat; opacity: .65; }
.hero-book { position: relative; z-index: 1; display: grid; place-items: center; flex: 0 0 103px; width: 103px; height: 126px; border: 2px solid #efca93; border-left: 9px solid #8f372f; border-radius: 5px 11px 11px 5px; background: url('assets/mystic-footer.png') center bottom / auto 88px no-repeat, linear-gradient(155deg, #f4c796, #fff1cc 48%, #d58f67); box-shadow: 5px 6px 0 #3a142d55, inset 0 0 0 5px #fbe1b6; }
.hero-book::before { content: ""; position: absolute; inset: 13px 12px; border: 1px solid #b76e43; border-radius: 48%; }
.hero-book span { position: relative; color: #8c2e2b; font: 700 43px "Ranli Serif SC", "Songti SC", serif; text-shadow: 0 1px #ffe6c5; }
.hero-copy { padding-left: 27px; border-left: 1px solid #f0c48d9c; }
.hero-copy h2 { font-family: "Ranli Serif SC", "Songti SC", "SimSun", serif; font-size: clamp(25px, 3vw, 35px); color: #ffdfaa; margin-bottom: 8px; text-shadow: 0 2px 5px #4d192a66; }
.hero-copy p { font-family: "Ranli Serif SC", "Songti SC", "SimSun", serif; font-size: clamp(14px, 1.7vw, 20px); line-height: 1.42; }
.hero-actions { align-self: center; }
.hero-actions button { border: 1px solid #efc58f; color: #8d292c; box-shadow: 0 3px 8px #3d1d243b; }
.pillar-cards { gap: 12px; margin: 24px 0 12px; }
.pillar-card { min-height: 510px; padding-bottom: 48px; border: 1.5px solid #c9975a; border-radius: 18px; background: linear-gradient(180deg, #192641 0 49px, #fff9ec 50px); box-shadow: inset 0 0 0 3px #f7e8d0, 0 8px 18px #5d402522; }
.pillar-card h3 { position: relative; height: 49px; border-radius: 14px 14px 4px 4px; border-bottom: 2px solid #cf9e5d; color: #ffe5bd; font-family: "Ranli Serif SC", "Songti SC", serif; font-size: 24px; }
.pillar-card h3::before, .pillar-card h3::after { content: "❧"; position: absolute; top: 12px; color: #ba945d; font: 17px serif; }
.pillar-card h3::before { left: 9px; }.pillar-card h3::after { right: 9px; transform: scaleX(-1); }
.pillar-card::after { left: 8px; right: 8px; bottom: 2px; height: 45px; border-radius: 0; opacity: .9; background: url('assets/element-earth.svg') center bottom / 75px 42px no-repeat; }
.pillar-card.wood::after { background-image: url('assets/element-wood.svg'); }
.pillar-card.fire::after { background-image: url('assets/element-fire.svg'); }
.pillar-card.metal::after { background-image: url('assets/element-metal.svg'); }
.pillar-card.water::after { background-image: url('assets/element-water.svg'); }
.pillar-big { margin: 11px 13px 4px; }
.pillar-line { gap: 7px; margin: 8px 11px; padding-bottom: 5px; border-bottom: 1px solid #e6d5bf; font-size: clamp(13px, 1.45vw, 17px); }
.pillar-line:last-of-type { border-bottom: 0; }
.pillar-big + .pillar-line { padding-top: 11px; }
.pillar-tag { min-width: 43px; text-align: center; padding: 1px 6px; background: #f1dfc8; border-radius: 999px; }
.pillar-values { overflow-wrap: anywhere; }
.element-icon { display: block; width: 42px; height: 42px; background: center / contain no-repeat; }
.element-icon.wood { background-image: url('assets/element-wood.svg'); }.element-icon.fire { background-image: url('assets/element-fire.svg'); }.element-icon.earth { background-image: url('assets/element-earth.svg'); }.element-icon.metal { background-image: url('assets/element-metal.svg'); }.element-icon.water { background-image: url('assets/element-water.svg'); }
.pillar-compare { margin: 0 0 16px; padding: 8px 16px; background: #fff8ebc9; }
.pillar-compare summary { cursor: pointer; color: #6e4c34; font-size: 14px; }
.data-card, .panel { border: 1px solid #d3b58c; border-radius: 18px; background: #fffbf3ee; box-shadow: 0 6px 15px #5e442019; }
.section-heading h2 { font-family: "Ranli Serif SC", "Songti SC", "SimSun", serif; font-weight: 700; }
.four-columns { gap: 11px; }
.column, .column:nth-child(n) { min-height: 134px; padding: 10px 12px; background-color: #fff3df; background-image: linear-gradient(90deg, #fff8e9 0%, #fff8e9e0 48%, #fff8e922 100%), url('assets/season-spring.png'); background-position: center, right top; background-size: cover, auto 145px; background-repeat: no-repeat; }
.column:nth-child(2) { background-image: linear-gradient(90deg, #f5f8e9 0%, #f5f8e9e0 48%, #f5f8e922 100%), url('assets/season-summer.png'); }
.column:nth-child(3) { background-image: linear-gradient(90deg, #fff0e8 0%, #fff0e8e0 48%, #fff0e822 100%), url('assets/season-autumn.png'); }
.column:nth-child(4) { background-image: linear-gradient(90deg, #eaf5f5 0%, #eaf5f5e0 48%, #eaf5f522 100%), url('assets/season-winter.png'); }
.column strong { font-family: "Ranli Serif SC", "Songti SC", serif; font-weight: 700; }
.strength-card { position: relative; overflow: hidden; min-height: 80px; background: #fffaf0 url('assets/wuxing-state.svg') center bottom / 100% auto no-repeat; }
.strength-card .section-heading, .strength-card .chips { position: relative; z-index: 1; }
.chip { display: inline-flex; align-items: center; gap: 7px; border: 1px solid #d8c39f; box-shadow: 0 2px 7px #5f441018; font-weight: 700; }
.chip::before { content: ""; width: 26px; height: 26px; flex: none; background: center / contain no-repeat; }
.chip.wood::before { background-image: url('assets/element-wood.svg'); }.chip.fire::before { background-image: url('assets/element-fire.svg'); }.chip.earth::before { background-image: url('assets/element-earth.svg'); }.chip.metal::before { background-image: url('assets/element-metal.svg'); }.chip.water::before { background-image: url('assets/element-water.svg'); }
.record-book { background-image: linear-gradient(135deg, #c9765acc, #f8d5abdd 48%, #d59168dd), url('assets/season-spring.png'); background-position: center, 63% top; background-size: cover, auto 100%; }

@media (max-width: 760px) {
  body::before { height: 205px; background-position: 65% center; }
  .shell { padding: 12px 10px 180px; }
  .bazi-masthead { min-height: 68px; }
  .bazi-brand { font-size: 27px; }
  .top-tabs { margin-bottom: 18px; gap: 5px; }
  .top-tabs button { height: 44px; font-size: 13px; }
  .hero-book { flex-basis: 78px; width: 78px; height: 96px; border-left-width: 7px; }
  .hero-book span { font-size: 30px; }
  .hero-card { min-height: 125px; padding: 12px; gap: 13px; }
  .hero-card::after { height: 102px; }
  .hero-copy { padding-left: 13px; }
  .pillar-card { min-height: 430px; }
  .pillar-line { margin: 7px 6px; font-size: 12px; }
  .pillar-tag { min-width: 0; padding: 1px 4px; }
  .element-icon { width: 28px; height: 28px; }
  .column, .column:nth-child(n) { background-size: cover, auto 125px; }
  .chip::before { width: 20px; height: 20px; }
  body::after { height: 175px; }
}
@media (max-width: 560px) {
  body::before { height: 158px; background-position: 64% center; }
  .shell { padding: 9px 7px 135px; }
  .bazi-masthead { min-height: 57px; margin: 0 3px 8px; }
  .bazi-brand { font-size: 20px; }
  .account-strip a { max-width: 150px; padding: 4px 7px; font-size: 10px; }
  .top-tabs button { height: 38px; padding: 0 1px; font-size: 10px; }
  .hero-card { gap: 8px; padding: 9px; }
  .hero-card::after { width: 43%; height: 75px; opacity: .4; }
  .hero-copy { padding-left: 8px; }
  .hero-book { flex-basis: 52px; width: 52px; height: 68px; border-width: 2px 2px 2px 5px; }
  .hero-book::before { inset: 7px; }
  .hero-book span { font-size: 21px; }
  .hero-copy h2 { font-size: 19px; margin-bottom: 4px; }
  .hero-copy p { font-size: 10px; }
  .pillar-cards { gap: 4px; margin-top: 14px; }
  .pillar-card { min-height: 350px; padding-bottom: 28px; border-radius: 10px; background: linear-gradient(180deg, #192641 0 35px, #fff9ec 36px); }
  .pillar-card h3 { height: 35px; border-radius: 8px 8px 2px 2px; font-size: 14px; }
  .pillar-card h3::before, .pillar-card h3::after { top: 10px; font-size: 10px; }.pillar-card h3::before { left: 2px; }.pillar-card h3::after { right: 2px; }
  .pillar-big { margin: 5px 2px 3px; }
  .pillar-big strong { font-size: clamp(25px, 7vw, 36px); }
  .element-icon { width: 17px; height: 17px; }
  .pillar-line { display: flex; flex-wrap: wrap; gap: 2px; margin: 5px 3px; padding-bottom: 2px; font-size: 10px; line-height: 1.25; }
  .pillar-tag { margin: 0; font-size: 9px; }
  .pillar-values { flex: 1 1 100%; margin: 1px 0 0; }
  .pillar-card::after { height: 27px; background-size: 40px 25px; }
  .four-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .shensha-section { overflow: visible; }
  .column, .column:nth-child(n) { min-height: 120px; background-size: cover, auto 120px; }
  .strength-card { min-height: 0; }
  .chip { font-size: 12px; padding: 4px 7px; }
  .chip::before { width: 17px; height: 17px; }
  body::after { height: 130px; }
}
@media print { body, body::before { background: #fff; } body::after { display: none; } .shell { padding-bottom: 0; } }
