/*
 * FHC 視窗教室 － 各程式樣式
 */

/* ---------- 瀏覽器 ---------- */
.br-bar { flex-wrap: nowrap; }
.br-addr-wrap { flex: 1; min-width: 60px; display: flex; align-items: center; gap: 4px; background: var(--input-bg); border: 1px solid #7f9db9; border-radius: 3px; padding: 0 4px; }
.br-addr-wrap .br-addr { flex: 1; min-width: 0; border: 0 !important; box-shadow: none !important; background: transparent; outline: none; padding: 3px 2px; }
.br-lock { font-size: 11px; }
.br-marks { flex: none; display: flex; gap: 2px; padding: 2px 4px; overflow-x: auto; background: var(--face); border-bottom: 1px solid rgba(0,0,0,.12); scrollbar-width: thin; }
.br-mark { flex: none; display: flex; align-items: center; gap: 4px; padding: 2px 8px; border: 1px solid transparent; border-radius: 3px; background: none; cursor: pointer; font-size: 12px; }
.br-mark:hover { background: rgba(0,0,0,.06); border-color: rgba(0,0,0,.12); }
.br-tip { flex: none; display: flex; align-items: center; gap: 8px; padding: 4px 8px; background: #ffffe1; border-bottom: 1px solid #d8d29a; font-size: 12px; color: #333; }
.br-tip span { flex: 1; }
.br-tip-x { border: 0; background: none; cursor: pointer; font-size: 16px; line-height: 1; }
.br-frame { flex: 1; min-height: 0; position: relative; background: #fff; }
.br-iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #fff; }
.br-blocked { max-width: 520px; margin: 40px auto; padding: 0 20px; text-align: center; color: #333; line-height: 1.6; }
.br-url { word-break: break-all; color: #666; font-family: Consolas, monospace; font-size: 12px; }

/* ---------- 檔案總管 ---------- */
.ex-addr { flex: none; display: flex; align-items: center; flex-wrap: wrap; gap: 2px; padding: 3px 6px; background: var(--face); border-bottom: 1px solid rgba(0,0,0,.15); }
.ex-addr-label { color: var(--muted); margin-right: 4px; }
.ex-crumb { border: 1px solid transparent; background: none; padding: 1px 5px; cursor: pointer; border-radius: 2px; }
.ex-crumb:hover { border-color: #7f9db9; background: #fff; }
.ex-crumb-sep { color: var(--muted); }
.ex-main { flex: 1; min-height: 0; display: flex; }
.ex-side { flex: none; width: 160px; overflow: auto; padding: 6px 4px; background: linear-gradient(90deg, rgba(110,150,220,.12), rgba(110,150,220,.04)); border-right: 1px solid rgba(0,0,0,.12); }
.theme-xp .ex-side { background: linear-gradient(#7ba2e7, #6375d6); }
.theme-xp .ex-place { color: #fff; }
.theme-xp .ex-place:hover, .theme-xp .ex-place.active { background: rgba(255,255,255,.25); color: #fff; }
.ex-place { width: 100%; display: flex; align-items: center; gap: 6px; padding: 4px 6px; border: 0; background: none; text-align: left; cursor: pointer; border-radius: 3px; }
.ex-place:hover { background: rgba(0,0,0,.06); }
.ex-place.active { background: var(--sel-bg); color: var(--sel-fg); }
.ex-side-sep { height: 1px; margin: 6px; background: rgba(0,0,0,.15); }
.ex-list { flex: 1; min-width: 0; overflow: auto; padding: 6px; background: #fff; outline: none; display: flex; flex-direction: column; gap: 1px; align-content: flex-start; }
.ex-item { display: flex; align-items: center; gap: 8px; padding: 4px 8px; border: 1px solid transparent; border-radius: 3px; cursor: default; }
.ex-item:hover { background: #e5f3ff; border-color: #cce8ff; }
.ex-item.sel { background: #cce8ff; border-color: #99d1ff; }
.ex-item-text { min-width: 0; flex: 1; }
.ex-item-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ex-item-sub { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ex-drive { max-width: 420px; }
.ex-group { font-weight: bold; color: #1e3287; padding: 8px 4px 2px; border-bottom: 1px solid #c5d0e6; margin-bottom: 4px; }
.ex-empty { padding: 20px; color: var(--muted); text-align: center; }
@media (max-width: 699px) { .ex-side { display: none; } }

.iv { display: grid; place-items: center; background: #2b2b2b; }
.iv img { max-width: 100%; max-height: 100%; image-rendering: auto; background: #fff; }

/* ---------- 記事本 ---------- */
.np-text { flex: 1; min-height: 0; width: 100%; resize: none; border: 0 !important; border-radius: 0 !important; box-shadow: none !important; outline: none; padding: 6px 8px; font-family: Consolas, "Courier New", "MingLiU", monospace; line-height: 1.5; tab-size: 4; background: #fff; }
.np-text.nowrap { white-space: pre; overflow-x: auto; }
.open-list { flex: 1; overflow: auto; background: #fff; border: 1px solid #aaa; display: flex; flex-direction: column; }
.open-item { display: flex; align-items: center; gap: 6px; padding: 5px 8px; border: 0; background: none; text-align: left; cursor: pointer; }
.open-item:hover { background: var(--sel-bg); color: var(--sel-fg); }

/* ---------- 小畫家 ---------- */
.pt-bar { gap: 6px; }
.pt-tools { display: flex; gap: 2px; }
.pt-tool { min-width: 30px; padding: 2px 4px; }
.pt-tool.on { background: #cce8ff; border-color: #3c7fb1; }
.pt-label { color: var(--muted); }
.pt-cur { width: 26px; height: 26px; border: 2px solid #fff; outline: 1px solid #555; }
.pt-palette { display: grid; grid-template-columns: repeat(10, 14px); gap: 2px; }
.pt-swatch { width: 14px; height: 14px; padding: 0; border: 1px solid #555; cursor: pointer; }
.pt-picker { width: 30px; height: 26px; padding: 0; border: 1px solid #555; background: none; }
.pt-wrap { flex: 1; min-height: 0; overflow: auto; padding: 8px; background: #8c9bb0; }
.pt-canvas { display: block; background: #fff; box-shadow: 2px 2px 6px rgba(0,0,0,.4); cursor: crosshair; touch-action: none; max-width: none; }

/* ---------- 小算盤 ---------- */
.calc { display: flex; flex-direction: column; padding: 8px; gap: 6px; background: var(--face); outline: none; }
.calc-expr { min-height: 18px; text-align: right; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; }
.calc-disp { text-align: right; font-size: 32px; font-weight: 300; padding: 4px 8px; background: #fff; border: 1px solid #999; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.calc-pad { flex: 1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.calc-key { font-size: 16px; padding: 0; min-height: 34px; }
.calc-key.num { font-weight: bold; background: #fff; }
.calc-key.eq { background: var(--accent); color: #fff; }
.theme-classic .calc-key.num { background: #c0c0c0; color: #00007f; }
.theme-classic .calc-key.eq { background: #c0c0c0; color: #ff0000; }
.theme-classic .calc-disp { border: 0; box-shadow: var(--sink); }

/* ---------- 命令提示字元 ---------- */
.cmd { position: absolute; inset: 0; overflow: auto; padding: 6px 8px; background: #0c0c0c; color: #cccccc; font: 14px/1.45 Consolas, "Courier New", "MingLiU", monospace; cursor: text; }
.cmd-row { white-space: pre-wrap; word-break: break-all; }
.cmd-line { display: flex; }
.cmd-prompt { white-space: pre; }
.cmd-in { flex: 1; min-width: 20px; padding: 0 !important; border: 0 !important; box-shadow: none !important; background: transparent !important; color: inherit; font: inherit; outline: none; caret-color: currentColor; }

/* ---------- 踩地雷 ---------- */
.mn { background: #c0c0c0; display: flex; flex-direction: column; overflow: auto; }
.mn .app-menubar { background: #c0c0c0; }
.mn-board { margin: 6px; padding: 6px; align-self: center; box-shadow: inset -2px -2px #fff, inset 2px 2px #808080; display: flex; flex-direction: column; gap: 6px; }
.mn-top { display: flex; justify-content: space-between; align-items: center; padding: 4px 6px; box-shadow: inset -2px -2px #fff, inset 2px 2px #808080; }
.mn-lcd { background: #000; color: #f00; font: bold 22px/1 Consolas, "Courier New", monospace; padding: 2px 4px; letter-spacing: 1px; min-width: 48px; text-align: center; }
.mn-face { width: 34px; height: 34px; font-size: 20px; line-height: 1; padding: 0; background: #c0c0c0; border: 0; box-shadow: inset -2px -2px #808080, inset 2px 2px #fff; cursor: pointer; }
.mn-face:active { box-shadow: inset 2px 2px #808080; }
.mn-grid { display: grid; box-shadow: -2px -2px 0 #808080, 2px 2px 0 #fff; }
.mn-c { width: 24px; height: 24px; padding: 0; border: 0; background: #c0c0c0; box-shadow: inset -2px -2px #808080, inset 2px 2px #fff; font: bold 15px/24px Tahoma, Arial, sans-serif; cursor: default; touch-action: manipulation; }
.mn-c.flag { font-size: 13px; }
.mn-c.open { box-shadow: inset 1px 1px #808080; background: #c6c6c6; }
.mn-c.boom { background: #f33; }
.mn-c.n1 { color: #0000ff; } .mn-c.n2 { color: #008000; } .mn-c.n3 { color: #ff0000; } .mn-c.n4 { color: #000080; }
.mn-c.n5 { color: #800000; } .mn-c.n6 { color: #008080; } .mn-c.n7 { color: #000; } .mn-c.n8 { color: #808080; }
.mn-best { text-align: center; font-size: 12px; padding: 2px 0 6px; }

/* ---------- 貪食蛇 ---------- */
.sn { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px; background: #0a1f0d; color: #cfe8c8; overflow: auto; }
.sn-info { font-size: 13px; }
.sn-cv { width: 100%; max-width: 400px; aspect-ratio: 1; border: 2px solid #3b6e3b; outline: none; touch-action: none; }
.sn-cv:focus { border-color: #9ccc65; }
.sn-pad { display: grid; grid-template-columns: repeat(4, 44px); gap: 6px; }
.sn-btn { height: 34px; font-size: 18px; }
@media (pointer: fine) { .sn-pad { display: none; } }

/* ---------- 工作管理員 ---------- */
.tm-head { font-weight: bold; }
.tm-graph { width: 100%; max-width: 480px; border: 1px solid #333; }
.tm-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 4px 12px; }

/* ---------- 文件型內容（關於、演進史、說明） ---------- */
.doc { padding: 14px 18px; line-height: 1.7; color: #222; background: #fff; min-height: 100%; }
.doc h2 { margin: 0 0 6px; font-size: 20px; }
.doc h3 { margin: 14px 0 4px; font-size: 15px; color: var(--accent); }
.doc p { margin: 4px 0; }
.note { background: #fff8d6; border: 1px solid #ecd77a; padding: 8px 10px; border-radius: 4px; }
.about-head { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; }
.hist { display: flex; flex-direction: column; gap: 0; margin: 10px 0; border-left: 3px solid var(--accent); }
.hist-item { display: flex; gap: 12px; padding: 6px 0 10px; position: relative; }
.hist-item::before { content: ""; position: absolute; left: -8px; top: 12px; width: 13px; height: 13px; border-radius: 50%; background: #fff; border: 3px solid var(--accent); }
.hist-year { flex: none; width: 56px; padding-left: 14px; font-weight: bold; color: var(--accent); }
.hist-body { flex: 1; display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
.hist-name { font-weight: bold; font-size: 14px; }

/* ---------- 個人化 ---------- */
.set { padding: 10px 16px 20px; background: #fff; min-height: 100%; }
.set h3 { margin: 12px 0 6px; font-size: 14px; color: var(--accent); }
.set-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.set-card { display: flex; flex-direction: column; gap: 4px; padding: 6px; border: 2px solid transparent; border-radius: 6px; background: #f4f6f9; cursor: pointer; text-align: center; font-size: 12px; }
.set-card:hover { border-color: #9cc3ef; }
.set-card.on { border-color: var(--accent); background: #e6f0fb; }
.set-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 6px 0; }
.set-row label { display: inline-flex; align-items: center; gap: 4px; }
.wp-prev { display: block; height: 64px; border-radius: 4px; border: 1px solid rgba(0,0,0,.2); }
.th-mini { position: relative; display: block; height: 64px; border-radius: 4px; overflow: hidden; background: #3a7bd5; border: 1px solid rgba(0,0,0,.2); }
.th-mini-win { position: absolute; left: 14px; top: 8px; right: 14px; bottom: 20px; background: #fff; border: 2px solid #0831d9; }
.th-mini-bar { position: absolute; left: 0; right: 0; top: 0; height: 9px; background: #0a58e0; }
.th-mini-tb { position: absolute; left: 0; right: 0; bottom: 0; height: 12px; background: #245edb; }
.th-classic .th-mini { background: #008080; }
.th-classic .th-mini-win { border: 2px solid #c0c0c0; }
.th-classic .th-mini-bar { background: linear-gradient(90deg, #000080, #1084d0); }
.th-classic .th-mini-tb { background: #c0c0c0; border-top: 1px solid #fff; }
.th-xp .th-mini-win { border-radius: 4px 4px 0 0; }
.th-xp .th-mini-tb { background: linear-gradient(90deg, #3a9e3a 0 18%, #2463da 18%); }
.th-glass .th-mini { background: linear-gradient(160deg, #04122b, #1e6fd9); }
.th-glass .th-mini-win { border: 3px solid rgba(180,210,240,.8); border-top-width: 9px; border-radius: 3px; }
.th-glass .th-mini-bar { display: none; }
.th-glass .th-mini-tb { background: rgba(20,30,50,.75); }
.th-modern .th-mini { background: linear-gradient(135deg, #0a3d91, #9bd0ff); }
.th-modern .th-mini-win { border: 1px solid #ccc; border-radius: 5px; }
.th-modern .th-mini-bar { background: #f3f3f3; }
.th-modern .th-mini-tb { background: rgba(240,240,240,.9); }
