/* Shared presentation layer. Learning content and application logic stay in their original files. */
:root {
  --bg: #FBF6EF;
  --surface: #FFFFFF;
  --surface2: #FFFAF3;
  --ink: #33261C;
  --ink2: #5C4A3A;
  --muted: #8B7965;
  --line: #F0E2D0;
  --primary: #DE7530;
  --deep: #AC521B;
  --soft: #FCEEE0;
  --ok: #3F8F5B;
  --warn: #B8860B;
  --bad: #C0392B;
  --r-lg: 16px;
  --r-md: 12px;
  --r-hero: 16px;
  --shadow-card: none;
}
button:focus-visible, a:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 4px;
}

/* Student workspace: one clear starting point, followed by practice and learning data. */
body.student-app { padding-left: 196px; }
.student-side { width: 196px; padding: 28px 16px 20px; gap: 36px; }
.side-brand { gap: 12px; }
.side-name { letter-spacing: 1px; }
.side-sub { letter-spacing: 1px; }
.side-nav { gap: 8px; }
.side-nav .nav-tab { min-height: 44px; padding: 10px 14px; }
.side-nav .nav-tab.active::before { content: none; }
.side-user { padding: 12px 4px; background: transparent; border: 0; border-radius: 0; }
.side-logout { border-color: transparent; background: transparent; text-align: left; padding-left: 8px; }
.student-topbar { height: 80px; padding: 0 40px; background: var(--bg); }
.welcome-title { font-size: 15px; }
.topbar-right { gap: 16px; }
.chip { background: transparent; border: 0; padding: 0; gap: 5px; }
.chip .gc-value { font-weight: 500; }
.streak-badge { background: transparent; padding: 0; color: var(--ink2); font-weight: 400; }
.main-content { max-width: 1480px; margin: auto; padding: 36px 40px 100px; }
.hero-section {
  margin-bottom: 30px;
  padding: 36px 40px;
  border: 0;
  background: #302c27;
  color: #fff;
}
.hero-section::before, .hero-section::after { content: none; }
.hero-title { color: #fff; font-size: clamp(28px, 2.8vw, 38px); font-weight: 500; letter-spacing: 1px; }
.hero-desc { color: #d3cbc2; max-width: none; font-size: 13px; margin: 14px 0 26px; }
.hero-actions { gap: 12px; }
.btn { box-shadow: none; font-weight: 500; transition: background .16s, border-color .16s, color .16s; }
.hero-section .btn-secondary { background: transparent; border-color: #686056; color: #f5f1eb; }
.hero-section .btn-secondary:hover { background: #484139; border-color: #a69b8c; }
.hero-section .btn-ghost { background: transparent; border-color: transparent; color: #dfd7cd; }
.hero-section .btn-ghost:hover { background: #484139; color: #fff; }
.quick-entries { margin: 0 0 32px; }
.section-title { font-size: 14px; padding-left: 0; margin-bottom: 16px; }
.section-title::before, .card-title::before, .task-card-head h4::before { content: none; }
.entry-grid { gap: 12px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.entry-card-3d { perspective: none; }
.entry-inner { min-height: 100px; padding: 20px; gap: 14px; }
.entry-icon { width: 38px; height: 38px; background: var(--surface2); color: var(--ink2); border-radius: 10px; font-weight: 500; }
.entry-card-3d:hover .entry-icon { background: var(--soft); color: var(--deep); }
.entry-info h4 { font-size: 14px; font-weight: 500; margin-bottom: 5px; }
.entry-info p { font-size: 11px; }
.entry-badge { border: 0; padding: 0; background: transparent; font-size: 10px; }
.home-grid { grid-template-columns: minmax(0, 1.55fr) minmax(280px, 1fr); gap: 24px; margin-bottom: 0; }
.home-col { gap: 20px; }
.info-card, .task-card, .progress-card, .radar-card { padding: 24px; box-shadow: none; }
.card-head-row { gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.card-title, .task-card-head h4 { padding-left: 0; font-size: 14px; font-weight: 500; }
.card-hint { font-size: 11px; }
.task-card-head { margin-bottom: 16px; }
.task-empty { padding: 16px 0; text-align: left; }
.week-bars { height: 116px; gap: 14px; }
.week-bar { width: 36%; border-radius: 3px 3px 0 0; }
.advice-text { font-size: 13px; line-height: 1.9; }
.progress-header > span:first-child { font-size: 14px; font-weight: 500; }
.progress-percent { font-size: 28px; font-weight: 500; color: var(--ink); }
.progress-stats { margin-top: 18px; gap: 0; }
.stat-item { border: 0; border-right: 1px solid var(--line); border-radius: 0; background: transparent; padding: 4px 6px; }
.stat-item:last-child { border-right: 0; }
.stat-value { font-size: 19px; font-weight: 500; margin-bottom: 7px; }
.radar-svg { max-width: 210px; }
.practice-header, .progress-header-section { margin-bottom: 24px; }
.practice-header h2, .exam-header h2, .progress-header-section h2 { font-size: 28px; font-weight: 500; }
.practice-list { gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.practice-item { padding: 22px; border-left-width: 1px; }
.practice-item.wrong { border-left-width: 3px; }
.practice-item.done { border-left-width: 3px; }
.practice-item:hover { box-shadow: none; }
.practice-item-title { font-weight: 500; }
.practice-item-tags { flex-wrap: wrap; justify-content: flex-end; }
.practice-item-preview { -webkit-line-clamp: unset; display: block; overflow: visible; }
.pi-chip { border: 0; padding: 2px 0; background: transparent; }
.exam-grid, .exam-grid-inner, .exam-mock-row, .report-grid { gap: 20px; }
.exam-card, .report-card { padding: 24px; box-shadow: none; }
.exam-title { line-height: 1.6; font-weight: 500; }
.exam-year-title { border-left: 0; padding-left: 0; margin-bottom: 16px; }
.exam-card-mock { background: var(--surface); }
.chat-fab { width: 52px; height: 52px; box-shadow: 0 4px 16px #302c271a; }
.fab-dot { background: var(--ok); width: 8px; height: 8px; }
.chat-header { background: var(--surface); }
.chat-input { min-width: 0; }

/* Login and staff consoles use the same quiet surfaces and spacing. */
body.login-body { padding: 40px; }
body.login-body::before, body.login-body::after,
.login-brand::before, .login-brand::after { content: none; }
.login-shell { max-width: 1060px; box-shadow: none; border-radius: 20px; }
.login-brand { background: #302c27; border-right: 0; padding: 48px 40px; }
.brand-title { color: #fff; font-weight: 500; letter-spacing: 6px; margin-top: 36px; }
.brand-en { color: #c3b6a6; letter-spacing: 1.6px; }
.brand-slogan { color: #e5ddd3; font-size: 14px; line-height: 2.1; }
.brand-point { color: #d3c8bc; font-size: 12px; }
.brand-point i { background: transparent; color: #eab68e; border: 1px solid #686056; }
.brand-foot { color: #c3b6a6; font-size: 10px; }
.login-panel { padding: 44px 40px; }
.panel-eyebrow { color: var(--muted); letter-spacing: 2px; }
.panel-title { font-size: 25px; font-weight: 500; }
.panel-sub { line-height: 1.8; }
.role-grid { gap: 8px; }
.role-card { box-shadow: none; border-radius: 10px; }
.role-card.active { box-shadow: none; }
.role-icon { background: var(--surface2); color: var(--ink2); }
.role-name { font-weight: 500; }
.login-hint { background: transparent; border: 0; border-top: 1px solid var(--line); border-radius: 0; padding: 16px 0 0; line-height: 1.9; }
.register-mode .role-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.register-mode .role-card[data-role="admin"] { display: none; }
.register-mode .username-field { display: none; }
.register-mode .register-extra { display: grid; }
.register-mode .agreement-field { display: flex; grid-column: 1 / -1; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.agreement-field input { accent-color: var(--primary); }
.register-phone-fields { display: none; }
.register-mode .register-phone-fields, .forgot-mode .register-phone-fields { display: block; }
.phone-input { display: flex; align-items: center; height: 44px; padding: 0 12px; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.phone-input:focus-within { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(222,117,48,.12); }
.phone-input > span { color: var(--muted); font-size: 13px; }
.phone-input input { flex: 1; min-width: 0; height: 42px; padding: 0; border: 0; box-shadow: none; background: transparent; }
.phone-input input:focus { border: 0; box-shadow: none; }
.code-row { display: flex; align-items: center; gap: 10px; }
.code-row input { flex: 1 1 auto; min-width: 0; height: 44px; }
.code-row button { flex: 0 0 104px; width: 104px; height: 44px; white-space: nowrap; border: 1px solid var(--primary); border-radius: 10px; color: var(--primary); background: var(--surface); font-size: 12.5px; }
.code-row button:disabled { background: var(--surface2); color: var(--muted); border-color: var(--line); cursor: not-allowed; }
.field-error { margin-top: 6px; color: var(--bad); font-size: 12px; line-height: 1.5; }
.field-error:empty { display: none; }
.phone-field { margin-bottom: 14px; }
.field input.invalid, .phone-input:has(input.invalid) { border-color: var(--bad); }
.password-field[hidden] { display: none; }
.register-mode .password-field { grid-column: 1 / -1; }
.register-mode .register-phone-fields { grid-column: 1 / -1; }
#smsRow { display: none; }
.register-mode #smsRow, .forgot-mode #smsRow { display: block; }
.register-mode #pwdRow, .forgot-mode #pwdRow { display: block; }
.forgot-mode #pwdRow label { color: var(--ink2); }
.forgot-mode .username-field { display: none; }
.forgot-mode .register-extra:not(.register-phone-fields), .forgot-mode .agreement-field, .forgot-mode .role-grid { display: none; }
.register-mode .login-foot .reg-hint, .forgot-mode .login-foot .reg-hint { display: none; }
.register-mode #backLogin, .forgot-mode #backLogin { display: inline-block !important; }
.alt-links { display: flex; justify-content: flex-end; align-items: center; min-height: 18px; margin-top: -8px; }
.alt-links span { color: var(--muted); font-size: 11px; }
.login-panel [hidden] { display: none !important; }
.sms-mode-hint { color: var(--muted); font-size: 12px; line-height: 1.6; }
.register-mode .alt-links, .forgot-mode .alt-links { display: none; }
.register-mode .login-error, .forgot-mode .login-error { order: 5; }
.register-mode #loginBtn, .forgot-mode #loginBtn { order: 6; }
.login-panel:not(.register-mode):not(.forgot-mode) #smsRow { display: none !important; }
.login-panel:not(.register-mode) .register-extra:not(.register-phone-fields) { display: none !important; }
.work-shell { grid-template-columns: 196px minmax(0, 1fr); }
.ws-sidebar { padding: 28px 16px 20px; }
.ws-main { padding: 36px 40px 60px; }
.ws-title { font-size: 26px; font-weight: 500; }
.ws-nav-item.active::before, .card-head h3::before { content: none; }
.card-head h3 { padding-left: 0; font-weight: 500; }
.card, .stat-card { box-shadow: none; padding: 24px; }
.card { margin-bottom: 24px; }
.stat-card .v { font-size: 28px; font-weight: 500; }

/* Exercise layouts and answer controls keep their existing structure. */
.px-top { background: var(--bg); }
.px-main { max-width: 1600px; margin: auto; }
.px-col { box-shadow: none; }
.px-col-head { background: var(--surface); padding-top: 14px; padding-bottom: 14px; }
.q-block { background: var(--surface); padding: 18px; margin-bottom: 16px; }
.opt { background: var(--surface2); }

@media (max-width: 1280px) {
  .main-content { padding: 28px 28px 90px; }
  .student-topbar { padding: 0 28px; }
  .entry-inner { padding: 16px; gap: 10px; flex-wrap: wrap; }
  .entry-badge { margin-left: 48px; }
  .exam-mock-row { grid-template-columns: 1fr; }
}
@media (max-width: 1024px) {
  body.student-app { padding-left: 180px; }
  .student-side { width: 180px; align-items: stretch; padding: 24px 12px 16px; gap: 28px; }
  .side-brand { padding: 0 6px; }
  .side-brand-text, .side-user-meta { display: block; }
  .side-logout { display: block; }
  .side-nav { align-items: stretch; }
  .side-nav .nav-tab { width: auto; justify-content: flex-start; font-size: 13px; gap: 10px; padding: 10px 12px; }
  .side-user { justify-content: flex-start; }
  .home-grid { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .home-col { gap: 20px; }
  .entry-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .practice-list, .exam-grid, .exam-grid-inner, .report-grid { grid-template-columns: 1fr; }
  .topbar-right { gap: 12px; }
  .student-topbar { height: auto; min-height: 80px; padding-top: 16px; padding-bottom: 16px; flex-wrap: wrap; }
  .hero-section { padding: 30px; }
  .login-shell { grid-template-columns: 1fr; }
  .login-brand { padding: 32px; }
  .brand-title { margin-top: 20px; }
  .brand-foot { position: static; text-align: left; margin-top: 24px; }
  .work-shell { grid-template-columns: 64px minmax(0, 1fr); }
  .ws-sidebar { padding: 18px 8px; }
  .ws-main { padding: 28px 24px 50px; }
}
@media (max-width: 768px) {
  body.student-app { padding-left: 0; }
  .student-side { width: 100%; padding: 16px 20px 12px; gap: 16px; flex-direction: row; align-items: center; }
  .side-brand { padding: 0; }
  .side-sub { letter-spacing: .5px; }
  .side-nav { width: 100%; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
  .side-nav .nav-tab { justify-content: center; font-size: 12px; min-height: 42px; padding: 8px 4px; gap: 5px; white-space: nowrap; }
  .side-nav .nav-tab .nav-ico { width: 13px; font-size: 14px; }
  .side-foot { display: flex; width: 100%; flex-direction: row; align-items: center; gap: 12px; margin-top: 0; padding-top: 10px; border-top: 1px solid var(--line); }
  .side-user { flex: 1; min-width: 0; padding: 0; }
  .side-logout { width: auto; flex: none; text-align: right; }
  .student-topbar { padding: 18px 20px; gap: 14px; }
  .topbar-right { gap: 14px; }
  .main-content { padding: 24px 20px 90px; }
  .hero-section { padding: 28px 24px; margin-bottom: 26px; }
  .hero-title { font-size: 28px; letter-spacing: 0; }
  .hero-desc { font-size: 12px; line-height: 1.9; }
  .hero-actions { gap: 10px; }
  .hero-actions .btn { min-height: 42px; padding: 0 14px; font-size: 12px; }
  .quick-entries { margin-bottom: 26px; }
  .entry-grid { grid-template-columns: 1fr; gap: 10px; }
  .entry-inner { min-height: 88px; flex-wrap: nowrap; padding: 18px; }
  .entry-badge { margin-left: 0; }
  .info-card, .task-card, .progress-card, .radar-card, .exam-card, .report-card, .practice-item { padding: 20px; }
  .practice-filters { width: 100%; }
  .practice-filters select { flex: 1; min-width: 0; padding: 0 8px; font-size: 12px; }
  .practice-item-header { flex-wrap: wrap; }
  .practice-item-title { overflow-wrap: anywhere; }
  .time-range { max-width: 100%; }
  .chat-window { height: min(540px, 70dvh); }
  body.login-body { padding: 0; }
  .login-shell { border-radius: 0; }
  .login-brand { padding: 28px 24px; }
  .brand-points { grid-template-columns: 1fr; gap: 12px; }
  .brand-title { font-size: 42px; }
  .login-panel { padding: 30px 24px; }
  .role-grid { grid-template-columns: 1fr; }
  .register-mode .role-grid { grid-template-columns: 1fr; }
  .role-desc { padding-right: 24px; }
  .work-shell { grid-template-columns: minmax(0, 1fr); }
  .ws-sidebar { padding: 16px; }
  .ws-main { padding: 24px 20px 50px; }
  .card, .stat-card { padding: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
