:root { --ink:#233747; --muted:#617381; --blue:#087aa5; --border:#dce3e9; --app-sidebar:#1c2c3b; --app-bg:#f3f6f9; --bs-primary:#087aa5; --bs-body-color:#233747; --bs-body-bg:#f3f6f9; }
body { background:var(--app-bg); color:var(--ink); font-family:system-ui,-apple-system,"Microsoft JhengHei",sans-serif; font-size:16px; line-height:1.65; }
body.app-shell { padding-left:236px; }
a { color:#076d96; }
.app-sidebar { position:fixed; inset:0 auto 0 0; width:236px; z-index:1040; display:flex; flex-direction:column; background:var(--app-sidebar); color:#fff; overflow-y:auto; }
.app-brand { min-height:82px; display:flex; align-items:center; gap:12px; padding:16px 24px; color:#fff; background:#087da8; text-decoration:none; font-size:24px; font-weight:700; line-height:1.3; }
.app-brand:hover { color:#fff; background:#076d96; }
.app-brand>i { font-size:29px; }
.app-brand small { display:block; font-size:12px; margin-top:5px; font-weight:400; letter-spacing:.05em; }
.nav-section { color:#a4b6c6; font-size:12px; margin:28px 24px 10px; letter-spacing:.1em; }
.app-nav { display:grid; padding:0 12px; gap:5px; }
.app-nav a { min-height:48px; padding:12px; display:flex; gap:13px; align-items:center; color:#d2dde6; text-decoration:none; font-size:15px; border-radius:4px; border-left:3px solid transparent; }
.app-nav i { font-size:18px; }
.app-nav a:hover,.sidebar-exit:hover { color:white; background:#293f52; }
.app-nav a[aria-current] { color:#fff; background:#294459; border-left-color:#35b9e5; font-weight:650; }
.sidebar-note { padding:24px; margin-top:auto; color:#aebfcd; font-size:12px; }
.sidebar-note strong { color:#dce5ed; display:block; font-weight:600; margin-bottom:8px; }
.sidebar-note p { margin:0 0 16px; }
.sidebar-exit { padding:18px 24px; color:#d2dde6; text-decoration:none; border-top:1px solid #344452; font-size:14px; }
.app-topbar { min-height:68px; padding:14px 32px; border-bottom:1px solid var(--border); background:white; display:flex; align-items:center; gap:16px; }
.workspace-title { font-size:15px; font-weight:650; min-width:0; overflow-wrap:anywhere; }
.workspace-role { margin-left:auto; flex-shrink:0; background:#edf3f7; border-radius:4px; color:#536d7e; font-size:12px; padding:5px 10px; }
.nav-toggle { display:none; }
.app-shell .page,.app-main { width:100%; max-width:1260px; margin:0 auto; padding:36px 36px 24px; min-width:0; }
.app-shell .page.narrow { max-width:700px; padding-top:48px; }
.app-shell main.page.student-page { max-width:1110px; }
.app-shell .app-main { flex:none; }
.app-shell>.container-fluid { padding:0; }
.app-shell>.container-fluid>.row { margin:0; }
h1,.app-main h1 { color:var(--ink); font-size:28px; font-weight:700; line-height:1.4; letter-spacing:-.025em; }
h2 { font-size:19px; }
.page-heading { margin-bottom:28px; }
.page-heading>p:last-child { margin-bottom:0; }
.eyebrow { color:#087aa5; font-size:14px; font-weight:650; }
.panel,.app-shell .card { background:#fff; border:1px solid var(--border)!important; border-radius:6px; box-shadow:0 2px 3px #23374703!important; padding:26px; margin-bottom:24px; }
.app-shell .card { padding:0; }
.app-shell .card-header { padding:18px 22px; background:white; border-bottom:1px solid var(--border); }
.app-shell .card-body { padding:22px; }
.app-shell .card-body.p-0 { padding:0; }
.app-main>div:first-child.border-bottom { padding-top:0!important; padding-bottom:20px!important; margin-bottom:28px!important; }
.button,.app-shell .btn { border-radius:4px; min-height:44px; font-weight:600; padding:10px 18px; font-size:15px; line-height:1.5; box-shadow:none; }
.button,.app-shell .btn-primary { background:#087aa5; border-color:#087aa5; color:white; }
.button:hover,.app-shell .btn-primary:hover { background:#066585; border-color:#066585; color:white; }
.button.secondary { border-color:#b8c9d4; color:#325568; background:white; }
.button.secondary:hover { background:#eff6fa; border-color:#7f9fae; }
.app-shell .btn-outline-primary { --bs-btn-color:#087aa5; --bs-btn-border-color:#8cbbc9; --bs-btn-hover-bg:#087aa5; --bs-btn-hover-border-color:#087aa5; }
.button.danger { background:#ab392e; border-color:#ab392e; }
.button:disabled { background:#e6ebef; border-color:#ccd6df; color:#667987; }
.text-input,.app-shell .form-control,.app-shell .form-select { border:1px solid #b3c1cd; border-radius:4px; min-height:46px; background:#fff; color:#233747; font-size:16px; padding:10px 12px; }
.field-label,.app-shell .form-label { font-size:14px; font-weight:600; color:#364e61; }
.text-input:focus,.app-shell .form-control:focus,.app-shell .form-select:focus { border-color:#087aa5; box-shadow:0 0 0 3px #087aa51a; }
.text-muted,.muted,.page-footer { color:var(--muted)!important; }
.field-help { font-size:14px; }
.badge,.app-shell .badge { font-size:12px; border-radius:4px; padding:6px 10px; font-weight:600; background:#e5f3fa; color:#076387; line-height:1.25; }
.badge.done { background:#e6f4ee; color:#226a4c; }
.badge[data-state="草稿"],.badge[data-state="已截止"],.badge[data-state="已封存"] { background:#edf1f5; color:#526879; }
.badge[data-state="投票中"],.badge[data-state="開放投票"] { background:#e6f4ee; color:#226a4c; }
.badge[data-state="已排程"],.badge[data-state="尚未開始"] { background:#fff3d7; color:#80550e; }
.notice { font-size:15px; border-color:#e2c892; border-left-width:4px; border-radius:4px; }
.notice.success { border-color:#a4ceba; }
.notice.error { border-color:#d49690; }
.topic-card { padding:22px 26px; }
.topic-card h3,.topic-card h2 { font-size:19px; margin:12px 0 8px; }
.topic-info h3 a,.topic-card h2 a { text-decoration:none; }
.topic-info h3 a:hover,.topic-card h2 a:hover { text-decoration:underline; }
.topic-card p { font-size:14px; }
.topic-list { display:grid; gap:14px; }
.topic-list .panel { margin:0; }
.topic-list+.home-section { margin-top:32px; }
.back-link { font-size:14px; margin-bottom:18px; text-decoration:none; }
.stats-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:20px; margin-bottom:30px; }
.stat-card { padding:22px 24px; background:#fff; border:1px solid var(--border); border-radius:6px; display:flex; justify-content:space-between; gap:12px; }
.stat-card p { margin:0 0 6px; color:var(--muted); font-size:14px; }
.stat-card strong { display:block; font-size:32px; line-height:1.3; color:#233747; font-variant-numeric:tabular-nums; }
.stat-card i { color:#1684af; font-size:26px; }
.stat-card small { display:block; font-size:12px; color:var(--muted); margin-top:8px; }
.dashboard-grid { display:grid; grid-template-columns:minmax(0,1.8fr) minmax(260px,1fr); gap:24px; }
.section-heading { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:12px; margin-bottom:12px; }
.section-heading h2 { margin:0; }
.section-heading>a { font-size:14px; }
.app-main .table:not(.admin-table) { width:100%; }
.app-main .card-body:has(>table) { overflow-x:auto; }
.quick-links { display:grid; }
.quick-links a { display:flex; gap:14px; padding:17px 0; border-top:1px solid var(--border); text-decoration:none; align-items:center; }
.quick-links a:first-child { border-top:0; }
.quick-links i { font-size:22px; }
.quick-links small { color:var(--muted); display:block; font-size:13px; }
.steps { display:flex; border-bottom:1px solid var(--border); gap:0; margin-bottom:28px; }
.steps a { border:0; border-bottom:3px solid transparent; border-radius:0; background:transparent; padding:14px 20px; color:var(--muted); }
.steps a[aria-current] { border-bottom-color:#087aa5; background:transparent; color:#087aa5; }
.vote-steps { display:flex; list-style:none; padding:0; margin:0 0 28px; gap:24px; color:var(--muted); font-size:13px; flex-wrap:wrap; }
.vote-steps li { display:flex; align-items:center; gap:8px; }
.vote-steps span { border-radius:50%; border:1px solid #b8c9d4; width:26px; height:26px; display:grid; place-items:center; font-size:12px; }
.vote-steps [aria-current] { color:#076d96; font-weight:700; }
.vote-steps [aria-current] span { color:white; background:#087aa5; border-color:#087aa5; }
.vote-option { border:1px solid #ccd7df; padding:21px; border-radius:4px; min-height:72px; }
.vote-option:has(input:checked) { border-color:#087aa5; background:#edf8fc; box-shadow:inset 3px 0 #087aa5; }
.vote-option input { accent-color:#087aa5; }
.submit-area { background:#f6f9fb; margin:24px -26px -26px; padding:24px 26px; border-radius:0 0 6px 6px; }
.success-symbol { color:#287857; font-size:44px; display:block; margin-bottom:16px; }
.vote-dialog { width:min(520px,calc(100% - 32px)); max-height:calc(100% - 32px); border:1px solid var(--border); border-radius:6px; padding:28px; color:var(--ink); background:white; box-shadow:0 16px 60px #142b3f33; }
.vote-dialog::backdrop { background:#12263999; }
.confirm-choice { background:#edf8fc; border-left:3px solid #087aa5; padding:18px; font-size:19px; font-weight:700; }
.admin-table { font-size:14px; }
.admin-table th,.admin-table td { padding:16px 14px; }
.admin-table th,.app-shell .table thead th { color:#536979; font-size:13px; background:#f6f8fa; font-weight:600; }
.app-shell .table { --bs-table-bg:white; --bs-table-color:#233747; --bs-table-border-color:#e3e9ee; --bs-table-hover-bg:#f5f9fb; }
.app-shell .table td,.app-shell .table th { padding:16px; vertical-align:middle; }
.app-shell .table td { overflow-wrap:anywhere; }
.app-shell .table .btn { white-space:nowrap; }
.app-shell .badge.bg-secondary { background:#edf1f5!important; color:#556b7b; }
.app-shell .badge.bg-success { background:#e6f4ee!important; color:#226a4c; }
.app-shell .badge.bg-danger { background:#fbeceb!important; color:#a03d35; }
.app-shell .badge.bg-primary { background:#e5f3fa!important; color:#076387; }
.app-shell .badge.bg-warning { background:#fff3d7!important; color:#865b13!important; }
.app-shell .text-primary,.app-shell .text-info { color:#087aa5!important; }
.app-shell .progress { background:#e9eff3; }
.app-shell .progress-bar { background:#1485ae; }
.app-footer { max-width:1260px; padding:24px 36px; margin:auto; color:var(--muted); font-size:12px; }
.page-footer { font-size:13px; }
:focus-visible { outline:3px solid #a26214; outline-offset:3px; }
.skip-link { z-index:1100; }
.auth-page { min-height:100vh; margin:0; display:grid; place-items:center; padding:32px 20px; }
.auth-layout { width:100%; max-width:460px; }
.auth-brand { text-align:center; margin-bottom:26px; color:#087aa5; font-size:28px; font-weight:700; }
.auth-brand small { display:block; font-size:14px; font-weight:400; color:var(--muted); margin-top:4px; }
.auth-card { padding:34px; border-top:4px solid #087aa5; }
.auth-card h1 { font-size:25px; }
.auth-card .button { width:100%; }
.auth-card form { display:grid; gap:12px; }
.auth-card label { margin:4px 0 0; }
.auth-help { font-size:14px; color:var(--muted); text-align:center; }
/* Raster corner artwork from the approved login concept. Keep the real login UI above it. */
.student-auth-page { position:relative; isolation:isolate; min-height:100svh; background:#f6f8fb; }
.student-auth-page::before,.student-auth-page::after { content:""; position:absolute; z-index:-1; pointer-events:none; aspect-ratio:1; background-image:url('../img/student-login-triangles.png'); background-repeat:no-repeat; mix-blend-mode:multiply; }
.student-auth-page::before { top:0; left:0; width:min(33.333vw,560px); background-size:300% auto; background-position:left top; }
.student-auth-page::after { bottom:0; right:0; width:min(38.462vw,640px); background-size:260% auto; background-position:right bottom; }
.student-auth-page .auth-layout { max-width:480px; }
.student-auth-page .auth-brand { font-size:36px; margin-bottom:30px; }
.student-auth-page .auth-card { box-shadow:0 8px 28px #23465e09; }
@media(max-width:600px) {
    .student-auth-page { padding:104px 20px 96px; }
    .student-auth-page::before { width:min(46vw,190px); }
    .student-auth-page::after { width:min(56vw,230px); }
    .student-auth-page .auth-brand { font-size:30px; margin-bottom:24px; }
}
@media(max-width:1100px) { .app-shell .page,.app-main { padding:28px 24px; } .dashboard-grid { grid-template-columns:1fr; } }
@media(max-width:900px) {
    body.app-shell { padding-left:0; }
    .app-topbar { padding:12px 20px; flex-wrap:wrap; }
    .nav-toggle { display:inline-flex; align-items:center; gap:6px; min-height:44px; border:1px solid #bccbd6; border-radius:4px; background:white; padding:8px 12px; font:inherit; color:#233747; }
    .app-sidebar { display:none; position:static; width:100%; max-height:none; }
    .nav-open .app-sidebar { display:flex; }
    .app-brand { min-height:64px; font-size:20px; }
    .app-nav { grid-template-columns:repeat(2,minmax(0,1fr)); padding-bottom:16px; }
    .sidebar-note { display:none; }
    .nav-section { margin-top:16px; }
    .sidebar-exit { padding:12px 24px; }
    .app-shell .page.narrow { padding-top:28px; }
}
@media(max-width:600px) {
    .app-shell .page,.app-shell .page.narrow,.app-main { width:100%; padding:24px 16px; }
    .app-topbar { gap:10px; padding:10px 16px; }
    .workspace-title { font-size:14px; flex:1; }
    .workspace-role { display:none; }
    h1,.app-main h1 { font-size:24px; }
    .panel,.app-shell .card-body { padding:20px; }
    .app-shell .card { padding:0; }
    .stats-grid { gap:10px; grid-template-columns:1fr; }
    .stat-card { padding:16px 20px; }
    .stat-card strong { font-size:27px; }
    .stats-grid.compact-stats { grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; }
    .compact-stats .stat-card { padding:14px 10px; }
    .compact-stats .stat-card p { font-size:12px; }
    .compact-stats .stat-card i { display:none; }
    .steps { gap:0; }
    .steps a { flex:1 1 50%; font-size:14px; padding:12px 8px; }
    .vote-steps { gap:12px; font-size:12px; }
    .vote-steps li { gap:5px; }
    .vote-steps span { width:22px; height:22px; }
    .submit-area { margin:24px -20px -20px; padding:20px; }
    .app-shell .table-responsive .table { min-width:590px; }
    .app-main .d-flex { flex-wrap:wrap; }
    .app-footer { padding:20px 16px; }
    .auth-card { padding:24px; }
}
@media(prefers-reduced-motion:reduce) { *,*::before,*::after { scroll-behavior:auto!important; transition:none!important; animation:none!important; } }
