@font-face { font-family: Iansui; src: url("assets/Iansui-Regular.ttf") format("truetype"); font-display: swap; }
:root { color-scheme: light; --paper: #f5f1e8; --ink: #333d35; --muted: #73796e; --line: #dad8cb; --green: #425a47; --red: #a34733; --serif: Iansui, "Songti SC", serif; }
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 32px; background: var(--paper); }
body { margin: 0; color: var(--ink); font: 14px/1.7 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif; background: radial-gradient(ellipse at 12% 10%, #fff9 0, transparent 50%), var(--paper); }
/* Locally rendered paper grain, with no external image request. */
body::before { content: ""; position: fixed; z-index: 20; inset: 0; pointer-events: none; opacity: .13; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.78' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Cpath fill='%23857862' filter='url(%23n)' opacity='.4' d='M0 0h180v180H0z'/%3E%3C/svg%3E"); }
button, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; color: inherit; border: 0; }
button:disabled { cursor: wait; opacity: .6; }
a { color: inherit; text-underline-offset: 4px; }
button:focus-visible, a:focus-visible, summary:focus-visible, textarea:focus-visible { outline: 2px solid var(--green); outline-offset: 4px; }
h1, h2, h3, p { margin: 0; }
.site-shell { max-width: 1184px; margin: auto; padding: 0 40px; }
.topbar { height: 88px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 10px; padding: 0; background: none; font: 26px var(--serif); letter-spacing: 2px; }
.brand-icon { display: block; flex-shrink: 0; object-fit: contain; border-radius: 22%; }
.topbar-actions { display: flex; align-items: center; gap: 20px; }
.quiet-button { display: inline-flex; align-items: center; gap: 6px; padding: 10px 0; min-height: 44px; color: #676f62; background: none; text-decoration: none; font-size: 13px; }
.quiet-button:hover { color: var(--red); }
.quiet-button span { min-width: 19px; padding: 0 4px; border: 1px solid var(--line); border-radius: 4px; text-align: center; font-size: 10px; }
.section-intro { display: flex; justify-content: space-between; align-items: end; gap: 24px; padding: 38px 0 25px; }
.eyebrow { margin-bottom: 10px; font-size: 11px; letter-spacing: 2px; color: var(--red); }
h1 { font: 38px/1.35 var(--serif); letter-spacing: -.7px; }
.intro-copy { margin-top: 12px; color: var(--muted); }
.tool-note { flex-shrink: 0; font-size: 11px; color: #7a8273; padding-bottom: 2px; }
.tool-note span { font-size: 8px; color: #718969; margin-right: 5px; }
.ritual-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; border: 1px solid #d2d3c4; border-radius: 12px; overflow: hidden; box-shadow: 0 7px 22px #686b4510; background: #fdfbf4b3; }
.ritual-stage { min-height: 370px; position: relative; overflow: hidden; background: radial-gradient(ellipse at 50% 52%, #fffaf1, transparent 72%), #eeeddf80; }
.stage-caption { position: absolute; top: 23px; left: 26px; right: 26px; display: flex; justify-content: space-between; color: #969987; font-size: 11px; letter-spacing: 1px; }
.stage-caption span:first-child { color: #717762; }
.cup-world { position: absolute; inset: 38px 12px 88px; touch-action: pan-y; cursor: pointer; user-select: none; -webkit-user-select: none; }
.cup-world canvas { display: block; width: 100%; height: 100%; }
.render-notice { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; padding: 20px; color: var(--muted); font-size: 12px; pointer-events: none; background: #f5f1e8d9; }
[hidden] { display: none !important; }
.ritual-status { position: absolute; bottom: 77px; width: 100%; text-align: center; color: #6b725f; font: 16px var(--serif); }
.hold-meter { position: absolute; bottom: 62px; left: 50%; width: 92px; height: 2px; transform: translateX(-50%); background: #dad9c8; opacity: 0; }
.hold-meter span { display: block; height: 100%; background: var(--green); transform: scaleX(0); transform-origin: left; }
.is-holding .hold-meter { opacity: 1; }
.face-legend { position: absolute; bottom: 22px; width: 100%; display: flex; gap: 26px; justify-content: center; color: #939583; font-size: 11px; }
.face-legend > span { display: flex; align-items: center; gap: 7px; }
.mini-cup, .study-cup { display: inline-block; border-radius: 55% 48% 48% 48% / 90% 85% 15% 20%; }
.mini-cup { width: 24px; height: 13px; }
.flat { background: repeating-linear-gradient(0deg, #b977501c 0 1px, transparent 1px 7px), #cf926f; box-shadow: inset 0 0 0 1px #a76b4955; }
.rounded { background: radial-gradient(ellipse at 35% 28%, #e9b997bb, transparent 45%), linear-gradient(145deg, #ae593f, #713222); box-shadow: inset 0 -3px 5px #59261530; }
.control-panel { padding: 27px 28px 20px; border-left: 1px solid var(--line); display: flex; flex-direction: column; justify-content: space-between; }
.question-card, .preference-row { display: flex; justify-content: space-between; gap: 16px; align-items: center; }
.question-card > div { min-width: 0; }
.section-label { font-size: 11px; color: #858575; margin-bottom: 5px; }
.question-value { font: 20px/1.5 var(--serif); white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.text-button { flex-shrink: 0; min-height: 44px; padding: 5px; background: none; color: var(--green); font-size: 12px; text-decoration: underline; text-underline-offset: 4px; }
.ritual-control { margin: 32px 0 24px; }
.control-kicker { font-size: 11px; color: #8b8a7a; margin-bottom: 11px; }
.hold-button { width: 100%; display: flex; align-items: center; justify-content: center; gap: 14px; min-height: 56px; border-radius: 7px; background: var(--green); color: #faf6eb; font: 19px var(--serif); touch-action: none; user-select: none; -webkit-user-select: none; transition: background .15s, transform .15s; }
.hold-button:hover { background: #344d3a; }
.hold-button.is-active { background: #697b57; transform: scale(.98); }
.hold-icon { width: 11px; height: 19px; border: 1px solid #e3e6d4; border-radius: 90% 10% 90% 10%; transform: rotate(-18deg); }
.hold-help { margin-top: 10px; text-align: center; font-size: 11px; color: #838777; }
.preference-row { border-top: 1px solid var(--line); padding: 17px 0 10px; }
.preference-row p:not(.section-label) { font-size: 12px; }
.pose-switch { display: flex; gap: 8px; align-items: center; background: none; min-height: 44px; padding: 0; font-size: 11px; }
.switch-track { width: 30px; height: 17px; border-radius: 20px; background: #bbbfae; padding: 3px; }
.switch-track span { display: block; background: #fffdf5; width: 11px; height: 11px; border-radius: 50%; transition: transform .2s; }
.pose-switch[aria-checked="true"] .switch-track { background: var(--green); }
.pose-switch[aria-checked="true"] .switch-track span { transform: translateX(13px); }
.storage-note { font-size: 10px; color: #93927f; }
.how-to { display: grid; grid-template-columns: repeat(3, 1fr); list-style: none; padding: 24px 0 28px; margin: 0; gap: 30px; border-bottom: 1px solid var(--line); }
.how-to li { display: flex; gap: 13px; }
.step-number { color: #92967e; font: italic 21px Georgia, serif; padding-top: 3px; }
.how-to h2 { font-size: 13px; font-weight: 500; margin-bottom: 3px; }
.how-to p { font-size: 11px; color: #858675; }
.knowledge-section { padding-top: 43px; }
.knowledge-heading { display: flex; justify-content: space-between; align-items: end; }
.knowledge-heading h2, .faq-section h2 { font: 28px/1.4 var(--serif); }
.reading-note { color: #90917e; font-size: 11px; }
.cup-primer { display: grid; grid-template-columns: 1fr 340px; gap: 64px; margin: 25px 0 30px; align-items: center; }
.primer-copy h3 { font-size: 15px; font-weight: 500; margin-bottom: 9px; }
.primer-copy p { font-size: 13px; line-height: 1.95; color: #757967; }
.primer-copy p + p { margin-top: 9px; }
.face-study { display: flex; gap: 40px; justify-content: center; padding: 14px; border-left: 1px solid var(--line); }
.face-study figure { margin: 0; text-align: center; }
.study-cup { width: 91px; height: 49px; margin-bottom: 14px; transform: rotate(-12deg); }
.face-study figcaption { font-size: 12px; }
.face-study figcaption span { display: block; color: #949582; font-size: 10px; margin-top: 3px; }
.result-guide { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.result-guide article { border: 1px solid #d8d7c8; border-radius: 8px; padding: 21px 24px; background: #fcfaf180; }
.guide-pair { display: flex; gap: 12px; margin: 0 0 18px; }
.guide-pair .mini-cup { width: 38px; height: 20px; transform: rotate(-12deg); }
.guide-pair .mini-cup + .mini-cup { transform: rotate(168deg); }
.guide-title { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.guide-title h3 { font: 24px var(--serif); }
.guide-title span { font-size: 10px; color: var(--red); }
.result-guide p { margin-top: 12px; color: #7b7d6c; font-size: 12px; line-height: 1.9; }
.source-note { font-size: 10px; color: #94937f; margin-top: 15px; }
.faq-section { display: grid; grid-template-columns: 1fr 1.6fr; gap: 60px; border-top: 1px solid var(--line); margin-top: 44px; padding: 38px 0 50px; }
.faq-list details { border-bottom: 1px solid var(--line); }
.faq-list summary { list-style: none; padding: 16px 28px 16px 0; cursor: pointer; position: relative; font-size: 13px; }
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after { content: "+"; position: absolute; right: 4px; color: #8a8f79; }
.faq-list details[open] summary::after { content: "−"; }
.faq-list details p { color: #7b7d6c; font-size: 12px; line-height: 1.9; padding: 0 22px 16px 0; }
.site-footer { display: flex; align-items: center; gap: 12px; padding: 22px 0 30px; border-top: 1px solid var(--line); font-size: 11px; }
.site-footer p span { color: #8e907d; }
.site-footer .brand-icon { width: 28px; height: 28px; }
.footer-link { margin-left: auto; background: none; color: #717764; font-size: 11px; min-height: 44px; }
/* Closed dialogs never occupy document space or appear in page captures. */
.modal { width: min(540px, calc(100% - 32px)); border: 1px solid var(--line); border-radius: 12px; padding: 0; color: var(--ink); background: var(--paper); max-height: calc(100dvh - 48px); }
dialog::backdrop { background: #373d3240; backdrop-filter: blur(3px); }
.modal-content { padding: 28px; }
.result-sheet { margin: 20px 0 14px; }
.result-inner { padding: 0; }
.modal-heading { display: flex; align-items: start; justify-content: space-between; gap: 16px; }
.modal-heading h2 { font: 28px var(--serif); }
.close-button { min-height: 44px; background: none; font-size: 12px; color: var(--muted); }
.field-label { display: block; margin: 22px 0 12px; font-size: 12px; color: var(--muted); }
textarea { width: 100%; max-height: 40vh; padding: 14px; resize: vertical; border: 1px solid var(--line); border-radius: 6px; background: #fffdf5; color: var(--ink); font-size: 16px; }
.modal-actions { display: flex; gap: 10px; justify-content: end; margin-top: 18px; }
.primary-button, .secondary-button { min-height: 44px; border-radius: 5px; padding: 9px 22px; }
.primary-button { background: var(--green); color: #fffdf0; }
.secondary-button { border: 1px solid var(--line); background: transparent; }
.result-inner { text-align: center; }
.result-inner h2 { font: 36px var(--serif); }
.result-meaning { margin-top: 10px; color: var(--muted); }
.result-question { margin: 16px 0; overflow-wrap: anywhere; font-size: 12px; color: var(--muted); }
.result-button { margin-top: 12px; width: 100%; }
.history-list { margin-top: 24px; }
.history-item { position: relative; padding: 16px 50px 16px 0; border-top: 1px solid var(--line); }
.history-result { display: flex; align-items: center; gap: 8px; }
.history-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--red); }
.history-question { overflow-wrap: anywhere; margin: 6px 0; color: var(--muted); font-size: 13px; }
.history-item time { color: #90927f; font-size: 11px; }
.delete-record { position: absolute; right: 0; top: 12px; min-height: 44px; padding: 0; background: none; color: var(--red); font-size: 12px; }
.clear-history { display: none; margin-top: 15px; min-height: 44px; background: none; color: var(--red); padding: 0; }
.clear-history.is-visible { display: block; }
.empty-history { padding: 40px 0; text-align: center; color: var(--muted); }
.culture-intro { margin: 20px 0; color: var(--muted); }
.guide-card { padding: 16px 0; border-top: 1px solid var(--line); }
.guide-card h3 { font: 24px var(--serif); margin: 7px 0; }
.guide-card span, .guide-card p { color: var(--muted); font-size: 12px; }
@media (max-width: 900px) {
  .site-shell { padding: 0 28px; }
  .tool-note { display: none; }
  .ritual-layout { grid-template-columns: minmax(0, 1fr) 280px; }
  .control-panel { padding: 24px; }
  h1 { font-size: 32px; }
  .cup-primer { grid-template-columns: 1fr 270px; gap: 28px; }
  .face-study { gap: 24px; }
  .result-guide article { padding: 20px 16px; }
  .how-to { gap: 16px; }
}
@media (max-width: 640px) {
  .site-shell { padding: 0 20px; }
  .topbar { height: 66px; }
  .brand { font-size: 23px; }
  .topbar-actions { gap: 14px; }
  .quiet-button { font-size: 11px; }
  .topbar-actions a:first-child { display: none; }
  .section-intro { padding: 24px 0 18px; }
  .section-intro .eyebrow { font-size: 10px; margin-bottom: 8px; }
  h1 { font-size: 27px; letter-spacing: -1px; }
  .intro-copy { font-size: 11px; margin-top: 9px; }
  .ritual-layout { grid-template-columns: 1fr; }
  .ritual-stage { min-height: 218px; }
  .stage-caption { top: 16px; left: 18px; right: 18px; font-size: 9px; }
  .cup-world { inset: 23px 8px 57px; }
  .ritual-status { bottom: 37px; font-size: 13px; }
  .hold-meter { bottom: 27px; }
  .face-legend { bottom: 9px; gap: 20px; font-size: 9px; }
  .face-legend .mini-cup { width: 16px; height: 9px; }
  .control-panel { border-left: 0; border-top: 1px solid var(--line); padding: 14px 20px; }
  .question-value { font-size: 17px; }
  .section-label { margin-bottom: 1px; font-size: 10px; }
  .ritual-control { margin: 12px 0; }
  .control-kicker { display: none; }
  .hold-button { min-height: 50px; font-size: 18px; }
  .hold-help { font-size: 10px; margin-top: 6px; }
  .preference-row { padding: 5px 0; }
  .preference-row > div { display: flex; align-items: center; gap: 9px; }
  .preference-row p:not(.section-label) { font-size: 10px; }
  .storage-note { font-size: 9px; }
  .how-to { gap: 14px; padding: 20px 0; }
  .how-to li { display: block; }
  .step-number { font-size: 17px; display: block; margin-bottom: 7px; }
  .how-to h2 { font-size: 11px; }
  .how-to p { font-size: 10px; }
  .knowledge-section { padding-top: 30px; }
  .knowledge-heading h2, .faq-section h2 { font-size: 25px; }
  .reading-note { display: none; }
  .cup-primer { grid-template-columns: 1fr; gap: 24px; margin: 22px 0; }
  .face-study { border-left: 0; gap: 60px; padding: 18px 0; background: #e9e8d955; border-radius: 8px; }
  .result-guide { grid-template-columns: 1fr; gap: 10px; }
  .result-guide article { position: relative; padding: 18px; }
  .guide-pair { float: right; margin: 5px 0 10px 8px; }
  .guide-pair .mini-cup { width: 28px; height: 15px; }
  .guide-title { display: block; }
  .guide-title h3 { margin-bottom: 6px; font-size: 23px; }
  .result-guide p { margin-top: 8px; }
  .faq-section { grid-template-columns: 1fr; gap: 16px; margin-top: 30px; padding: 30px 0; }
  .site-footer { gap: 8px; flex-wrap: wrap; }
  .site-footer p { font-size: 10px; }
  .site-footer p span { display: block; font-size: 9px; }
  .footer-link { font-size: 10px; }
  .modal-content { padding: 24px 20px; }
  .result-inner { padding: 0; }
  .result-sheet { margin: 12px 0; }
  .result-inner h2 { font-size: 28px; }
  .result-meaning { font-size: 12px; }
  .result-question { font-size: 11px; margin: 10px 0; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
