:root {
  color-scheme: light;
  --bg: #f7f7fc;
  --surface: rgba(255, 255, 255, .9);
  --card: #fff;
  --text: #201d33;
  --muted: #77738b;
  --primary: #6255e7;
  --primary-dark: #4d42c3;
  --primary-soft: #efedff;
  --accent: #ff826c;
  --accent-soft: #fff0eb;
  --cyan: #49b8c8;
  --border: #e8e6f1;
  --danger: #c64040;
  --success: #16835d;
  --warning: #b46b0a;
  --shadow: 0 18px 50px rgba(60, 50, 110, .09);
  --shadow-hover: 0 24px 60px rgba(71, 58, 140, .16);
  --radius: 20px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  overflow-x: hidden;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .38;
  background-image: radial-gradient(rgba(98, 85, 231, .11) 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: linear-gradient(to bottom, #000, transparent 65%);
  z-index: -2;
}
.ambient { position: fixed; width: 360px; height: 360px; border-radius: 50%; filter: blur(2px); z-index: -1; opacity: .22; pointer-events: none; }
.ambient-one { top: -190px; right: -70px; background: radial-gradient(circle, #8b80ff, transparent 68%); }
.ambient-two { bottom: -230px; left: -120px; background: radial-gradient(circle, #ffad91, transparent 68%); }
a { color: var(--primary); text-decoration: none; transition: color .2s ease, transform .2s ease; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(2rem, 4vw, 3.1rem); line-height: 1.13; letter-spacing: -.045em; }
h2 { margin-top: 34px; font-size: 1.35rem; letter-spacing: -.02em; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: 76px;
  padding: 11px max(24px, calc((100% - 1180px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: rgba(250, 250, 254, .82);
  border-bottom: 1px solid rgba(226, 223, 238, .85);
  backdrop-filter: blur(18px) saturate(140%);
}
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--text); flex: 0 0 auto; }
.brand:hover { color: var(--text); transform: translateY(-1px); }
.brand-mark {
  width: 44px; height: 44px; display: grid; place-items: center; border-radius: 15px;
  color: #fff; font-weight: 900; font-size: 1.25rem;
  background: linear-gradient(145deg, #7769f2 10%, #5749d4 62%, #4638b6);
  box-shadow: 0 10px 24px rgba(98, 85, 231, .3), inset 0 1px rgba(255,255,255,.35);
}
.brand-copy { display: flex; flex-direction: column; line-height: 1.05; }
.brand-copy strong { font-size: 1.22rem; letter-spacing: .06em; }
.brand-copy small { margin-top: 5px; color: var(--muted); font-size: .63rem; letter-spacing: .1em; }
.main-nav { display: flex; gap: 5px; align-items: center; }
.nav-link, .link-button { color: #5f5a72; padding: 8px 11px; border-radius: 10px; font-weight: 650; font-size: .92rem; }
.nav-link:hover, .link-button:hover { color: var(--primary); background: var(--primary-soft); }
.nav-secondary { font-weight: 500; color: var(--muted); }
.user-chip { display: inline-flex; align-items: center; gap: 8px; margin-left: 8px; padding: 5px 10px 5px 5px; border: 1px solid var(--border); border-radius: 999px; background: rgba(255,255,255,.78); font-size: .9rem; }
.avatar { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; color: #fff; font-weight: 800; background: linear-gradient(145deg, var(--accent), #ef6654); }

.container { width: min(1180px, calc(100% - 40px)); margin: 44px auto; min-height: calc(100vh - 210px); }
.site-footer { padding: 24px 20px 36px; text-align: center; color: #9691a6; font-size: .84rem; }
.site-footer span { color: var(--primary); font-weight: 800; }
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.page-header h1 { margin-bottom: 7px; }
.eyebrow { margin-bottom: 8px; color: var(--primary); font-size: .77rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }

.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(28px, 5vw, 54px);
  border-radius: 30px;
  color: #fff;
  background: linear-gradient(132deg, #5a4dd5 0%, #6d5feb 52%, #8173f0 100%);
  box-shadow: 0 30px 80px rgba(82, 68, 180, .25);
}
.hero::after { content: ""; position: absolute; width: 360px; height: 360px; right: -90px; top: -150px; border-radius: 50%; border: 70px solid rgba(255,255,255,.09); }
.hero::before { content: "↗"; position: absolute; right: 8%; bottom: -40px; font-size: 13rem; font-weight: 900; line-height: 1; color: rgba(255,255,255,.06); transform: rotate(-6deg); }
.hero-content { position: relative; z-index: 1; max-width: 690px; }
.hero .eyebrow { color: #dcd8ff; }
.hero h1 { margin-bottom: 14px; }
.hero p { color: rgba(255,255,255,.82); font-size: 1.06rem; }
.hero .button { border-color: transparent; }
.hero .button.primary { color: var(--primary-dark); background: #fff; box-shadow: 0 10px 25px rgba(37,24,100,.18); }
.hero .button.ghost { color: #fff; border-color: rgba(255,255,255,.35); background: rgba(255,255,255,.1); }

.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 18px 0 42px; }
.stat-card { display: flex; align-items: center; gap: 15px; padding: 19px; border: 1px solid var(--border); border-radius: 18px; background: rgba(255,255,255,.86); box-shadow: 0 8px 25px rgba(50,42,90,.04); }
.stat-icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 14px; background: var(--primary-soft); color: var(--primary); font-size: 1.15rem; font-weight: 900; }
.stat-card:nth-child(2) .stat-icon { color: #d66750; background: var(--accent-soft); }
.stat-card:nth-child(3) .stat-icon { color: #238997; background: #e7f8fa; }
.stat-value { display: block; font-size: 1.45rem; font-weight: 850; line-height: 1.1; }
.stat-label { color: var(--muted); font-size: .84rem; }

.card { background: var(--surface); border: 1px solid rgba(228,225,239,.94); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); backdrop-filter: blur(12px); }
.narrow { max-width: 520px; margin: 70px auto; }
.card.soft { background: rgba(255,255,255,.65); box-shadow: none; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 17px; }
.card-link { position: relative; color: var(--text); display: flex; flex-direction: column; gap: 12px; min-height: 150px; transition: transform .23s ease, box-shadow .23s ease, border-color .23s ease; }
.card-link::after { content: "→"; position: absolute; right: 20px; bottom: 17px; color: var(--primary); font-size: 1.2rem; transition: transform .2s ease; }
.card-link:hover { color: var(--text); transform: translateY(-4px); box-shadow: var(--shadow-hover); border-color: #d8d3f4; }
.card-link:hover::after { transform: translateX(4px); }
.card-link strong { padding-right: 24px; font-size: 1.08rem; }
.card-link span, .muted { color: var(--muted); }
.card-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; color: var(--primary); background: var(--primary-soft); font-size: 1.1rem; font-weight: 900; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 22px; }
.actions { display: flex; align-items: center; gap: 10px; margin: 20px 0 28px; flex-wrap: wrap; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 38px; margin-bottom: 15px; }
.section-heading h2 { margin: 0; }

label { display: flex; flex-direction: column; gap: 7px; color: #464158; font-weight: 700; font-size: .91rem; }
input, select, textarea, button, .button { font: inherit; border: 1px solid var(--border); border-radius: 12px; padding: 11px 14px; background: #fff; color: var(--text); transition: border .2s ease, box-shadow .2s ease, transform .2s ease, background .2s ease; }
input:focus, select:focus, textarea:focus { outline: none; border-color: #a59cf1; box-shadow: 0 0 0 4px rgba(98,85,231,.1); }
textarea { min-height: 105px; resize: vertical; }
button, .button { cursor: pointer; display: inline-flex; justify-content: center; align-items: center; gap: 7px; font-weight: 750; }
button:hover, .button:hover { transform: translateY(-1px); border-color: #cfc9ec; }
.primary { border-color: var(--primary); color: #fff; background: linear-gradient(135deg, #6c5ee9, #5548d0); box-shadow: 0 8px 18px rgba(98,85,231,.2); }
.primary:hover { color: #fff; background: linear-gradient(135deg, #7568ed, #4c3fc2); box-shadow: 0 10px 24px rgba(98,85,231,.3); }
.ghost { background: transparent; }
button:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.danger { color: var(--danger); }
.inline { display: inline; }
.link-button { border: 0; background: none; box-shadow: none; }

.alert { border: 1px solid #e4e1ed; border-left: 4px solid var(--primary); border-radius: 14px; padding: 14px 17px; margin-bottom: 18px; background: #f5f3ff; }
.alert.error { color: var(--danger); border-color: #f2cac5; border-left-color: var(--danger); background: #fff0ee; }
.alert.success { color: var(--success); border-color: #bee7d7; border-left-color: var(--success); background: #eaf9f3; }
.badge { display: inline-flex; align-items: center; width: fit-content; gap: 5px; padding: 4px 10px; border-radius: 999px; color: #615b73; background: #f0eef5; font-size: .76rem; font-weight: 750; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #aaa4b9; }
.badge.done, .badge.graded { color: var(--success); background: #e2f6ed; }
.badge.done::before, .badge.graded::before { background: var(--success); }
.badge.in_progress { color: var(--primary); background: var(--primary-soft); }
.badge.in_progress::before { background: var(--primary); }
.badge.review_pending, .badge.self_review { color: var(--warning); background: #fff4df; }
.badge.review_pending::before, .badge.self_review::before { background: var(--warning); }

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 17px; background: rgba(255,255,255,.8); box-shadow: 0 8px 25px rgba(48,40,85,.04); }
table { width: 100%; border-collapse: collapse; background: transparent; }
th, td { text-align: left; padding: 14px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { color: var(--muted); background: rgba(247,246,251,.75); font-size: .78rem; letter-spacing: .04em; text-transform: uppercase; }
tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .18s ease; }
tbody tr:hover { background: #faf9ff; }

.question { position: relative; margin: 18px 0; padding: 28px; }
.question h2 { margin: 0 0 20px; font-size: 1.15rem; }
.question-number { display: inline-grid; place-items: center; min-width: 34px; height: 34px; margin-right: 8px; border-radius: 11px; color: var(--primary); background: var(--primary-soft); font-size: .9rem; }
.options { display: flex; flex-direction: column; gap: 10px; margin: 12px 0; }
.options label { flex-direction: row; align-items: center; padding: 13px 15px; border: 1px solid var(--border); border-radius: 13px; background: #fbfbfe; font-weight: 550; cursor: pointer; }
.options label:hover { border-color: #c7c0f1; background: #f7f5ff; }
.options input { width: 18px; height: 18px; padding: 0; accent-color: var(--primary); box-shadow: none; }
.progress-shell { height: 9px; margin: 12px 0 28px; overflow: hidden; border-radius: 99px; background: #e9e6f2; }
.question-select { flex-direction: row; align-items: center; gap: 13px; padding: 13px 15px; border: 1px solid var(--border); border-radius: 14px; background: #fbfbfe; cursor: pointer; }
.question-select:hover { border-color: #c7c0f1; background: #f7f5ff; }
.question-select input { width: 18px; height: 18px; padding: 0; accent-color: var(--primary); }
.question-select span { display: flex; flex-direction: column; gap: 2px; }
.question-select small { color: var(--muted); font-weight: 500; }
.field-hint { color: var(--muted); font-weight: 500; font-size: .76rem; }
.admin-grid { grid-template-columns: minmax(320px, .8fr) minmax(380px, 1.2fr); align-items: start; }
.account-list { display: flex; flex-direction: column; }
.account-item { display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.account-item:last-child { border-bottom: 0; }
.account-item > div { display: flex; flex-direction: column; }
.account-item > div span { color: var(--muted); font-size: .82rem; }
.registration-setting { margin-bottom: 18px; }
.registration-setting h2 { margin: 10px 0 4px; }
.danger-button { color: var(--danger); border-color: #efc5c1; background: #fff2f0; }
.account-panel { min-width: 0; }
.account-item-managed { grid-template-columns: 42px minmax(0, 1fr) auto; align-items: start; }
.account-main { min-width: 0; }
.account-actions { display: flex; align-items: center; gap: 10px; margin-top: 7px; }
.account-actions form { margin: 0; }
.mini-button { padding: 4px 8px; border-radius: 8px; color: var(--primary); background: #f7f5ff; font-size: .75rem; font-weight: 700; }
.danger-text { color: var(--danger); background: #fff3f1; }
.success-text { color: var(--success); background: #eaf9f3; }
.account-actions details { position: relative; }
.account-actions summary { color: var(--primary); font-size: .76rem; font-weight: 700; cursor: pointer; list-style: none; }
.password-reset-form { position: absolute; right: 0; top: 28px; z-index: 4; width: 250px; display: flex; flex-direction: column; gap: 8px; padding: 13px; border: 1px solid var(--border); border-radius: 13px; background: #fff; box-shadow: var(--shadow-hover); }
.password-reset-form input { width: 100%; padding: 8px 10px; font-size: .82rem; }
.register-link { margin: 18px 0 0; text-align: center; color: var(--muted); font-size: .9rem; }
.registration-card { margin-top: 45px; }
.progress-bar { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--primary), #8b7cf4, var(--accent)); }
.score-panel { display: flex; align-items: center; gap: 22px; margin-bottom: 28px; padding: 25px; border-radius: 22px; color: #fff; background: linear-gradient(135deg, #5548ce, #7769ec); box-shadow: 0 20px 45px rgba(83,69,190,.22); }
.score { margin: 0; font-size: 2.4rem; font-weight: 900; letter-spacing: -.05em; }
.score-panel p { margin: 0; color: rgba(255,255,255,.78); }

.empty-state { padding: 45px 24px; text-align: center; border: 1px dashed #cec9df; border-radius: var(--radius); color: var(--muted); background: rgba(255,255,255,.45); }
.empty-icon { width: 54px; height: 54px; margin: 0 auto 12px; display: grid; place-items: center; border-radius: 17px; color: var(--primary); background: var(--primary-soft); font-size: 1.35rem; }
.login-layout { display: grid; grid-template-columns: 1fr 440px; min-height: 600px; overflow: hidden; padding: 0; }
.login-story { position: relative; display: flex; flex-direction: column; justify-content: flex-end; padding: 52px; color: #fff; background: linear-gradient(145deg, #4f43c3, #7565ec 58%, #8c7cf2); }
.login-story::before { content: "知"; position: absolute; top: -85px; right: -20px; color: rgba(255,255,255,.07); font-size: 24rem; font-weight: 900; line-height: 1; }
.login-story h1 { position: relative; max-width: 560px; }
.login-story p { position: relative; max-width: 500px; color: rgba(255,255,255,.75); }
.login-form { display: flex; flex-direction: column; justify-content: center; padding: 48px; background: rgba(255,255,255,.95); }
.login-form h2 { margin: 0 0 7px; font-size: 1.8rem; }
.login-form .primary { width: 100%; margin-top: 8px; padding: 12px; }
.login-mini-brand { display: none; margin-bottom: 32px; align-items: center; gap: 10px; }

@media (max-width: 820px) {
  .site-header { position: relative; align-items: flex-start; flex-direction: column; padding: 12px 18px; }
  .main-nav { width: 100%; overflow-x: auto; padding-bottom: 3px; }
  .user-chip span:last-child, .nav-secondary { display: none; }
  .user-chip { margin-left: auto; }
  .container { width: min(100% - 28px, 1180px); margin-top: 28px; }
  .hero { border-radius: 23px; }
  .stat-grid { grid-template-columns: 1fr; }
  .login-layout { grid-template-columns: 1fr; min-height: auto; }
  .admin-grid { grid-template-columns: 1fr; }
  .login-story { display: none; }
  .login-form { padding: 34px 24px; }
  .login-mini-brand { display: flex; }
}
@media (max-width: 600px) {
  h1 { font-size: 2rem; }
  .page-header, .row-between { align-items: flex-start; flex-direction: column; }
  .page-header .button { width: 100%; }
  .card { padding: 19px; border-radius: 17px; }
  .grid { grid-template-columns: 1fr; }
  .hero .actions .button { flex: 1; }
  .question { padding: 20px; }
  .score-panel { align-items: flex-start; flex-direction: column; gap: 4px; }
  .site-footer { padding-bottom: 28px; }
}
