/* 界面样式：保留原盘格、文字、五行色义及全部交互。 */
:root { color-scheme: light; --ink:#38352e; --muted:#706a5e; --line:#bbb3a3; --paper:#fbf9f2; --accent:#72563d; }
#bk { min-width:0; margin:0; padding:26px 12px 28px; box-sizing:border-box; background:#eae5da; background-image:linear-gradient(#eee9dfed,#eee9dfed),url(bk.jpg); background-position:center; background-size:cover; background-attachment:fixed; color:var(--muted); font:13px/1.65 var(--preferred-kai), -apple-system,BlinkMacSystemFont,"PingFang SC",sans-serif; }
body>div:first-child { box-sizing:border-box; width:100%; max-width:520px; margin:0 auto 20px; padding:24px 28px 26px; border:1px solid #c6beae; background:var(--paper); color:var(--ink); }
h1 { margin:0; font:normal 29px/1.4 var(--preferred-kai), "Kaiti SC","STKaiti","KaiTi",serif; letter-spacing:.06em; }
.chart-navigation { margin:8px 0 23px; }
.chart-navigation a { min-height:36px; padding:0 5px; border:0; border-bottom:1px solid #c9bcaa; border-radius:0; background:transparent; color:var(--accent); font-size:13px; }
.chart-navigation a:hover,.chart-navigation a:active { background:#eee8dc; }
#divSettings,#divTime,#divMain { width:100%; margin:0 auto; font-family:var(--preferred-kai), "Kaiti SC","STKaiti","KaiTi",serif; }
#divTime:empty { display:none; }
#frmUpInfoTbl>table { width:100%; border-spacing:0 12px; font-size:18px; }
td.title { width:105px; padding-right:9px; white-space:nowrap; font-family:inherit; }
td.content { font-family:inherit; }
tr.time { height:auto; }
tr.time td { padding-bottom:16px; border-bottom:1px solid #d7d0c2; }
#spanNowTime { font:15px/1.6 var(--preferred-kai), -apple-system,BlinkMacSystemFont,sans-serif; font-variant-numeric:tabular-nums; }
#spanGanzhiTime { font-size:17px; color:var(--muted); }
input[type=text],input[type=tel],select { box-sizing:border-box; height:39px; padding:5px 9px; border:1px solid #c4bcad; border-radius:2px; background:#fffdf8; color:var(--ink); font:18px/1.3 var(--preferred-kai), "Kaiti SC","STKaiti","KaiTi",serif; }
#txtContent,#txtDate,#startNum,#selType,#selTime { height:40px; font:18px/normal var(--preferred-kai), "Kaiti SC","STKaiti","KaiTi",serif; }
#txtContent,#selType { width:100%; max-width:none; margin:0; }
#selType { margin-bottom:8px; }
#txtDate,#startNum,#selTime { width:100%; min-width:0; }
input[type=checkbox],input[type=radio] { accent-color:var(--accent); vertical-align:middle; margin:0 5px 0 0; }
label { cursor:pointer; }
input[type=button] { min-height:38px; box-sizing:border-box; border:1px solid #b9ad99; border-radius:2px; background:#efe9dc; color:var(--ink); font:16px var(--preferred-kai), "Kaiti SC","STKaiti","KaiTi",serif; cursor:pointer; }
#btnSelectNumber { width:65px; height:40px; margin-left:8px; }
#btnAutoInput { width:65px; height:82px; margin-left:8px; white-space:normal; }
td.startlesson { height:44px; border:1px solid #66533f; border-radius:2px; background:#6a5743; color:#fffaf0; font:22px var(--preferred-kai), "Kaiti SC","STKaiti","KaiTi",serif; letter-spacing:.3em; }
td.startlesson:hover { background:#594735; }
input:focus-visible,select:focus-visible,a:focus-visible { outline:2px solid #816143; outline-offset:3px; }
#divLesson { width:100%; margin:0 0 17px; font-size:17px; line-height:1.65; }
#divBazi { margin:14px 0 10px; }
table.ganzhi { width:100%; border-color:var(--line); }
table.ganzhi tr td { padding:4px; border-color:#d0c8ba; font-size:18px; }
table.ganzhi tr:first-child td { background:#eee9de; color:var(--muted); font-size:14px; }
table.ganzhi tr:last-child td { color:var(--muted); font-size:14px; }
#liugongTbls { width:100%; table-layout:fixed; margin:0 0 17px; border-color:#8f8472; font-family:var(--preferred-kai), "Kaiti SC","STKaiti","KaiTi",serif; }
#liugongTbls tr td.main { width:33.333%; padding:6px 2px 5px; border-color:#a89d8b; }
table.liugong { width:100%; height:118px; font-size:19px; line-height:1.25; }
table.liugong tr td { width:50%; padding:2px 0; }
span.liushen { font-size:17px; }
table.liugong tr:last-child td:first-child { font-size:23px; font-weight:600; }
#liugongTbls td.main>div { font-size:15px; }
span.logo a { color:#877967; font-size:10px; }
#tblCanggan { width:100%; margin:0 0 18px; border-color:var(--line); font-size:15px; }
#tblCanggan tr td { padding:3px 1px; border-color:#ccc4b5; }
#tblCanggan tr:first-child { background:#eee9de; color:var(--muted); }
#btnReset { width:135px; min-height:39px; font-size:19px; margin-left:14px; }
#divMain>div:last-child { font-size:16px; }
#tblNumbers { width:100%; }
#tblNumbers tr td.numbers { width:auto; height:36px; border-color:var(--line); font-size:16px; }
body>div:not(:first-child) { font-size:12px; }
body>div:not(:first-child) a { color:#70604c; }
@media(max-width:480px) {
  #bk { padding:12px 8px 20px; }
  body>div:first-child { padding:20px 12px 22px; }
  h1 { font-size:26px; }
  td.title { width:88px; padding-right:5px; font-size:16px; }
  #frmUpInfoTbl>table { font-size:16px; }
  #spanNowTime { font-size:14px; }
  #spanGanzhiTime { font-size:15px; }
  #divLesson { font-size:16px; }
  table.liugong { font-size:17px; height:112px; }
  span.liushen { font-size:16px; }
  table.liugong tr:last-child td:first-child { font-size:21px; }
  #liugongTbls tr td.main { padding:5px 1px; }
  #tblCanggan { font-size:13px; }
}

#liugongTbls .liushen { display:inline-flex; align-items:center; gap:2px; vertical-align:middle; }
#liugongTbls .liushen-icon { width:18px; height:36px; object-fit:contain; flex-shrink:0; }
@media(max-width:480px) { #liugongTbls .liushen { gap:1px; } #liugongTbls .liushen-icon { width:14px; height:28px; } }

/* 資源不完整時阻止排盤，保留清晰的恢復入口。 */
.startup-error { color:var(--ink); background:var(--soft); border-left:3px solid var(--accent); padding:12px; line-height:1.7; overflow-wrap:anywhere; }
.startlesson-button:disabled { opacity:.55; cursor:not-allowed; }
