:root{color-scheme:light;font-family:-apple-system,BlinkMacSystemFont,"Noto Sans TC","PingFang TC","Microsoft JhengHei",sans-serif;color:#233b34;background:#f5f5ef;line-height:1.6}
*{box-sizing:border-box}body{margin:0}a{color:#245b48}button,input,select{font:inherit}button{cursor:pointer;border-radius:9px;border:1px solid #90ab99;min-height:43px;padding:8px 13px;color:#245b48;background:#f3f8f2}button:disabled{opacity:.55;cursor:not-allowed}button.primary{color:#fff;background:#245b48;border-color:#245b48}
button:focus-visible,input:focus-visible,select:focus-visible,a:focus-visible,summary:focus-visible{outline:3px solid #388a6b;outline-offset:3px}
.site-header{padding:15px max(18px,calc((100vw - 1140px)/2));display:flex;align-items:center;justify-content:space-between;gap:12px;background:#fff;border-bottom:1px solid #dce6dd;font-size:14px}.site-header span{font-weight:750}.site-header a{text-decoration:none}
main{max-width:1140px;margin:auto;padding:28px 18px 70px}.hero{padding:15px 0 12px}.hero h1{font-size:clamp(28px,4vw,43px);margin:4px 0;color:#1b4b3c}.hero p{margin:7px 0}.eyebrow{color:#6b856e;font-size:12px;font-weight:800;letter-spacing:.16em}.notice{font-size:13px;color:#647269}
.stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin:16px 0 22px}.stats article{padding:18px;background:#e8eee6;border:1px solid #d6e1d6;border-radius:12px}.stats span{display:block;font-size:13px;color:#607466}.stats strong{display:block;font-size:clamp(20px,2.5vw,27px);line-height:1.4;margin-top:6px;font-variant-numeric:tabular-nums}
.card{border:1px solid #d9e4d8;border-radius:13px;background:#fff;padding:22px;margin-bottom:18px;box-shadow:0 3px 12px #29473208}.section-title{display:flex;align-items:baseline;justify-content:space-between;gap:10px;flex-wrap:wrap;margin-bottom:16px}.section-title h2{margin:0;font-size:21px;color:#245b48}.section-title span{color:#778579;font-size:13px}
.fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;align-items:end}.fields label{display:flex;flex-direction:column;gap:6px;font-size:14px;color:#40594a}.fields input,.fields select,.lesson-edit input{min-height:44px;width:100%;min-width:0;padding:8px 12px;border:1px solid #b8cbbc;background:#fff;border-radius:8px;color:#223c33}.fields button{justify-self:start}.hint{font-size:13px;color:#64766b}.risk{font-size:14px;font-weight:650;color:#82432d}.risk:empty{display:none}
.course-list{display:grid;gap:12px}.course{border:1px solid #e0e8dd;border-radius:12px;overflow:hidden}.course summary{cursor:pointer;padding:15px 16px;background:#f4f8f3;display:flex;justify-content:space-between;gap:8px;align-items:center}.course-head{display:flex;flex-direction:column;gap:3px}.course-head b{color:#234937}.course-head small{color:#698072}.course-percent{font-size:14px;white-space:nowrap;font-weight:750}.bar{height:7px;background:#e5eae4;overflow:hidden;border-radius:99px;margin:0 14px 12px}.bar>i{display:block;height:100%;background:#4c8b6a;max-width:100%;border-radius:99px}
.lessons{padding:0 16px 16px}.lesson{display:flex;align-items:center;gap:12px;justify-content:space-between;border-top:1px solid #e4ebe2;padding:14px 0;flex-wrap:wrap}.lesson-name{min-width:130px;flex:1}.lesson-name small{display:block;color:#62786a}.lesson-edit{display:flex;gap:8px;align-items:end;flex-wrap:wrap}.lesson-edit label{font-size:12px;color:#627469;display:flex;flex-direction:column;gap:3px}.lesson-edit label.title{width:135px}.lesson-edit label.minutes{width:92px}.lesson-edit button{white-space:nowrap}.course-delete{margin:8px 0 0;background:#fff7f2;color:#8a412b;border-color:#d9a78b}
.actions{display:flex;flex-wrap:wrap;gap:12px;margin:12px 0}.late-note{color:#854e25;font-weight:650}#message{min-height:0;border-radius:9px;white-space:pre-wrap}#message:not(:empty){padding:11px 15px;margin:0 0 16px;background:#e7f2eb}#message[data-error="1"]{background:#fae9e5;color:#832f20}
.plan-list{display:grid;gap:10px;margin-top:16px}.day{border:1px solid #e0e8de;border-radius:10px;padding:12px 15px}.day h3{margin:0;font-size:15px;display:flex;justify-content:space-between}.day h3 small{font-weight:400;color:#6a806e}.day p{margin:7px 0 0;font-size:14px}.day.empty{background:#f9faf7;color:#748479}#planSummary{font-size:14px;font-weight:700;color:#355b42}footer{font-size:12px;text-align:center;color:#68796c;padding:24px;border-top:1px solid #d7e1d6}
@media(max-width:700px){.stats{grid-template-columns:repeat(2,minmax(0,1fr))}.fields{grid-template-columns:1fr}.card{padding:17px}.site-header{flex-wrap:wrap}.lesson-edit{width:100%}.lesson-edit label.title{flex:1;min-width:110px}.lesson-edit label.minutes{width:74px}.lesson-name{flex-basis:100%}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto}}

/* 等寬按鈕與桌面科目設定 */
.lesson-edit{display:grid;grid-template-columns:minmax(0,1.6fr) repeat(2,minmax(0,1fr));gap:8px;width:min(100%,530px);align-items:end}
.lesson-edit label.title,.lesson-edit label.minutes{width:auto;min-width:0}
.lesson-edit input{font-size:16px}
.lesson-actions{grid-column:1/-1;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.lesson-actions button{width:100%;min-width:0;min-height:48px;line-height:1.4;text-align:center;white-space:normal;font-weight:750}
.settings-full{grid-column:1/-1;border-top:1px solid #e1eae0;padding-top:12px;min-width:0}
.settings-full h3{font-size:17px;margin:4px 0 7px}
.subject-rules,.fixed-days{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
.subject-rule,.fixed-day{display:flex;align-items:center;gap:9px;padding:10px;border:1px solid #e0e9e0;border-radius:9px;background:#f9fbf8}
.subject-rule .include{display:flex;align-items:center;gap:7px;flex:1;min-width:0;font-size:14px;overflow-wrap:anywhere}
.subject-rule .include input{width:18px;height:18px;min-width:18px}
.subject-rule .weight{flex:0 0 95px;display:flex;gap:5px;align-items:center;font-size:13px}
.subject-rule select,.fixed-day select{min-height:40px;min-width:0;max-width:100%;border:1px solid #b8cbbc;border-radius:7px;background:#fff;color:#233b34}
.subject-rule select{width:53px}
.fixed-day span{width:32px;font-weight:750}.fixed-day select{flex:1}
@media(max-width:700px){.subject-rules,.fixed-days{grid-template-columns:1fr}.lesson-edit{width:100%;grid-template-columns:minmax(0,1.4fr) repeat(2,minmax(0,1fr))}.lesson-edit label.title,.lesson-edit label.minutes{width:auto;flex:auto;min-width:0}}

/* 切換排課方式與自訂科目時，尊重 hidden 語意（優先於表單 flex）。 */
[hidden]{display:none!important}

/* 2026-10-18 UI/RWD 六項驗收：限縮於函授頁，不修改進度資料。 */
.fields,.fields>label,.fields>.settings-full{min-width:0;max-width:100%}
.fields>label{width:100%}
.fields>label>input,.fields>label>select{display:block;box-sizing:border-box;width:100%;max-width:100%;min-width:0}
.fields>label:has(#examDate){min-width:0;max-width:100%}
#examDate{display:block;box-sizing:border-box;inline-size:100%;width:100%;max-width:100%;min-width:0;min-height:44px;font-size:16px;padding:8px 10px;color-scheme:light}
#examDate::-webkit-date-and-time-value{min-inline-size:0;max-inline-size:100%;text-align:start}
#examDate::-webkit-calendar-picker-indicator{flex:0 0 auto;margin:0}
.lesson-edit{grid-template-columns:repeat(3,minmax(0,1fr));min-width:0;max-width:100%}
.lesson-edit label.title,.lesson-edit label.minutes{width:auto;min-width:0;max-width:100%;flex:initial}
.lesson-edit label input{box-sizing:border-box;height:44px;min-height:44px;width:100%;max-width:100%;min-width:0}
.lesson-actions{width:100%;min-width:0}
.subject-rule{min-width:0;flex-wrap:wrap;gap:8px 12px;align-items:center}
.subject-rule .include{flex:1 1 130px;min-width:0;display:flex;flex-direction:row;align-items:center;justify-content:flex-start;gap:8px;text-align:left}
.subject-rule .include input[type="checkbox"]{appearance:auto;-webkit-appearance:checkbox;box-sizing:border-box;display:inline-block;flex:0 0 20px;inline-size:20px;block-size:20px;width:20px;height:20px;min-width:20px;max-width:20px;min-height:20px;max-height:20px;margin:0;padding:0;border:0;accent-color:#245b48}
.subject-rule .include span{flex:1 1 auto;min-width:0;line-height:1.45;text-align:left}
.subject-rule .weight{flex:0 0 auto;width:auto;min-width:118px;display:flex;flex-direction:row;align-items:center;gap:8px;margin-left:auto;white-space:nowrap;font-size:13px}
.subject-rule .weight select{width:55px;min-width:55px;min-height:44px}
.subject-rule .weight[hidden]{display:none!important}
footer{max-width:900px;margin:auto;padding:22px clamp(18px,5vw,30px) 30px;text-align:center;line-height:1.65;overflow-wrap:break-word}
footer p{margin:0 auto;max-width:36rem}
footer p+p{margin-top:5px}
@media(max-width:700px){
 .lesson-edit{grid-template-columns:repeat(3,minmax(0,1fr))}
 .subject-rule{display:flex;align-items:center;justify-content:space-between}
 .subject-rule .include{flex:1 1 145px}
 .subject-rule .weight{flex:0 0 auto;margin-left:auto}
 footer{font-size:12px;padding:24px 20px 30px}
}
@media(max-width:360px){
 .subject-rule .weight{margin-left:28px}
 .lesson-edit{column-gap:6px}
 .lesson-edit label{font-size:12px}
 .lesson-edit input{padding:8px 6px}
}
