:root,html[data-theme]{--background:#eeece7;--paper:#fffefa;--surface:#f6f4ef;--ink:#252832;--muted:#747783;--border:#e1ded6;--indigo:#353b70;--indigo-wash:#eaeaf3;--focus:#767fa7;--secondary:#565d76;--bg:var(--background);--line:var(--border);--accent:var(--indigo);--tint:var(--indigo-wash);--warm:var(--surface);accent-color:var(--indigo)}html[data-palette=bamboo]{--indigo:#35685c;--indigo-wash:#e6eeea;--focus:#649184;--secondary:#476d61}html[data-palette=umber]{--indigo:#80583f;--indigo-wash:#f1e9df;--focus:#a47d5f;--secondary:#795d4c}html[data-theme=dark]{--background:#191c22;--paper:#23272e;--surface:#2b3039;--ink:#e5e7ec;--muted:#a4abb7;--border:#3c424e;--indigo:#b3bce9;--indigo-wash:#333b55;--focus:#a5b2ef;--secondary:#bcc4df;--X:#84b6e2;--P:#c0a0e1;--F:#8dc4a8;--C:#dfb978;--shadow:0 12px 36px #0003}html[data-theme=dark][data-palette=bamboo]{--indigo:#9bcebc;--indigo-wash:#2b443d;--focus:#9bd3c0;--secondary:#afcbbc}html[data-theme=dark][data-palette=umber]{--indigo:#dfb995;--indigo-wash:#483a30;--focus:#e1bb9a;--secondary:#d3c0ae}
html[data-theme] body{background:var(--background);color:var(--ink)}html[data-theme] :is(input,textarea,select){color:var(--ink);accent-color:var(--indigo)}html[data-theme=dark] :is(input,textarea,select){background-color:var(--paper);border-color:var(--border)}html[data-theme] :is(.article-primary,.articles-page .article-primary,.article-tabs [aria-pressed=true]){background:var(--indigo);border-color:var(--indigo);color:var(--paper)}html[data-theme=dark] :is(.matrix-cell,.bazi-pillar,.library-card,.case-row,.tool-result,.bazi-detail,.bazi-unit,.learning-figure,.relation-node,.pillars-preview,.editor-actions,.word-entry,.word-definition){background-color:var(--paper);color:var(--ink);border-color:var(--border)}html[data-theme=dark] :is(.matrix-axis,.matrix-corner,.column-heads,.bazi-tabs,.segmented,.flow-settings,.unit-heading,.line-image){background-color:var(--surface);color:var(--ink);border-color:var(--border)}html[data-theme=dark] :is(.original,.translation,.record-note,.literature-note,.annotation-mark){color:var(--ink)}html[data-theme=dark] :is(.target-yao,.target-word-record,.search-text-current){outline-color:var(--indigo)}html[data-theme=dark] mark{background:var(--indigo-wash);color:var(--indigo)}html[data-theme=dark] .text-gray-900,html[data-theme=dark] .text-slate-900{color:var(--ink)}html[data-theme=dark] .bg-white,html[data-theme=dark] .bg-gray-50{background:var(--paper)}
.appearance-trigger{display:inline-flex;align-items:center;justify-content:center;gap:5px;padding:7px 10px;min-height:34px;background:var(--paper);border:1px solid var(--border);border-radius:8px;color:var(--indigo);font:inherit;font-size:12px;cursor:pointer;white-space:nowrap}.appearance-trigger:focus-visible,.appearance-dialog :focus-visible{outline:2px solid var(--focus);outline-offset:3px}.appearance-dialog{box-sizing:border-box;width:430px;max-width:calc(100vw - 24px);padding:25px;border:1px solid var(--border);border-radius:16px;background:var(--paper);color:var(--ink);box-shadow:0 24px 70px #0004;font:14px/1.8 system-ui}.appearance-dialog::backdrop{background:#14182088;backdrop-filter:blur(3px)}.appearance-top{display:flex;justify-content:space-between;align-items:center;gap:15px}.appearance-top h2{font-size:20px;margin:0}.appearance-top button{background:transparent;border:0;color:inherit;font-size:25px;cursor:pointer}.appearance-note{color:var(--muted);font-size:12px}.appearance-dialog h3{font-size:13px;margin:22px 0 9px}.appearance-choices{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.appearance-choices button{display:flex;align-items:center;justify-content:center;gap:7px;padding:11px 5px;border:1px solid var(--border);border-radius:9px;background:var(--surface);color:var(--ink);font:inherit;cursor:pointer}.appearance-choices button[aria-pressed=true]{background:var(--indigo-wash);border-color:var(--indigo);color:var(--indigo)}.appearance-swatch{width:10px;height:10px;border-radius:50%;background:#626c9d}.appearance-swatch[data-swatch=bamboo]{background:#598e7a}.appearance-swatch[data-swatch=umber]{background:#a47d5f}.theme-layout-trigger{position:fixed;right:16px;bottom:18px;z-index:30}
.shell-menu-panel{max-width:calc(100vw - 24px)}@media(max-width:700px){.shell-menu[open]>.shell-menu-panel{position:fixed!important;left:12px!important;right:12px!important;top:var(--shell-menu-top,110px)!important;width:auto!important;max-width:none!important;max-height:calc(100dvh - var(--shell-menu-top,110px) - 14px);overflow:auto;z-index:140}.app-header.site-shell>[data-theme-open]{grid-row:2;grid-column:1;justify-self:end;margin-right:4px;max-width:70px;font-size:11px}.shell-links{flex-wrap:wrap}.appearance-dialog{padding:21px}.appearance-choices button{font-size:13px}}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto!important}*{scroll-behavior:auto!important}}

html[data-theme=dark] :is(.primary,.primary-button,.site-nav>.module-link[aria-current=page],.site-nav>.module-link.is-active,.segmented button[aria-pressed=true]){color:var(--paper);background:var(--indigo)}html[data-theme=dark] :is(.account-bazi,.permission-card){background:var(--paper);color:var(--ink);border-color:var(--border)}

html[data-theme=dark] :is(.support-primary,.download){color:var(--paper)}

html[data-theme=dark]{--tone-f8eeee:var(--surface);--tone-454a58:var(--ink);--tone-e5eee9:var(--surface);--tone-3d685a:var(--ink);--tone-e2e2ef:var(--surface);--tone-a3a3ab:var(--muted);--tone-e5e4f2:var(--surface);--tone-6a7295:var(--muted);--tone-f7f6fb:var(--paper);--tone-f5f3fa:var(--surface);--tone-faf8f3:var(--paper);--tone-77748a:var(--muted);--tone-454158:var(--ink);--tone-868196:var(--muted);--tone-fffdfb:var(--paper);--tone-fffefa:var(--paper);--tone-353047:var(--ink);--tone-817b8d:var(--muted);--tone-777182:var(--muted);--tone-f7f5fa:var(--paper);--tone-f6f5f0:var(--surface);--tone-716486:var(--muted);--tone-80788c:var(--muted);--tone-8a8293:var(--muted);--tone-91839e:var(--muted);--tone-fffdfa:var(--paper);--tone-8d8598:var(--muted);--tone-e8e1ef:var(--surface);--tone-453c52:var(--ink);--tone-78698e:var(--muted);--tone-847b8e:var(--muted);--tone-eeedf5:var(--surface);--tone-f3f1eb:var(--surface);--tone-f4f2ec:var(--surface);--tone-9a9fbd:var(--muted);--tone-7b80a7:var(--muted);--tone-eeedf2:var(--surface);--tone-676778:var(--muted);--tone-e8f2ed:var(--surface);--tone-f7e9e9:var(--surface);--tone-fffdf8:var(--paper);--tone-262832:var(--ink);--tone-f8f6f0:var(--surface);--tone-ece8d6:var(--surface);--tone-f5f4fa:var(--paper);--tone-fcf7f4:var(--paper);--tone-f5eae6:var(--surface);--tone-f8f6f1:var(--surface);--tone-f2f1f8:var(--surface);--tone-f4f2eb:var(--surface);--tone-666775:var(--muted);--tone-f5f4ef:var(--surface);--tone-faf2dc:var(--surface);--tone-f6f4ee:var(--surface);--tone-a4a6b4:var(--muted);--tone-fcfbff:var(--paper);--tone-f1efe9:var(--surface);--tone-f4f2fa:var(--surface);--tone-faeeee:var(--surface);--tone-f7f5fb:var(--paper);--tone-f6f5f9:var(--paper);--tone-a6a5ae:var(--muted);--tone-858692:var(--muted);--tone-666974:var(--muted);--tone-e6e4ee:var(--surface);--tone-eaeaf2:var(--surface);--tone-f0eef5:var(--surface);--tone-90909a:var(--muted);--tone-626575:var(--muted);--tone-8b8790:var(--muted);--tone-767784:var(--muted);--tone-f2f0eb:var(--surface);--tone-96939b:var(--muted);--tone-747381:var(--muted);--tone-555862:var(--ink);--tone-a2a0a5:var(--muted);--tone-f1f0fa:var(--surface);--tone-e9e8f7:var(--surface);--tone-8c8993:var(--muted);--tone-676674:var(--muted);--tone-f2f0e9:var(--surface);--tone-fff2d9:var(--surface);--tone-f5f4f9:var(--surface);--tone-89838a:var(--muted);--tone-73737c:var(--muted);--tone-71707b:var(--muted);--tone-f4eddc:var(--surface);--tone-faf9f5:var(--paper);--tone-f1f0f7:var(--surface);--tone-747282:var(--muted);--tone-686975:var(--muted);--tone-a29ca6:var(--muted);--tone-efedf7:var(--surface);--tone-737381:var(--muted);--tone-e9e7f2:var(--surface);--tone-626471:var(--muted);--tone-f7f6f1:var(--surface);--tone-f5f3ed:var(--surface);--tone-eeedf6:var(--surface);--tone-f7f5ef:var(--surface);--tone-f9ece8:var(--surface);--tone-edf3ed:var(--surface);--tone-fff4dd:var(--surface);--tone-f4f3f9:var(--surface);--tone-555574:var(--ink);--tone-41445f:var(--ink)}
html[data-theme] .appearance-dialog button{transition:none}html[data-theme=dark] .site-shell .brand-glyph{color:var(--paper)}

/* Theme hue belongs to surfaces and focus cues; reading ink stays neutral. */
:root,html[data-theme]{--indigo:#414958;--secondary:#606879;--field:#f2f2f8;--field-hover:#eaeaf3;--control-border:#cbcdd9;--theme-accent:#6974a0}
html[data-palette=bamboo]{--indigo:#414958;--secondary:#606879;--field:#edf3ef;--field-hover:#e4ede6;--control-border:#c7d5cb;--theme-accent:#56806a}
html[data-palette=umber]{--indigo:#414958;--secondary:#606879;--field:#f6f0e8;--field-hover:#eee4d7;--control-border:#d9cdbb;--theme-accent:#9a7954}
html[data-theme=dark]{--indigo:#d3d9e4;--secondary:#b5bdcb;--field:#303744;--field-hover:#394253;--control-border:#566176;--theme-accent:#9ba9d0;--paper:#23272e;--surface:#2a2f38}
html[data-theme=dark][data-palette=bamboo]{--indigo:#d3d9e4;--secondary:#b5bdcb;--field:#293e38;--field-hover:#344c43;--control-border:#4d6b5d;--theme-accent:#91b5a1}
html[data-theme=dark][data-palette=umber]{--indigo:#d3d9e4;--secondary:#b5bdcb;--field:#40372f;--field-hover:#4c4236;--control-border:#72624f;--theme-accent:#c9ab85}
html[data-theme] :is(input:not([type=checkbox]):not([type=radio]),textarea,select,[contenteditable=true]){background-color:var(--field);color:var(--ink);border-color:var(--control-border);caret-color:var(--ink)}
html[data-theme] :is(input,textarea)::placeholder{color:var(--muted);opacity:1}
html[data-theme] :is(input,textarea,select,[contenteditable=true]):focus{border-color:var(--theme-accent);outline-color:var(--theme-accent)}
html[data-theme] :is(input,textarea,select):disabled{opacity:.7}
html[data-theme] :is(.search-box,.history-quick-search){background:var(--field);border-color:var(--control-border)}
html[data-theme] .search-box input{background:transparent}
html[data-theme] :is(.translation,.annotation-section h3,.appearance-trigger){color:var(--ink)}
html[data-theme=dark] :is(.reading-surface,.text-side.translation-side){border-color:var(--border)}
html[data-theme] .record-explanations{background-color:var(--field);border-color:var(--control-border);color:var(--ink)}

/* Neutral input surfaces are independent of the selected accent palette. */
html[data-theme=light],html[data-theme=light][data-palette]{--field:#f6f5f2;--field-hover:#eeede9;--control-border:#d9d8d2}
html[data-theme=dark],html[data-theme=dark][data-palette]{--field:#292e36;--field-hover:#333943;--control-border:#505763}
html[data-theme] :is(input:not([type=checkbox]):not([type=radio]),textarea,select,[contenteditable=true]){background:var(--field)!important;color:var(--ink)!important}
html[data-theme=dark] :is(.matrix-cell,.cast-hex-cell)[data-domain=X]{background:#243d50!important;border-color:#3f657f!important}html[data-theme=dark] :is(.matrix-cell,.cast-hex-cell)[data-domain=P]{background:#3b304b!important;border-color:#655277!important}html[data-theme=dark] :is(.matrix-cell,.cast-hex-cell)[data-domain=F]{background:#263e35!important;border-color:#466b58!important}html[data-theme=dark] :is(.matrix-cell,.cast-hex-cell)[data-domain=C]{background:#493b27!important;border-color:#78603b!important}
html[data-theme=dark] :is(.matrix-cell,.cast-hex-cell)[aria-pressed=true]{outline:2px solid var(--theme-accent);outline-offset:-3px}

/* Accent palettes affect actions and selected surfaces, never ordinary body copy. */
html[data-theme=light]{--indigo:#353b70;--indigo-wash:#eaeaf3;--theme-accent:#6974a0}
html[data-theme=light][data-palette=bamboo]{--indigo:#35685c;--indigo-wash:#e6eeea;--theme-accent:#56806a}
html[data-theme=light][data-palette=umber]{--indigo:#80583f;--indigo-wash:#f1e9df;--theme-accent:#9a7954}
html[data-theme=dark],html[data-theme=dark][data-palette]{--indigo:#d3d9e4;--indigo-wash:#333b55;--theme-accent:#9ba9d0;--secondary:#b5bdcb;--field:#292e36;--field-hover:#333943;--control-border:#505763}
html[data-theme] :is(button.primary,.article-primary,#new-bazi-case,.article-tabs [aria-pressed=true],.question-nav button.current){background:var(--indigo)!important;border-color:var(--indigo)!important;color:var(--paper)!important}
html[data-theme] :is(.article-tabs [aria-selected=true],.case-tabs [aria-selected=true],.choice.selected,.question-nav button.done){background:var(--indigo-wash);border-color:var(--indigo);color:var(--ink)}
html[data-theme] .owner-tools{background:var(--indigo-wash);border-color:color-mix(in srgb,var(--indigo) 24%,var(--border))}html[data-theme] .brand-glyph{background:var(--indigo)}html[data-theme] .track i{background:var(--indigo)}
html[data-theme] :is(.library-tools-dialog button.primary,.library-bulk-actions [data-case-bulk=export],#export-selected-casts,#bulk-tag-casts){background:var(--indigo-wash);border-color:var(--indigo);color:var(--ink)}
html[data-theme] :is(.destructive,[data-remove-case],[data-confirm-case-delete],[data-cast-delete-folder],[data-account-logout],#logout-button){background:color-mix(in srgb,#b64242 10%,var(--paper))!important;border-color:#b76c6c!important;color:#b64242!important}html[data-theme=dark] :is(.destructive,[data-remove-case],[data-account-logout],#logout-button){color:#e7aaaa!important}
html[data-theme] .support-entry{color:#a44f4f!important;border-color:#d8b8ae!important;background:color-mix(in srgb,#b66459 7%,var(--paper))!important}

/* Theme accents belong to surfaces and icons; reading and navigation stay neutral. */
html[data-theme] :is(.word-term,.word-editor-workbench button,.article-card h2,.article-card h3,.article-card h2 a,.article-title,.articles-page h1,.articles-page h2,.articles-page h3,.article-admin-list h2,.article-admin-list h3,.article-admin-list strong,.shell-menu>summary,.message-owner-link,.header-actions>button,.shell-tool-section a,.shell-tool-section button,.case-tabs button,.bazi-tabs button,.main-tabs button,.standalone-shell .shell-links a){color:var(--ink)}
html[data-theme] :is(.site-nav>.module-link,.site-nav>.nav-tree>summary){color:var(--ink)}
html[data-theme] :is(.site-nav>.module-link[aria-current=page],.site-nav>.nav-tree.is-active>summary,.site-nav>.nav-tree[open]>summary){color:var(--paper)}
html[data-theme] :is(.site-nav>.support-entry,.shell-tool-section [data-support-manage]){color:#a44f4f!important}
html[data-theme] .header-actions>button .site-icon,html[data-theme] .message-owner-link .site-icon{color:var(--indigo)}
html[data-theme] :is(.article-card a:not(.article-primary),.article-list a,.article-admin-list a){color:var(--ink)}

/* All website forms use content-sized, non-draggable multiline fields. */
textarea{resize:none!important;box-sizing:border-box!important;max-height:none!important;overflow-y:hidden!important}
/* The same six-line symbol is used by both readers and article illustrations. */
svg.yi-gua-symbol{display:block;flex:none;width:76px;height:112px;fill:none;stroke:currentColor;stroke-width:7;color:var(--ink);forced-color-adjust:auto}
svg.yi-gua-symbol[viewBox="0 0 80 57"]{height:54px}svg.yi-gua-symbol path{stroke:currentColor;stroke-width:7;stroke-linecap:butt}
.gua-diagram-pair{display:flex;justify-content:center;align-items:center;gap:18px}.gua-diagram-item{display:flex;align-items:center;flex-direction:column;gap:8px}.gua-diagram-name{font:13px/1.5 system-ui,sans-serif;color:var(--ink)}.gua-diagram-arrow{font:22px/1 system-ui,sans-serif;color:var(--ink)}
.article-gua-diagram{display:block;max-width:100%;padding:18px 0;text-align:center;white-space:normal}.article-gua-diagram figcaption{font:13px/1.7 system-ui,sans-serif;color:var(--muted);margin:12px 0 0;white-space:pre-wrap}.article-gua-diagram[contenteditable=false]{cursor:pointer;border:1px solid transparent;border-radius:10px}.article-gua-diagram[contenteditable=false]:hover{border-color:var(--border);background:var(--surface)}
dialog::backdrop{position:fixed!important;inset:0!important;width:100vw!important;height:100vh!important;max-width:none!important;max-height:none!important;background:#11182770!important;backdrop-filter:none!important;transform:none!important}
.yi-modal-gutter-shade{position:fixed;inset:0;z-index:20000;background:#11182770;touch-action:none}.yi-modal-gutter-shade[hidden]{display:none}.yi-modal-host{position:relative!important;z-index:20001!important}.yi-modal-frame{position:relative;z-index:20001}html.yi-modal-open{overflow:hidden!important}
.gua-diagram-modal{width:min(620px,calc(100vw - 28px))}.diagram-form-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px}.diagram-form-grid label{min-width:0}.diagram-form-grid select{width:100%}.diagram-trigram-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin:14px 0}.diagram-trigram-grid button{display:flex;flex-direction:column;align-items:center;gap:6px;padding:10px 0}.diagram-trigram-grid [aria-pressed=true]{outline:2px solid var(--indigo);background:var(--indigo-wash)}.diagram-trigram-grid .yi-gua-symbol{width:52px;height:38px}.diagram-trigram-grid[hidden]{display:none}
@media(max-width:600px){.diagram-form-grid{grid-template-columns:1fr}.yilin-entry .yilin-gua-pair{gap:10px}.yilin-entry>header{column-gap:10px}.yilin-entry>header small{overflow-wrap:anywhere}}
.gua-diagram-modal label{display:block;margin:12px 0 8px;font-size:14px}.gua-diagram-modal label>select,.gua-diagram-modal label>input,.gua-diagram-modal label>.clear-field{display:block;width:100%;margin-top:6px}.gua-diagram-modal .modal-actions{display:flex;gap:10px;justify-content:flex-end;margin-top:16px}
