/* 小Hi 每日工作匯報｜霧面玻璃（glassmorphism）淺色風格 */
:root {
  --text: #1c2a3a;
  --text2: #4a5b6e;
  --text3: #8090a3;
  --glass: rgba(255, 255, 255, 0.58);
  --glass-strong: rgba(255, 255, 255, 0.78);
  --glass-border: rgba(255, 255, 255, 0.85);
  --line: rgba(120, 145, 175, 0.22);
  --axis: rgba(120, 150, 190, 0.28);
  --step: #3b7cf6;                 /* 流程步驟：主色藍 */
  --step-2: #6aa8ff;
  --issue: #f2a516;                /* 問題節點：琥珀黃 */
  --success-bg: rgba(46, 170, 98, 0.12);
  --success: #1f8a4c;
  --shadow: 0 10px 30px rgba(40, 70, 120, 0.10), 0 1px 0 rgba(255, 255, 255, 0.9) inset;
  --radius: 20px;
  --font: "Microsoft JhengHei", "PingFang TC", "Noto Sans TC", "Heiti TC", sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; color: var(--text); font-family: var(--font); font-size: 15px; line-height: 1.65;
  background:
    radial-gradient(900px 500px at 85% -5%, rgba(140, 185, 255, 0.45), transparent 60%),
    radial-gradient(700px 500px at -10% 30%, rgba(190, 215, 245, 0.55), transparent 60%),
    radial-gradient(800px 600px at 110% 80%, rgba(170, 200, 240, 0.45), transparent 60%),
    linear-gradient(180deg, #eef3f9 0%, #e6edf6 100%);
  background-attachment: fixed;
  min-height: 100vh;
}
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 22px; }

/* 玻璃卡片共用 */
.glass, .card, .schedule, .sub, .stat {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
}

/* 營造廠名稱橫幅 */
.brand-bar { padding: 16px 0 0; }
.brand-bar .wrap {
  display: flex; align-items: center; gap: 10px;
  font-size: 20px; font-weight: 700; letter-spacing: .25em; color: #24466f;
}
.brand-bar .wrap::before {
  content: ""; width: 28px; height: 28px; border-radius: 9px;
  background: linear-gradient(135deg, #8fc0ff, #3b7cf6); box-shadow: 0 4px 12px rgba(59, 124, 246, .35);
}

/* 標題區 */
.page-head { padding: 18px 0 8px; }
.page-head h1 { margin: 6px 0 4px; font-size: 30px; letter-spacing: .03em; }
.summary { margin: 0; color: var(--text2); max-width: 820px; }

/* 頁籤 */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 16px; }
.tabs a {
  padding: 7px 16px; border-radius: 999px; font-size: 14px; text-decoration: none; color: var(--text2);
  background: var(--glass-strong); border: 1px solid var(--glass-border); box-shadow: 0 4px 12px rgba(40, 70, 120, .06);
  transition: all .15s;
}
.tabs a:hover { color: var(--step); transform: translateY(-1px); }
.tabs a.primary {
  color: #fff; border-color: transparent;
  background: linear-gradient(135deg, var(--step-2), var(--step)); box-shadow: 0 6px 16px rgba(59, 124, 246, .35);
}

/* 匯報日程 */
.schedule { padding: 18px 22px; scroll-margin-top: 16px; }
.schedule-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.schedule h2 { margin: 0; }

main { padding-top: 14px; padding-bottom: 60px; }
.card { padding: 22px 24px; margin-bottom: 20px; scroll-margin-top: 16px; }
.card h2, .schedule h2 {
  font-size: 13px; font-weight: 700; letter-spacing: .14em; color: var(--text2);
  display: flex; align-items: center; gap: 8px; margin: 0 0 4px;
}
.card h2::before, .schedule h2::before {
  content: ""; width: 18px; height: 18px; border-radius: 6px; flex: 0 0 18px;
  background: linear-gradient(135deg, rgba(106, 168, 255, .25), rgba(59, 124, 246, .45));
  border: 1px solid rgba(59, 124, 246, .35);
}
.card h3, .sub-block h3 { margin: 0 0 10px; font-size: 16px; }
.caption { margin: 0 0 14px; color: var(--text3); font-size: 13px; }
.load-error { background: rgba(255, 244, 229, .9); border: 1px solid #f5c26b; border-radius: 14px; padding: 16px 20px; margin-bottom: 20px; }
.load-error code { background: #fff; padding: 1px 6px; border-radius: 4px; }

/* 時間軸共用 */
.axis-box { width: 100%; position: relative; overflow: hidden; }
.clickable { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.clickable:focus-visible { outline: 2px solid var(--step); outline-offset: 2px; border-radius: 8px; }
.lbl { font-size: 12.5px; line-height: 1.45; color: var(--text3); }
.bd { font-size: 14px; line-height: 1.5; }
.pre { white-space: pre-line; }
.abs { position: absolute; }
.hit { position: absolute; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; }
.circle { border-radius: 50%; }
.node-step { background: radial-gradient(circle at 35% 30%, #9cc6ff, var(--step) 70%); box-shadow: 0 0 0 4px rgba(59, 124, 246, .14), 0 4px 10px rgba(59, 124, 246, .35); }
.node-issue { background: radial-gradient(circle at 35% 30%, #ffd77a, var(--issue) 70%); box-shadow: 0 0 0 4px rgba(242, 165, 22, .16), 0 3px 8px rgba(242, 165, 22, .35); }
.node-sel { box-shadow: 0 0 0 4px rgba(255, 255, 255, .95), 0 0 0 7px var(--step), 0 6px 14px rgba(59, 124, 246, .4); }

/* 直式 */
.vert { position: relative; width: 100%; }
.vert .rail { position: absolute; left: 17px; top: 20px; bottom: 20px; width: 4px; border-radius: 2px; background: var(--axis); }
.vrow { position: relative; display: flex; align-items: center; gap: 10px; min-height: 44px; }
.vrow .slot { flex: 0 0 38px; display: flex; justify-content: center; }
.vissue { padding: 4px 0; }
.vissue .box { flex: 1; min-width: 0; border-left: 2px solid var(--issue); padding: 4px 0 4px 10px; display: flex; flex-direction: column; gap: 2px; background: rgba(255, 246, 225, .45); border-radius: 0 10px 10px 0; }

.flow-block { background: rgba(255, 255, 255, .45); border: 1px solid rgba(255, 255, 255, .8); border-radius: 16px; padding: 14px 16px; }
.flow-block + .flow-block { margin-top: 14px; }
.legend { display: flex; gap: 18px; margin-bottom: 10px; font-size: 13px; color: var(--text2); }
.dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.dot-step { background: var(--step); }
.dot-issue { background: var(--issue); }
.sub-block { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }

.select-row { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--text2); }
.select-row select { font: inherit; padding: 6px 12px; border: 1px solid var(--glass-border); border-radius: 10px; background: var(--glass-strong); color: var(--text); box-shadow: 0 2px 8px rgba(40, 70, 120, .06); }
.props { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 12px 0 0; font-size: 14px; }
.props div { background: rgba(255, 255, 255, .5); border: 1px solid rgba(255, 255, 255, .85); border-radius: 12px; padding: 8px 12px; }
.props dt { color: var(--text3); font-size: 12px; }
.props dd { margin: 0; font-weight: 600; }
.greeting-box { margin-top: 12px; background: linear-gradient(135deg, rgba(106, 168, 255, .14), rgba(255, 255, 255, .5)); border: 1px solid rgba(255, 255, 255, .85); border-radius: 14px; padding: 12px 16px; }
.greeting-title { font-size: 12.5px; font-weight: 700; letter-spacing: .1em; color: var(--step); margin-bottom: 2px; }
.greeting { margin: 0; }

/* 成果統計大數字 */
.stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { padding: 14px 16px; border-radius: 16px; }
.stat .num { font-size: 28px; font-weight: 700; line-height: 1.1; color: #1d3f6e; }
.stat .num small { font-size: 14px; font-weight: 600; margin-left: 2px; color: var(--text2); }
.stat .cap { font-size: 12.5px; color: var(--text3); margin-top: 4px; }

/* 圖表 */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.card .grid2 { margin-bottom: 18px; }
.sub { padding: 16px; border-radius: 16px; background: rgba(255, 255, 255, .5); }
.pie-wrap { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.pie-legend { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.pie-legend li { margin: 4px 0; }
.bar-row { display: grid; grid-template-columns: minmax(0, 1fr) 46% 28px; align-items: center; gap: 8px; font-size: 13px; margin: 6px 0; }
.bar-track { background: rgba(120, 150, 190, .14); border-radius: 999px; height: 10px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, #b9d4ff, #8ab6ff); border-radius: 999px; }
.bar-row.em .bar-fill { background: linear-gradient(90deg, var(--step-2), var(--step)); }
.bar-row.em .bar-label { font-weight: 600; }
.bar-val { text-align: right; color: var(--text2); }
.tbl-block { margin-top: 18px; }
.tbl-scroll { overflow-x: auto; border-radius: 14px; border: 1px solid rgba(255, 255, 255, .85); background: rgba(255, 255, 255, .5); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
th { background: rgba(230, 238, 249, .7); color: var(--text2); font-weight: 600; white-space: nowrap; font-size: 13px; }
.tone-success { display: inline-block; background: var(--success-bg); color: var(--success); padding: 1px 10px; border-radius: 999px; font-weight: 600; white-space: nowrap; }

/* 竣工圖分析 */
.dpanel { padding: 14px; border-radius: 16px; background: rgba(255, 255, 255, .5); border: 1px solid rgba(255, 255, 255, .85); display: flex; flex-direction: column; gap: 10px; }
.dpanel h3 { margin: 0; display: flex; align-items: center; gap: 8px; }
.dpanel .tag { font-size: 11.5px; font-weight: 700; letter-spacing: .08em; padding: 1px 8px; border-radius: 999px; }
.tag-manual { background: rgba(128, 144, 163, .16); color: var(--text2); }
.tag-ai { background: rgba(59, 124, 246, .14); color: var(--step); }
.dfig { margin: 0; }
.dfig img { width: 100%; display: block; border-radius: 12px; background: #fff; cursor: zoom-in; box-shadow: 0 6px 18px rgba(20, 40, 80, .18); }
.dfig figcaption { font-size: 12.5px; color: var(--text3); margin-top: 4px; }
.dplaceholder {
  flex: 1; min-height: 180px; border: 2px dashed rgba(120, 150, 190, .4); border-radius: 12px;
  display: flex; align-items: center; justify-content: center; text-align: center; padding: 16px;
  color: var(--text3); font-size: 13.5px; white-space: pre-line; background: rgba(255, 255, 255, .35);
}

/* 清單 */
.checklist, .rows { list-style: none; margin: 0; padding: 0; }
.checklist li { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; border-bottom: 1px solid var(--line); }
.checklist li:last-child, .rows li:last-child { border-bottom: 0; }
.check { flex: 0 0 18px; height: 18px; margin-top: 3px; border: 2px solid rgba(120, 150, 190, .5); border-radius: 6px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 12px; background: rgba(255, 255, 255, .6); }
.check.on { background: linear-gradient(135deg, var(--step-2), var(--step)); border-color: transparent; }
.meta { margin-left: auto; padding-left: 12px; white-space: nowrap; font-size: 12.5px; color: var(--text3); }
.rows li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.row-head { display: flex; gap: 10px; align-items: baseline; }
.row-title { font-weight: 600; }
.badge { margin-left: auto; white-space: nowrap; font-size: 12px; padding: 1px 10px; border-radius: 999px; background: rgba(242, 165, 22, .16); color: #a26a00; }
.row-detail { color: var(--text2); margin-top: 2px; }
.steps { margin: 0; padding-left: 0; list-style: none; counter-reset: s; }
.steps li { counter-increment: s; position: relative; padding: 8px 0 8px 40px; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 8px; width: 26px; height: 26px; border-radius: 50%; background: linear-gradient(135deg, var(--step-2), var(--step)); color: #fff; font-size: 13px; display: flex; align-items: center; justify-content: center; }
.bottom { align-items: start; }
.bottom .card { margin-bottom: 0; }

/* 跳窗 */
.modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(30, 50, 80, .35); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.modal-panel { position: relative; background: rgba(255, 255, 255, .92); border: 1px solid #fff; border-radius: 20px; width: min(680px, 100%); max-height: min(86vh, 760px); display: flex; flex-direction: column; box-shadow: 0 24px 60px rgba(20, 40, 80, .28); }
.modal-panel.wide { width: min(1100px, 100%); }
.modal-head { padding: 18px 22px 10px; border-bottom: 1px solid var(--line); }
.modal-sub { font-size: 12px; font-weight: 700; letter-spacing: .12em; color: var(--step); }
.modal-head h3 { margin: 2px 0 0; font-size: 18px; line-height: 1.45; }
.modal-body { padding: 6px 22px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.modal-body img { width: 100%; display: block; border-radius: 10px; margin: 10px 0; background: #000; }
.modal-item { padding: 10px 0; border-bottom: 1px solid var(--line); }
.modal-item:last-child { border-bottom: 0; }
.modal-item .lbl { margin-bottom: 4px; }
.modal-foot { padding: 12px 22px 16px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; }
.btn { font: inherit; color: #fff; border: 0; border-radius: 999px; padding: 8px 24px; cursor: pointer; background: linear-gradient(135deg, var(--step-2), var(--step)); box-shadow: 0 6px 16px rgba(59, 124, 246, .35); }
.btn:hover { filter: brightness(1.06); }
body.modal-open { overflow: hidden; }

@media (max-width: 960px) {
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .props { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .grid2 { grid-template-columns: 1fr; }
  .bottom .card { margin-bottom: 20px; }
}
@media (max-width: 560px) {
  .wrap { padding: 0 12px; }
  .card { padding: 16px 14px; }
  .schedule { padding: 14px; }
  .page-head h1 { font-size: 24px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .props { grid-template-columns: 1fr 1fr; }
  .bar-row { grid-template-columns: minmax(0, 1fr) 38% 24px; }
}
