:root {
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: #17332f;
  background: #edf5f2;
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 80% 0%, #d8eee7 0, transparent 35%), #edf5f2; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
.shell { width: min(1120px, calc(100% - 32px)); margin: 0 auto; padding: 42px 0 56px; }
.topbar { display: flex; justify-content: space-between; gap: 24px; align-items: end; margin-bottom: 26px; }
.eyebrow { color: #0f766e; font-size: 12px; letter-spacing: .16em; font-weight: 800; margin: 0 0 8px; }
h1 { margin: 0; font-size: clamp(30px, 5vw, 48px); letter-spacing: -.04em; color: #102c28; }
.subtitle { margin: 10px 0 0; color: #617773; }
.header-actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; flex-wrap: wrap; max-width: 560px; }
.user-chip { min-width: 100px; padding: 8px 12px; border-left: 2px solid #91c8bb; }
.user-chip span { display: block; color: #6b817c; font-size: 11px; }
.user-chip strong { display: block; margin-top: 2px; color: #17332f; }
.tool-button { display: inline-flex; align-items: center; min-height: 40px; border: 1px solid #9cc7bd; border-radius: 11px; padding: 9px 12px; background: rgba(255,255,255,.78); color: #17685f; text-decoration: none; font-weight: 750; font-size: 13px; }
.tool-button:hover { border-color: #0f766e; background: white; }
.tool-button.primary-tool { color: white; border-color: #0f766e; background: #0f766e; }
.tool-button.subtle { color: #667d78; border-color: #c7d8d4; }
.note-field span { display: block; margin-bottom: 7px; color: #58706c; font-size: 13px; font-weight: 700; }
input, textarea { width: 100%; border: 1px solid #c7d8d4; border-radius: 12px; background: rgba(255,255,255,.86); color: #17332f; padding: 11px 13px; outline: none; }
input:focus, textarea:focus { border-color: #0f766e; box-shadow: 0 0 0 3px rgba(15,118,110,.12); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr) 1.6fr; gap: 12px; margin-bottom: 18px; }
.stat-card, .progress-card { border: 1px solid rgba(160,190,183,.58); border-radius: 17px; background: rgba(255,255,255,.8); padding: 17px 18px; box-shadow: 0 10px 28px rgba(29,68,61,.05); }
.stat-card { text-align: left; color: #617773; transition: .18s ease; }
.stat-card strong { display: block; margin-top: 4px; font-size: 27px; color: #17332f; }
.stat-card:hover, .stat-card.active { border-color: #0f766e; transform: translateY(-1px); }
.stat-card.active { background: #e0f2ed; }
.progress-card div:first-child { display: flex; align-items: baseline; justify-content: space-between; color: #617773; }
.progress-card strong { color: #17332f; }
.progress-track { margin-top: 15px; height: 8px; border-radius: 20px; overflow: hidden; background: #dce9e6; }
.progress-track span { display: block; width: 0; height: 100%; background: linear-gradient(90deg, #0f766e, #28a692); border-radius: inherit; transition: width .35s ease; }
.group-panel { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-bottom: 18px; border: 1px solid #a9cec5; border-radius: 17px; padding: 17px 20px; background: linear-gradient(120deg, #e7f6f1, rgba(255,255,255,.86)); }
.group-panel .section-label { margin-bottom: 4px; }
.group-panel strong { margin-right: 10px; color: #0f665e; font-size: 20px; }
.group-panel > div:first-child > span { color: #687f79; font-size: 13px; }
.group-progress { min-width: 340px; text-align: right; color: #52706a; font-size: 13px; }
.group-progress .progress-track { margin-top: 9px; }
.notice { margin: 0 0 12px; border-radius: 12px; padding: 11px 15px; background: #17332f; color: white; }
.hidden { display: none !important; }
.question-card { border: 1px solid rgba(160,190,183,.55); border-radius: 24px; background: rgba(255,255,255,.94); padding: clamp(22px, 4vw, 38px); box-shadow: 0 24px 65px rgba(32,74,66,.12); }
.question-card.loading { opacity: .7; }
.card-top { display: flex; justify-content: space-between; gap: 18px; align-items: center; padding-bottom: 20px; border-bottom: 1px solid #e4eeeb; }
.badges { display: flex; gap: 8px; flex-wrap: wrap; }
.badge { display: inline-flex; border-radius: 999px; padding: 5px 10px; background: #eef5f3; color: #516d67; font-size: 12px; font-weight: 750; }
.badge.status { background: #dff2ec; color: #087064; }
.position { color: #728580; font-size: 13px; white-space: nowrap; }
.section-block { margin-top: 28px; }
.section-label { margin: 0 0 10px; color: #76908a; font-size: 12px; letter-spacing: .08em; font-weight: 800; text-transform: uppercase; }
.material { padding: 16px; margin-bottom: 14px; white-space: pre-wrap; border-left: 4px solid #b6d8d0; background: #f5faf8; border-radius: 8px 12px 12px 8px; line-height: 1.8; }
.stem { font-size: 20px; line-height: 1.75; white-space: pre-wrap; color: #102c28; font-weight: 650; }
.skeleton { color: #82938f; }
.options { display: grid; gap: 11px; }
.option { display: grid; grid-template-columns: 38px 1fr; gap: 12px; align-items: start; border: 1px solid #dbe8e5; border-radius: 14px; padding: 14px; background: #fbfdfc; line-height: 1.65; }
.option-key { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: #edf4f2; font-weight: 800; color: #52706a; }
.option.correct { border-color: #7ec7b7; background: #effaf6; }
.option.correct .option-key { color: white; background: #0f766e; }
.image-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.image-wrap { min-height: 160px; border: 1px dashed #bfd2cd; border-radius: 14px; padding: 10px; background: #f7faf9; }
.image-wrap img { width: 100%; max-height: 360px; object-fit: contain; border-radius: 9px; }
.image-link { display: block; margin-top: 8px; overflow-wrap: anywhere; color: #0f766e; font-size: 12px; }
.image-error { color: #9f3e38; font-size: 13px; padding: 30px 10px; text-align: center; }
.answer-grid { display: grid; grid-template-columns: minmax(150px, .38fr) 1.62fr; gap: 14px; margin-top: 28px; }
.answer-box, .explanation-box { border-radius: 16px; padding: 18px; background: #f3f8f6; }
.answer-box strong { font-size: 26px; color: #0f766e; }
.explanation-box div { line-height: 1.75; white-space: pre-wrap; }
.empty-copy { color: #8a9a96; font-style: italic; }
.note-field { display: block; margin-top: 24px; }
.note-field textarea { resize: vertical; min-height: 74px; }
.actions { display: grid; grid-template-columns: 1fr 1.4fr; gap: 12px; margin-top: 18px; }
.decision { border: 0; border-radius: 15px; min-height: 56px; display: flex; align-items: center; justify-content: center; gap: 12px; color: white; font-weight: 800; font-size: 16px; }
.decision:disabled { opacity: .5; cursor: not-allowed; }
.decision.danger { background: #b84a43; }
.decision.primary { background: #0f766e; }
kbd { border: 1px solid rgba(255,255,255,.45); border-radius: 5px; padding: 2px 6px; font-size: 11px; }
.pager { display: flex; justify-content: space-between; margin-top: 14px; }
.pager button { border: 1px solid #c7d8d4; border-radius: 11px; padding: 10px 16px; background: rgba(255,255,255,.75); color: #36554f; }
.pager button:disabled { opacity: .45; cursor: not-allowed; }
.empty-state { text-align: center; padding: 70px 20px; color: #647b76; }
.inline-action { display: inline-flex; margin-top: 12px; border-radius: 10px; padding: 9px 14px; background: #0f766e; color: white; text-decoration: none; font-style: normal; font-weight: 750; }
.group-progress a { color: #0f766e; font-weight: 750; }

.groups-shell { width: min(1320px, calc(100% - 32px)); }
.group-overview-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.overview-stat { border: 1px solid #c0d6d1; border-radius: 15px; padding: 15px 17px; background: rgba(255,255,255,.82); color: #637974; text-align: left; }
.overview-stat strong { display: block; margin-top: 4px; color: #17332f; font-size: 25px; }
.overview-stat.active { border-color: #0f766e; background: #e1f2ed; }
.current-group-banner { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-bottom: 18px; border-radius: 16px; padding: 16px 18px; background: #173f39; color: white; }
.current-group-banner strong, .current-group-banner span { display: block; }
.current-group-banner span { margin-top: 4px; color: #c2ddd7; font-size: 13px; }
.current-group-banner a { border-radius: 10px; padding: 9px 14px; background: white; color: #0f665e; text-decoration: none; font-weight: 800; }
.groups-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(235px, 1fr)); gap: 13px; }
.group-card { border: 1px solid #d1e0dc; border-radius: 17px; padding: 17px; background: rgba(255,255,255,.9); box-shadow: 0 8px 24px rgba(31,70,63,.05); }
.group-card.mine { border-color: #0f766e; box-shadow: 0 0 0 2px rgba(15,118,110,.1); }
.group-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.group-card-head strong { font-size: 18px; }
.group-card-head span { border-radius: 999px; padding: 4px 8px; font-size: 11px; font-weight: 800; }
.status-completed .group-card-head span { color: #18734f; background: #def3e8; }
.status-assigned .group-card-head span { color: #8a5d06; background: #fff0c9; }
.status-available .group-card-head span { color: #657873; background: #edf3f1; }
.group-card-progress { height: 7px; margin: 16px 0 8px; overflow: hidden; border-radius: 10px; background: #e4eeeb; }
.group-card-progress i { display: block; height: 100%; border-radius: inherit; background: #15947f; }
.group-card p { margin: 0; color: #5e746f; font-size: 13px; }
.group-counts { display: flex; gap: 9px; margin-top: 10px; color: #6e817d; font-size: 11px; }
.group-owner { min-height: 18px; margin: 12px 0; color: #526b65; font-size: 12px; }
.group-card button { width: 100%; min-height: 39px; border: 0; border-radius: 10px; background: #0f766e; color: white; font-weight: 750; }
.group-card button.continue { background: #18534b; }
.group-card button.takeover { background: #a06417; }
.group-card button:disabled { color: #7d8c89; background: #edf2f1; cursor: not-allowed; }
.empty-groups { grid-column: 1 / -1; padding: 70px; text-align: center; color: #748783; }

.login-page { display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 15% 20%, #d4eee7 0, transparent 32%), #edf5f2; }
.login-shell { width: min(920px, 100%); min-height: 560px; display: grid; grid-template-columns: 1.05fr .95fr; overflow: hidden; border: 1px solid rgba(143,181,172,.55); border-radius: 28px; background: rgba(255,255,255,.92); box-shadow: 0 32px 80px rgba(32,74,66,.16); }
.login-intro { display: flex; flex-direction: column; justify-content: center; padding: clamp(38px, 7vw, 72px); color: white; background: linear-gradient(145deg, #0d665e, #153f3a); }
.login-intro .eyebrow { color: #a8ded2; }
.login-intro h1 { color: white; line-height: 1.12; }
.login-intro > p:last-child { max-width: 330px; margin: 24px 0 0; color: #c7e1dc; line-height: 1.8; }
.login-card { display: flex; flex-direction: column; justify-content: center; padding: clamp(34px, 6vw, 62px); }
.login-card h2 { margin: 4px 0 8px; font-size: 28px; color: #17332f; }
.login-hint { margin: 0 0 30px; color: #6b817c; font-size: 13px; }
.login-card form label { display: block; margin: 16px 0 7px; color: #49645e; font-size: 13px; font-weight: 750; }
.login-card input { min-height: 48px; }
.login-error { margin: 13px 0 0; color: #ad3e38; font-size: 13px; }
.login-button { width: 100%; min-height: 50px; margin-top: 24px; border: 0; border-radius: 13px; background: #0f766e; color: white; font-weight: 800; }
.login-button:disabled { opacity: .6; cursor: wait; }

@media (max-width: 760px) {
  .shell { width: min(100% - 20px, 1120px); padding-top: 24px; }
  .topbar { align-items: stretch; flex-direction: column; }
  .header-actions { justify-content: flex-start; max-width: none; }
  .stats { grid-template-columns: repeat(3, 1fr); }
  .group-overview-stats { grid-template-columns: repeat(2, 1fr); }
  .group-panel { align-items: stretch; flex-direction: column; gap: 12px; }
  .group-progress { min-width: 0; text-align: left; }
  .progress-card { grid-column: 1 / -1; }
  .stat-card { padding: 13px 10px; }
  .stat-card strong { font-size: 22px; }
  .answer-grid, .actions { grid-template-columns: 1fr; }
  .stem { font-size: 18px; }
  .card-top { align-items: flex-start; }
  .login-page { padding: 12px; }
  .login-shell { grid-template-columns: 1fr; min-height: auto; }
  .login-intro { padding: 34px; }
  .login-intro h1 { font-size: 34px; }
  .login-card { padding: 34px; }
}
