.package-review-panel { margin-top:20px;padding:22px;border:1px solid #b7d0ca;border-left:5px solid #2c6d5b;border-radius:12px;background:#f0f7f3; }
.package-review-panel[hidden],.publish-form[hidden],.legacy-publish[hidden] { display:none; }
.package-review-panel h3 { font-size:25px;line-height:1.4;margin:0 0 16px;color:#244c43; }
.package-review-panel dl { display:grid;grid-template-columns:110px minmax(0,1fr);gap:10px 16px;margin:0; }
.package-review-panel dt { font-weight:800;color:#254b43; }.package-review-panel dd { margin:0;overflow-wrap:anywhere; }
.package-review-panel dt,.package-review-panel dd,.package-review-panel p { font-size:18px;line-height:1.7; }.package-review-panel p { color:#455e57; }
.package-review-panel button { font-size:19px;min-height:48px; }
@media(max-width:640px) { .package-review-panel{padding:18px}.package-review-panel dl{grid-template-columns:1fr;gap:4px}.package-review-panel dd{margin-bottom:12px} }
:root {
  color-scheme: light;
  --ink: #15283c;
  --ink-soft: #41566b;
  --muted: #6d7c89;
  --paper: #f3f5f2;
  --card: #ffffff;
  --wash: #e9f0ed;
  --line: #d4dfdb;
  --teal: #075f62;
  --teal-dark: #064a4c;
  --gold: #b88734;
  --gold-wash: #fff5dc;
  --green: #28654d;
  --red: #a1373a;
  --shadow: 0 12px 35px rgba(18, 50, 52, .06);
}


* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.55 system-ui, -apple-system, "Noto Sans TC", "Microsoft JhengHei", sans-serif; }
button, input, textarea, select { font: inherit; }
button, summary { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .45; }

.topbar { min-height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 11px max(24px, calc((100% - 1320px) / 2)); border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, .92); backdrop-filter: blur(14px); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 39px; height: 39px; border-radius: 10px; color: white; background: var(--teal); font-weight: 900; }
.brand strong, .brand small { display: block; }
.brand strong { font-family: ui-serif, "Noto Serif TC", serif; font-size: 1.1rem; line-height: 1.1; }
.brand small { color: var(--muted); font: 700 .63rem ui-monospace, monospace; letter-spacing: .12em; }
.student-link, .quiet-link { color: var(--teal); font-size: .87rem; font-weight: 800; text-decoration: none; }
.student-link:hover, .quiet-link:hover { text-decoration: underline; }
.topbar-actions { display:flex; align-items:center; gap:12px; }.connection-badge { padding:.25rem .5rem; border:1px solid #b8d5c7; border-radius:999px; color:var(--green); background:#eff8f2; font-size:.68rem; font-weight:900; white-space:nowrap; }.connection-badge.remote { color:#3d5c76; border-color:#bad0de; background:#edf6fb; }.admin-identity { color:var(--ink-soft); font-size:.78rem; font-weight:800; }.logout-button { min-height:32px; padding:.35rem .62rem; border:1px solid #bfd2cd; background:#fff; color:var(--teal); font-size:.78rem; }

.workspace { width: min(1320px, calc(100% - 40px)); margin: 0 auto; padding: 42px 0 80px; }
.login-workspace { width:min(920px, calc(100% - 40px)); min-height:calc(100vh - 70px); display:grid; align-content:center; padding-top:42px; }.login-workspace .page-heading { margin-bottom:22px; }.login-card { margin:0; }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 32px; margin-bottom: 28px; }
.page-heading h1 { margin: .18rem 0 .45rem; font: 800 clamp(2.3rem, 5vw, 4.25rem)/1 ui-serif, "Noto Serif TC", serif; letter-spacing: -.06em; }
.page-heading p:not(.eyebrow) { max-width: 640px; margin: 0; color: var(--ink-soft); }
.eyebrow { margin: 0 0 6px; color: var(--teal); font: 800 .68rem ui-monospace, monospace; letter-spacing: .14em; }
.workflow { display: flex; align-items: center; gap: 9px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fbfcfa; color: var(--ink-soft); font-size: .78rem; font-weight: 800; white-space: nowrap; }
.workflow span:first-child { color: var(--teal); }.workflow i { width: 17px; height: 1px; background: #aabbb5; }

.dashboard { display:grid; grid-template-columns:minmax(250px,1.05fr) minmax(420px,1.45fr); gap:18px; margin:0 0 22px; padding:23px; border:1px solid #bcd5ce; border-radius:18px; background:linear-gradient(125deg, #e6f1ed 0%, #f9fbf9 56%, #eef6f3 100%); box-shadow:var(--shadow); }.dashboard-lead { display:grid; align-content:start; gap:0; }.dashboard h2 { margin:.05rem 0 .45rem; font:800 1.62rem/1.15 ui-serif,"Noto Serif TC",serif; }.dashboard-lead>p:not(.eyebrow) { max-width:390px; margin:0; color:var(--ink-soft); font-size:.85rem; }.dashboard-actions { display:flex; align-items:center; gap:14px; flex-wrap:wrap; margin-top:18px; }.outline-button { min-height:34px; padding:.36rem .62rem; border:1px solid #9fbfb8; background:rgba(255,255,255,.74); color:var(--teal); font-size:.76rem; }.outline-button:hover:not(:disabled) { background:#fff; }.outline-button span { margin-left:.5rem; }.metric-grid { display:grid; grid-template-columns:repeat(4, minmax(0,1fr)); gap:9px; margin:0; }.metric-grid>div { min-height:112px; display:grid; align-content:space-between; padding:14px 13px 11px; border:1px solid rgba(152,190,179,.78); border-radius:13px; background:rgba(255,255,255,.78); }.metric-grid dt,.metric-grid small { color:var(--ink-soft); font-size:.7rem; font-weight:800; }.metric-grid dd { margin:2px 0; color:var(--teal-dark); font:800 2rem/1 ui-serif,"Noto Serif TC",serif; letter-spacing:-.04em; }.metric-grid small { color:var(--muted); font-weight:600; line-height:1.3; }.mode-card { grid-column:1 / -1; display:flex; align-items:center; gap:11px; min-height:44px; padding:9px 12px; border-radius:10px; background:rgba(255,255,255,.7); color:var(--ink-soft); font-size:.79rem; }.mode-card::before { content:""; width:9px; height:9px; flex:none; border-radius:50%; background:var(--green); box-shadow:0 0 0 4px rgba(40,101,77,.12); }.mode-card.remote::before { background:#4e8dac; box-shadow:0 0 0 4px rgba(78,141,172,.13); }.mode-card strong { color:var(--ink); }.mode-card span { color:var(--muted); }

.manager-card, .account-card, .operation-card, .admin-auth { border: 1px solid var(--line); border-radius: 18px; background: var(--card); box-shadow: var(--shadow); }
.manager-card { padding: 30px; }
.admin-auth { display:grid; grid-template-columns:minmax(0,1fr) minmax(320px,.72fr); gap:32px; align-items:end; margin:0 0 22px; padding:26px 30px; }.admin-auth h2 { margin:.1rem 0 .45rem; font:800 1.65rem/1.18 ui-serif,"Noto Serif TC",serif; }.admin-auth>div>p:not(.eyebrow) { margin:0; color:var(--muted); font-size:.88rem; }.admin-login-form { display:grid; grid-template-columns:1fr 1fr; gap:14px; }.admin-login-form .form-actions { grid-column:1 / -1; }.admin-login-form .message { text-align:left; }
.workspace[data-admin-state="signed-in"] .admin-auth { display:none; }.workspace[data-admin-state="signed-out"] > .dashboard, .workspace[data-admin-state="signed-out"] > .manager-card, .workspace[data-admin-state="signed-out"] > .account-card, .workspace[data-admin-state="signed-out"] > .operations { display:none; }
.section-heading, .editor-heading, .units-heading { display: flex; justify-content: space-between; gap: 20px; align-items: start; }
.status-stack { display: grid; justify-items: end; gap: 6px; }
.section-heading h2, .editor-heading h2, .units-heading h3 { margin: 0; font-family: ui-serif, "Noto Serif TC", serif; line-height: 1.18; }
.section-heading h2 { font-size: 1.7rem; }.editor-heading h2 { font-size: 1.55rem; }.units-heading h3 { font-size: 1.35rem; }
.message { min-height: 1.5em; margin: 0; color: var(--muted); font-size: .88rem; font-weight: 700; text-align: right; }
.message.error { color: var(--red); }.message.success { color: var(--green); }.message a { color: inherit; text-decoration: underline; }

.catalog-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 28px; margin-top: 23px; }
.course-rail { min-width: 0; padding-right: 28px; border-right: 1px solid var(--line); }
.create-course-form, .course-form, .add-unit-form, .import-form, .publish-form { display: grid; gap: 14px; }
.create-course-form { padding: 17px; border: 1px solid #c4d7d0; border-radius: 13px; background: var(--wash); }
.course-search { margin-top:16px; }.course-search span { color:var(--ink-soft); font-size:.72rem; }.course-search input { min-height:37px; padding:.42rem .55rem; font-size:.8rem; }.course-list { display: grid; gap: 7px; margin-top: 10px; }
.course-button { width: 100%; padding: 12px 12px 11px; border: 1px solid transparent; border-radius: 10px; background: transparent; color: var(--ink); text-align: left; }
.course-button:hover { background: #f1f6f4; }.course-button.active { border-color: #b7cfca; background: white; box-shadow: 0 4px 12px rgba(20, 64, 62, .06); }
.course-button strong, .course-button small { display: block; }.course-button strong { font-size: .96rem; }.course-button small, .rail-empty { margin: 4px 0 0; color: var(--muted); font-size: .74rem; }

.course-editor { min-width: 0; }.empty-state { display: grid; place-items: start; min-height: 315px; align-content: center; padding: 36px; border: 1px dashed #b5c8c2; border-radius: 14px; background: #fbfdfb; }
.empty-state strong { color: var(--teal); font: 800 1.5rem ui-serif, "Noto Serif TC", serif; }.empty-state p { max-width: 450px; margin: 7px 0 0; color: var(--muted); }
.updated-at { padding-top: 5px; color: var(--muted); font-size: .77rem; }
.course-form { grid-template-columns: 1fr 1fr; margin-top: 18px; }.span-all { grid-column: 1 / -1; }
label { display: grid; gap: 5px; color: var(--ink); font-size: .86rem; font-weight: 800; }
label small { color: var(--muted); font-size: .72rem; font-weight: 500; }
input, textarea, select { width: 100%; min-height: 42px; border: 1px solid #adbec1; border-radius: 8px; background: #fff; color: var(--ink); padding: .55rem .65rem; }
textarea { resize: vertical; line-height: 1.5; } input:focus, textarea:focus, select:focus { outline: 3px solid #c5e4df; border-color: var(--teal); }
.form-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
button { min-height: 42px; border: 0; border-radius: 8px; background: var(--teal); color: white; padding: .55rem .78rem; font-weight: 850; text-align: left; }
button:hover:not(:disabled) { background: var(--teal-dark); } button span { float: right; margin-left: 1rem; font-size: 1.2rem; line-height: .9; }
.secondary-button { color: #382704; background: #e8bd65; }.secondary-button:hover:not(:disabled) { background: #d9a744; }

.units-heading { align-items: end; margin: 38px 0 13px; }.units-heading > p { max-width: 400px; margin: 0; color: var(--muted); font-size: .8rem; text-align: right; }
.add-unit-form { grid-template-columns: 1fr 90px minmax(0, 1.6fr); padding: 18px; border: 1px solid var(--line); border-radius: 13px; background: #f8faf8; }.wide-field { min-width: 0; }
.visible-choice { display: flex; align-items: center; gap: 8px; color: var(--ink-soft); font-size: .82rem; }.visible-choice input, .visible-toggle input { width: 17px; min-height: auto; height: 17px; margin: 0; }
.unit-list { display: grid; gap: 9px; margin-top: 16px; }.unit-empty { margin: 0; padding: 18px; color: var(--muted); border: 1px dashed #c2d0cb; border-radius: 10px; font-size: .88rem; }
.unit-row { display: grid; grid-template-columns: 118px minmax(0, 1fr) 150px; gap: 13px; align-items: start; padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.unit-order { display: grid; gap: 7px; align-content: start; }.unit-order label { color: var(--ink-soft); font-size: .72rem; }.unit-order select { min-height: 37px; padding: .35rem .45rem; color: var(--teal); font-weight: 850; }.unit-order small { color: var(--muted); font-size: .66rem; line-height: 1.35; }.move-controls { display: flex; gap: 3px; }.move-controls button { min-height: 26px; width: 28px; padding: 0; border: 1px solid #bfd2cd; border-radius: 5px; background: white; color: var(--teal); text-align: center; }
.unit-main { display: grid; gap: 8px; min-width: 0; }.unit-core { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 8px; }.unit-main label { font-size: .76rem; }.unit-main input { min-height: 37px; }.unit-number-input input { color: var(--teal); font-weight: 850; }.unit-detail input { color: var(--ink-soft); }
.unit-meta { display: grid; justify-items: start; gap: 8px; }.status { display: inline-block; width: max-content; padding: .21rem .55rem; border: 1px solid #bed2cd; border-radius: 999px; color: var(--teal); background: #f6fbf9; font-size: .72rem; font-weight: 900; white-space: nowrap; }.status.draft { color: #6c5b31; border-color: #e1d0a7; background: #fff9e8; }.status.published { color: var(--green); border-color: #b8d5c7; background: #eff8f2; }
.unit-visual-summary { margin:0; color:var(--muted); font-size:.66rem; line-height:1.45; }.visible-toggle { display: flex; align-items: center; gap: 7px; color: var(--ink-soft); font-size: .73rem; font-weight: 700; }.open-unit, .delete-unit { min-height: 32px; padding: .35rem .5rem; font-size: .75rem; }.open-unit { border: 1px solid #a9c8c3; background: white; color: var(--teal); }.delete-unit { border: 1px solid #dfb8b5; background: #fff; color: var(--red); }.delete-unit:hover:not(:disabled) { background:#fff0ef; }
.unit-save-row { display: flex; justify-content: end; margin-top: 15px; }

.account-card { margin-top: 22px; padding: 30px; }.student-account-form { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; margin-top:20px; padding:18px; border:1px solid #c4d7d0; border-radius:13px; background:var(--wash); }.permission-group { min-width:0; margin:0; padding:13px; border:1px solid #c9d8d3; border-radius:10px; background:#fff; }.permission-group legend { padding:0 5px; color:var(--ink-soft); font-size:.76rem; font-weight:850; }.permission-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px 14px; }.permission-choice { display:flex; align-items:start; gap:7px; color:var(--ink-soft); font-size:.78rem; font-weight:650; line-height:1.4; }.permission-choice input { width:16px; min-width:16px; min-height:auto; height:16px; margin:1px 0 0; }.permission-empty,.account-empty { margin:0; color:var(--muted); font-size:.82rem; }.student-account-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; margin-top:18px; }.student-account { display:grid; gap:12px; padding:18px; border:1px solid var(--line); border-radius:13px; background:#fbfcfa; }.student-account>header { display:flex; justify-content:space-between; align-items:start; gap:12px; }.student-account>header strong,.student-account>header small { display:block; }.student-account>header strong { font-family:ui-serif,"Noto Serif TC",serif; font-size:1.15rem; }.student-account>header small { margin-top:2px; color:var(--muted); font:.7rem ui-monospace,monospace; }.student-account .permission-group { background:#fff; }.student-account .permission-list { grid-template-columns:1fr; max-height:180px; overflow:auto; padding-right:4px; }.student-account .visible-toggle { margin-top:-2px; }
.delete-account { border:1px solid #dfb8b5; background:#fff; color:var(--red); }.delete-account:hover:not(:disabled) { background:#fff0ef; }

.operations { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 22px; }.operation-card { padding: 26px; scroll-margin-top:24px; }.operation-card .section-heading h2 { font-size: 1.4rem; }.note { margin: 12px 0 0; color: var(--muted); font-size: .86rem; }.delivery-status { margin:12px 0 -5px; padding:9px 11px; border:1px solid #b9d3ca; border-radius:8px; color:var(--ink-soft); background:var(--wash); font-size:.76rem; font-weight:700; line-height:1.5; }.delivery-status.ready { color:var(--green); border-color:#b8d5c7; background:#eff8f2; }.delivery-status.warning { color:#6c5b31; border-color:#e1d0a7; background:#fff9e8; }.remote-processing-notice { margin-top:18px; padding:18px; border:1px solid #b9d4e1; border-radius:12px; background:#eff7fb; }.remote-processing-notice h3 { margin:.05rem 0 .4rem; color:#274f67; font:800 1.08rem/1.2 ui-serif,"Noto Serif TC",serif; }.remote-processing-notice p:not(.eyebrow) { margin:0; color:#3d6276; font-size:.83rem; line-height:1.65; }.remote-processing-notice .quiet-link { display:inline-block; margin-top:13px; color:#226482; }.publish-checklist { display:grid; gap:7px; margin:18px 0 -4px; padding:13px 14px 13px 31px; border:1px solid #ead4a4; border-radius:10px; background:#fffaf0; color:#6c5b31; font-size:.77rem; line-height:1.45; }.publish-checklist li::marker { color:var(--gold); }
.import-form { grid-template-columns: 1fr 1fr; margin-top: 21px; }.publish-form { margin-top: 20px; }.progress { margin-top: 17px; padding: 14px 16px; border-left: 4px solid var(--gold); border-radius: 0 9px 9px 0; background: var(--gold-wash); }.progress p { margin: 4px 0; color: var(--ink-soft); font-size: .82rem; }.progress a { color: var(--teal); font-size: .84rem; font-weight: 800; }.legacy-publish { margin-top: 22px; padding-top: 17px; border-top: 1px solid var(--line); }.legacy-publish summary { color: var(--teal); font-size: .85rem; font-weight: 850; }
.ocr-guide { margin-top: 18px; padding: 16px; border: 1px solid #b9d3ca; border-radius: 12px; background: var(--wash); }.ocr-guide h3 { margin: .1rem 0 .35rem; font: 800 1.04rem/1.2 ui-serif, "Noto Serif TC", serif; }.ocr-guide > p { margin: 0; color: var(--ink-soft); font-size: .83rem; line-height: 1.65; }.ocr-guide ul { display: grid; gap: 6px; margin: 12px 0 0; padding-left: 1.25rem; color: var(--ink-soft); font-size: .78rem; line-height: 1.55; }.ocr-guide .eyebrow { margin: 0; }

@media (max-width: 940px) {
  .workspace { width: min(100% - 28px, 1320px); }.page-heading { align-items: start; flex-direction: column; }.dashboard, .catalog-layout, .operations, .student-account-list, .admin-auth { grid-template-columns: 1fr; }.dashboard .mode-card { grid-column:auto; }.course-rail { padding: 0 0 20px; border-right: 0; border-bottom: 1px solid var(--line); }.create-course-form { grid-template-columns: 1fr 1fr auto; align-items: end; }.create-course-form button { min-height: 42px; }.course-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }.operations { margin-top: 18px; }.student-account-form { grid-template-columns:1fr 1fr; }
}
@media (max-width: 640px) {
  .status-stack { justify-items: start; }
  .topbar { padding: 10px 14px; }.topbar-actions { gap:7px; }.connection-badge,.admin-identity { display:none; }.student-link { font-size: .75rem; }.workspace { width: min(100% - 20px, 1320px); padding-top: 27px; }.page-heading { gap: 18px; }.workflow { width: 100%; justify-content: space-between; gap: 5px; font-size: .66rem; }.workflow i { width: 8px; }.dashboard, .manager-card, .account-card, .operation-card, .admin-auth { padding: 19px; }.metric-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }.metric-grid>div { min-height:94px; }.dashboard-actions { align-items:start; flex-direction:column; gap:8px; }.section-heading, .editor-heading, .units-heading { display: block; }.message, .units-heading > p { margin-top: 7px; text-align: left; }.course-form, .add-unit-form, .import-form, .create-course-form, .course-list, .student-account-form, .permission-list, .admin-login-form { grid-template-columns: 1fr; }.unit-row { grid-template-columns: 1fr; }.unit-order { grid-template-columns: minmax(0, 1fr) auto; align-items: end; }.unit-order small { grid-column: 1 / -1; }.unit-order label { max-width: 180px; }.unit-main { grid-row: 2; }.unit-meta { grid-row: 3; grid-template-columns: auto auto; align-items: center; }.open-unit { grid-column: 1 / -1; }.unit-save-row button, .form-actions button { width: 100%; }.quiet-link { margin: 6px 0; }.status { margin-top: 8px; }
}
