:root {
  --ink: #1e2732;
  --muted: #747d87;
  --blue: #245aa8;
  --cyan: #18abd0;
  --line: #e1e4e8;
  --soft: #f7f8fa;
  --danger: #a64a4a;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; color: var(--ink); background: #fff; font-family: Arial, "Malgun Gothic", sans-serif; }
button, input { font: inherit; }
button { cursor: pointer; }
.student-shell { display: grid; place-items: center; min-height: 100vh; padding: 40px 24px 72px; background: #fff; }
.login-panel { display: grid; place-items: center; width: 100%; }
.login-card { width: min(100%, 400px); padding: 34px 0 0; background: #fff; border-top: 2px solid var(--blue); }
.login-brand { display: flex; justify-content: center; margin: 0 0 46px; }
.login-brand img { display: block; width: 240px; height: auto; }
.login-card h1, .login-card h2 { margin: 0; color: var(--ink); font-size: 26px; letter-spacing: -.04em; }
.login-card h1 { text-align: center; }
.login-guide { margin: 12px 0 30px; color: var(--muted); font-size: 13px; line-height: 1.6; text-align: center; }
.session-status { padding: 10px 12px; color: #52677e; background: #f2f6fa; font-size: 12px; line-height: 1.6; text-align: center; }
.session-card { text-align: center; }
.session-card .session-status { margin: 24px 0 20px; padding: 14px; font-size: 14px; }
.session-retry { display: block; margin: 0 auto 18px; padding: 9px 13px; border: 1px solid #bac7d6; background: #fff; color: var(--blue); font-size: 12px; }
.script-help { padding: 20px; color: var(--danger); font-size: 14px; line-height: 1.7; text-align: center; }
form { display: grid; }
.login-mode { display: grid; grid-template-columns: 1fr 1fr; margin-bottom: 24px; border: 1px solid #cfd5dc; }
.login-mode-button { min-height: 42px; color: #68717b; background: #fff; border: 0; font-size: 12px; font-weight: 700; }
.login-mode-button + .login-mode-button { border-left: 1px solid #cfd5dc; }
.login-mode-button.active { color: #fff; background: var(--blue); }
.login-mode-button:focus-visible { position: relative; outline: 3px solid rgba(24, 171, 208, .35); outline-offset: 2px; }
label { margin: 0 0 8px; font-size: 12px; font-weight: 700; }
input { width: 100%; height: 50px; padding: 0 14px; color: var(--ink); background: #fff; border: 1px solid #cfd5dc; border-radius: 0; outline: none; transition: border-color .15s ease; }
input:focus { border-color: var(--blue); }
input::placeholder { color: #a2a9b0; }
#phone { margin-bottom: 20px; }
.parent-phone-field { display: grid; margin-bottom: 20px; }
.form-success { margin: 13px 0; color: #23754c; font-size: 13px; line-height: 1.6; }
.forgot-password { justify-self: center; margin-top: 14px; padding: 6px; border: 0; background: transparent; color: var(--blue); font-size: 12px; text-decoration: underline; text-underline-offset: 3px; }
.forgot-password:disabled { opacity: .65; cursor: wait; }
.password-field { position: relative; }
.password-field input { padding-right: 62px; }
.password-toggle { position: absolute; top: 50%; right: 10px; padding: 7px; color: var(--blue); background: none; border: 0; transform: translateY(-50%); font-size: 11px; font-weight: 700; }
.password-confirm-field { display: grid; margin-top: 20px; }
.form-error { margin: 0 0 13px; color: var(--danger); font-size: 12px; line-height: 1.5; }
.login-button, .logout-button { width: 100%; min-height: 50px; color: #fff; background: var(--blue); border: 0; border-radius: 0; font-weight: 700; }
.login-button:hover { background: #1c4b8f; }
.login-button:disabled { cursor: wait; opacity: .65; }
.help-text { margin: 19px auto 0; color: var(--muted); font-size: 11px; line-height: 1.6; text-align: center; }
.login-footer { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 46px; padding-top: 14px; border-top: 1px solid #e1e4e8; }
.admin-entrance { color: #9098a1; font-size: 11px; line-height: 1.4; text-decoration: none; text-underline-offset: 3px; transition: color .15s ease; }
.admin-entrance:hover { color: var(--blue); text-decoration: underline; }
.admin-entrance:focus-visible, .social-button:focus-visible { outline: 3px solid rgba(24, 171, 208, .32); outline-offset: 3px; }
.social-links { display: flex; align-items: center; }
.social-button { display: grid; place-items: center; width: 32px; height: 32px; color: #fff; text-decoration: none; transition: filter .15s ease, transform .15s ease; }
.social-button:hover { filter: brightness(.92); transform: translateY(-1px); }
.social-button svg { display: block; width: 19px; height: 19px; fill: currentColor; }
.naver-blog { background: #03c75a; }
.instagram { background: linear-gradient(145deg, #6b43c1 0%, #c13584 44%, #fd7a36 76%, #feda75 100%); }
.instagram svg { fill: none; stroke: currentColor; stroke-width: 1.8; }
.instagram .instagram-dot { fill: currentColor; stroke: none; }
.admin-transition { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 24px; color: #dce6e1; background: rgba(10, 14, 15, .96); }
.server-access-panel { width: min(100%, 470px); padding: 22px; background: #151b1c; border: 1px solid #465052; border-top: 3px solid #6a7878; box-shadow: 0 30px 80px rgba(0, 0, 0, .5); }
.server-access-meta { display: flex; justify-content: space-between; gap: 16px; padding-bottom: 12px; color: #758181; border-bottom: 1px solid #323a3b; font: 700 9px/1 Consolas, "Courier New", monospace; letter-spacing: .12em; }
.server-access-status { display: flex; align-items: center; gap: 9px; margin-top: 28px; color: #82d4a6; font: 700 10px/1 Consolas, "Courier New", monospace; letter-spacing: .12em; }
.server-status-light { width: 8px; height: 8px; background: #68d694; border-radius: 50%; box-shadow: 0 0 12px rgba(85, 224, 144, .8); animation: server-pulse 1s ease-in-out infinite; }
.server-access-kicker { margin: 30px 0 7px; color: #7f8c8d; font: 700 9px/1.2 Consolas, "Courier New", monospace; letter-spacing: .15em; }
.server-access-panel h2 { margin: 0; color: #f3f5f1; font-size: 27px; letter-spacing: -.04em; }
.server-access-panel > p:not(.server-access-kicker) { margin: 11px 0 0; color: #9aa5a4; font-size: 12px; line-height: 1.6; }
.server-access-progress { height: 3px; margin-top: 28px; overflow: hidden; background: #2b3334; }
.server-access-progress span { display: block; width: 42%; height: 100%; background: #67cb90; animation: server-progress .8s ease-in-out infinite alternate; }
.server-access-panel.denied .server-access-status { color: #e8a27b; }
.server-access-panel.denied .server-status-light { background: #e27d5c; box-shadow: 0 0 12px rgba(226, 125, 92, .68); animation: none; }
.server-access-panel.denied .server-access-progress { display: none; }
.server-access-close { width: 100%; min-height: 42px; margin-top: 24px; color: #e8ece8; background: transparent; border: 1px solid #647071; font-size: 11px; font-weight: 700; }
.server-access-close:hover { color: #fff; border-color: #9faaaa; }
body.admin-transitioning { overflow: hidden; }
@keyframes server-pulse { 50% { opacity: .45; } }
@keyframes server-progress { from { transform: translateX(-15%); } to { transform: translateX(155%); } }
.student-home { width: min(100%, 1040px); padding-top: 0; border-top: 0; }
.student-page-brand { display: block; width: fit-content; margin: 0 auto 44px; line-height: 0; }
.student-page-brand img { display: block; width: 220px; height: auto; }
.student-home-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; padding: 25px 0 24px; border-top: 2px solid var(--blue); border-bottom: 1px solid var(--line); }
.kicker { margin: 0 0 7px; color: var(--blue); font-size: 10px; font-weight: 700; letter-spacing: .13em; }
.student-home-header h2 { font-size: 27px; }
.student-school { margin: 9px 0 0; color: var(--muted); font-size: 13px; }
.student-home-actions { display: flex; gap: 8px; flex: 0 0 auto; }
.refresh-button, .logout-button.compact { width: auto; min-height: 34px; padding: 0 13px; border: 1px solid #b8c0c9; background: #fff; color: #5c6671; font-size: 11px; font-weight: 700; }
.refresh-button:hover, .logout-button.compact:hover { color: var(--blue); border-color: var(--blue); }
.refresh-button:disabled { cursor: wait; opacity: .6; }
.student-info { display: flex; align-items: center; gap: 16px; padding: 17px 0; border-bottom: 1px solid var(--line); }
.student-info > span { color: var(--muted); font-size: 12px; font-weight: 700; }
.class-list { display: flex; flex-wrap: wrap; gap: 8px; }
.class-chip { padding: 5px 9px; color: var(--blue); background: #f3f7fc; font-size: 12px; font-weight: 700; }
.notice-section { margin-top: 42px; }
.notice-heading-actions { display: flex; align-items: center; gap: 14px; }
.notice-all { color: var(--blue); font-size: 12px; text-decoration: none; }
.notice-card { text-decoration: none; }
.notice-all:hover, .notice-card:hover strong { text-decoration: underline; text-underline-offset: 3px; }
.notice-all:focus-visible, .notice-card:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.homework-section { margin-top: 42px; }
.homework-summary { margin: 0; padding: 13px 0; color: #485768; font-size: 12px; line-height: 1.7; }
.homework-summary.error { color: var(--danger); }
.homework-list { margin: 0; padding: 0; list-style: none; }
.homework-row { margin: 0; padding: 11px 14px; border-bottom: 1px solid var(--line); border-left: 3px solid transparent; font-size: 13px; line-height: 1.8; overflow-wrap: anywhere; }
.homework-row.todo { background: #fff7f5; border-left-color: #d79b90; }
.homework-row.corrections { background: #fffbf0; border-left-color: #d8b675; }
.homework-row.done { color: #7a828b; }
.homework-row strong { font-weight: 600; }
.homework-status { color: #5c6978; font-weight: 600; }
.homework-row.unchecked .homework-status,
.homework-row.todo .homework-status,
.homework-row.corrections .homework-status { color: #b23a3a; }
.homework-row.done .homework-status { color: #688173; }
.homework-detail { color: #66717f; font-size: 12px; }
.homework-class { margin-right: 7px; color: var(--blue); font-size: 11px; }
.homework-help { margin: 10px 0 0; color: var(--muted); font-size: 11px; line-height: 1.7; }
.lecture-section { margin-top: 42px; }
.lecture-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; padding-bottom: 12px; border-bottom: 2px solid var(--blue); }
.lecture-heading .kicker { margin-bottom: 5px; }
.lecture-heading h3 { margin: 0; font-size: 21px; letter-spacing: -.03em; }
.lecture-count { color: var(--muted); font-size: 11px; }
.notice-list, .lecture-list { display: grid; }
.notice-card, .lecture-card { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 20px; width: 100%; min-height: 68px; padding: 14px 18px; color: var(--ink); background: #fff; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; text-align: left; }
.notice-card:hover, .lecture-card:hover { background: #fbfcfe; }
.notice-card.important { background: #fffdf6; }
.notice-meta { flex: 0 0 110px; margin: 0; color: var(--blue); font-size: 11px; font-weight: 700; }
.notice-card strong { flex: 1 1 auto; font-size: 13px; line-height: 1.45; }
.notice-card p { flex: 0 1 360px; margin: 0; overflow: hidden; color: var(--muted); font-size: 11px; line-height: 1.45; text-overflow: ellipsis; white-space: nowrap; }
.notice-arrow { flex: 0 0 auto; color: var(--blue); font-size: 11px; font-weight: 700; }
.lecture-card-copy { min-width: 0; }
.lecture-card strong { display: block; margin-bottom: 4px; font-size: 14px; line-height: 1.45; }
.lecture-card p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.lecture-open { flex: 0 0 auto; min-width: 92px; min-height: 32px; padding: 0 12px; color: var(--blue); background: #fff; border: 1px solid #aeb7c1; border-radius: 0; font-size: 11px; font-weight: 700; }
.lecture-open:hover { color: #fff; background: var(--blue); border-color: var(--blue); }
.lecture-open:disabled { cursor: wait; opacity: .6; }
.lecture-empty, .notice-empty { padding: 28px 18px; color: var(--muted); background: #fff; border-bottom: 1px solid var(--line); font-size: 12px; line-height: 1.65; text-align: center; }
.notice-empty.error { color: var(--danger); }
[hidden] { display: none !important; }

@media (max-width: 720px) {
  .student-shell { align-items: start; padding: 28px 18px 60px; }
  .student-page-brand { margin-bottom: 30px; }
  .student-page-brand img { width: 180px; }
  .student-home-header { gap: 16px; }
  .student-home-actions { flex-direction: column; }
  .student-info { align-items: flex-start; flex-direction: column; gap: 9px; }
  .notice-card { display: grid; gap: 5px; padding: 14px 10px; }
  .notice-meta, .notice-card p { flex-basis: auto; }
  .notice-arrow { position: absolute; top: 14px; right: 10px; }
}

@media (max-width: 420px) {
  .login-card { padding-top: 28px; }
  .login-brand img { width: 205px; }
  .student-home-header h2 { font-size: 23px; }
  .login-footer { margin-top: 38px; }
  .server-access-panel { padding: 18px; }
  .server-access-panel h2 { font-size: 23px; }
}

@media (prefers-reduced-motion: reduce) {
  .admin-entrance, .social-button, .server-status-light, .server-access-progress span { animation: none; transition: none; }
}
