:root {
  --red: #c41e3a;
  --red-dark: #8a1428;
  --gold: #d4a84b;
  --ink: #2c2c2c;
  --muted: #5c564e;
  --line: #e5dfd5;
  --paper: #f7f4ef;
  --card: #fff;
  --pass: #2e7d32;
  --fail: #c62828;
  --serif: "Noto Serif SC", "Songti SC", serif;
  --sans: "Noto Sans SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background:
    radial-gradient(circle at 8% -10%, rgba(196, 30, 58, 0.08), transparent 32%),
    linear-gradient(180deg, #fbf8f3 0%, var(--paper) 40%, #f3eee6 100%);
  font-size: 16px;
  line-height: 1.65;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: 16px; }
button { cursor: pointer; }

.transition-mask {
  position: fixed;
  inset: 0;
  z-index: 80;
  pointer-events: none;
  background:
    radial-gradient(circle at 30% 40%, rgba(255,255,255,.72), transparent 42%),
    radial-gradient(circle at 70% 55%, rgba(255,244,220,.45), transparent 48%),
    rgba(255, 250, 245, .55);
  opacity: 0;
  filter: blur(0);
  transform: scale(1);
  transition: opacity .28s ease, filter .28s ease, transform .28s ease;
}
body.fog-in .transition-mask {
  opacity: 1;
  filter: blur(10px);
  transform: scale(1.02);
}
body.fog-out .transition-mask {
  opacity: 0;
  filter: blur(18px);
  transform: scale(1.06);
}

.page-stage { min-height: 100vh; }
body.fog-out .page-stage {
  animation: pageRise .28s ease both;
}
@keyframes pageRise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.wide { width: min(1840px, 96vw); margin: 0 auto; }
.page-pad { padding: 28px 0 72px; }
.split { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 28px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 22px; min-width: 0; }

.site-banner {
  position: sticky;
  top: 0;
  z-index: 20;
  color: #fff;
  background:
    linear-gradient(110deg, rgba(255,255,255,.16), transparent 28%),
    linear-gradient(135deg, #9b1830 0%, var(--red) 48%, #a01630 100%);
  box-shadow: 0 12px 30px rgba(138, 20, 40, .28);
  overflow: hidden;
}
.site-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.28) 48%, transparent 62%);
  transform: translateX(-120%);
  animation: bannerSweep 4.8s ease-in-out infinite;
  pointer-events: none;
}
@keyframes bannerSweep { 0%, 55% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }
.banner-row {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) auto auto;
  gap: 28px;
  align-items: center;
  padding: 18px 0 16px;
}
.brand { display: flex; align-items: center; gap: 18px; min-width: 0; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.banner-title, .banner-sub {
  display: block;
  font-family: var(--serif);
  white-space: nowrap;
}
.banner-title {
  font-size: clamp(16px, 1.15vw, 24px);
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1.2;
  color: rgba(255,255,255,.95);
  animation: pulseGlow 2.8s ease-in-out infinite;
}
.banner-sub {
  margin-top: 4px;
  font-size: clamp(26px, 2.15vw, 46px);
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.15;
  background: linear-gradient(90deg, #fff 0%, #fff 40%, #ffe7a3 50%, #fff 60%, #fff 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shine 4.2s linear infinite;
  filter: drop-shadow(0 6px 12px rgba(0,0,0,.2));
}
@keyframes shine { to { background-position: 220% center; } }
@keyframes pulseGlow {
  0%, 100% { text-shadow: 0 0 0 rgba(255, 231, 163, 0); }
  50% { text-shadow: 0 0 18px rgba(255, 231, 163, .85); }
}
.brand-badge-wrap {
  width: 64px;
  height: 64px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0,0,0,.18);
  line-height: 0;
}
.brand-badge {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
  background: #fff;
}
.top-nav, .userbox { display: flex; align-items: center; gap: 10px; }
.top-nav a, .ghost-btn {
  color: #fff;
  border: 1px solid rgba(255,255,255,.35);
  background: rgba(255,255,255,.12);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 15px;
}
.top-nav a.active, .ghost-btn:hover, .top-nav a:hover { background: #fff; color: var(--red); }
.avatar {
  width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255,255,255,.2);
  border: 2px solid rgba(255,255,255,.55);
  font-weight: 700;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #8a1428 0%, #c41e3a 55%, #a01630 100%);
  padding: 48px 2vw 40px;
}
.login-art { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .28; }
.gear-float {
  position: absolute;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.55);
  pointer-events: none;
}
.gear-float::before, .gear-float::after {
  content: "";
  position: absolute;
  background: rgba(255,255,255,.7);
}
.gear-one { width: 160px; height: 160px; left: 2vw; top: 6vh; opacity: .55; animation: spin 16s linear infinite; }
.gear-two { width: 220px; height: 220px; right: 2vw; bottom: 6vh; opacity: .45; animation: spin 22s linear infinite reverse; }
.gear-one::before, .gear-two::before { width: 18px; height: 46px; left: 50%; top: -28px; transform: translateX(-50%); box-shadow: 0 190px 0 rgba(255,255,255,.7), 80px 40px 0 rgba(255,255,255,.7), -80px 40px 0 rgba(255,255,255,.7); }
.gear-one::after, .gear-two::after { inset: 34%; border-radius: 50%; border: 2px solid rgba(255,255,255,.8); background: transparent; }
@keyframes spin { to { transform: rotate(360deg); } }
.login-panel { position: relative; z-index: 1; width: min(1760px, 96vw); text-align: center; }
.hero-copy { display: flex; flex-direction: column; align-items: center; }
.college-badge-wrap {
  width: 178px;
  height: 178px;
  margin: 0 auto 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 12px 28px rgba(0,0,0,.24);
  display: block;
  overflow: hidden;
  flex: 0 0 auto;
  line-height: 0;
}
.college-badge {
  width: 100%;
  height: 100%;
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  object-fit: cover;
  object-position: center;
  background: #fff;
}
.hero-title, .hero-sub { margin: 0; width: 100%; }
.hero-title { display: block; }
.hero-title span, .hero-sub span { white-space: nowrap; }
.hero-title span {
  display: inline-block;
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(28px, 3.1vw, 58px);
  letter-spacing: 0.12em;
  line-height: 1.25;
  color: rgba(255,255,255,.95);
  animation: rise .8s ease both, pulseGlow 2.6s ease-in-out infinite;
}
.hero-sub span {
  display: inline-block;
  margin-top: 10px;
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(48px, 5.2vw, 100px);
  letter-spacing: 0.04em;
  line-height: 1.15;
  background: linear-gradient(100deg, #fff 0%, #fff 36%, #ffe7a8 50%, #fff 64%, #fff 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shine 3.6s linear infinite, rise 1s .1s ease both;
  filter: drop-shadow(0 12px 18px rgba(0,0,0,.28));
}
.hero-line {
  width: 0;
  height: 3px;
  margin: 22px auto 8px;
  background: linear-gradient(90deg, transparent, #ffe7a8, transparent);
  animation: lineGrow 1.1s .2s ease forwards;
}
@keyframes lineGrow { to { width: min(720px, 70%); } }
@keyframes rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
.role-stage { margin-top: 36px; }
.role-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  animation: rise .55s ease both;
}
.role-grid.is-hidden { display: none; }
.role-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
  min-height: 210px;
  padding: 36px 34px;
  border: 0;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 18px 40px rgba(0,0,0,.18);
  transition: transform .25s ease, box-shadow .25s ease;
}
.role-card:hover { transform: translateY(-8px) scale(1.01); box-shadow: 0 24px 50px rgba(0,0,0,.28); }
.role-card strong { font-family: var(--serif); font-size: 40px; color: var(--red); }
.role-card span { margin-top: 12px; color: var(--muted); font-size: 18px; line-height: 1.7; max-width: 92%; }
.role-card em { margin-top: 18px; color: var(--red); font-style: normal; font-weight: 700; }
.back-link {
  grid-column: 1 / -1;
  justify-self: center;
  background: none; border: 0; color: rgba(255,255,255,.9);
  text-decoration: underline; font-size: 16px;
}
.login-note { color: rgba(255,255,255,.72); margin-top: 26px; letter-spacing: .12em; }

.side-nav {
  position: sticky; top: 150px;
  background: var(--card);
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 8px 24px rgba(80, 40, 20, .06);
  display: flex; flex-direction: column; gap: 8px;
}
.side-nav a {
  padding: 14px 16px;
  border-radius: 12px;
  color: var(--muted);
  font-weight: 600;
}
.side-nav a.on, .side-nav a:hover { background: var(--red); color: #fff; }

.panel, .hero-card {
  background: var(--card);
  border-radius: 18px;
  padding: 26px 28px;
  box-shadow: 0 10px 30px rgba(80, 40, 20, .06);
}
.panel-head, .hero-card, .filter, .review-top {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.panel-head { margin-bottom: 18px; }
.panel-head h2, .hero-card h2 { margin: 0; font-family: var(--serif); font-size: 28px; }
.panel-head small, .meta-line { color: var(--muted); font-weight: 500; font-size: 15px; }
.hero-card { margin-bottom: 22px; }
.who { display: flex; gap: 18px; align-items: center; }
.who-avatar, .who-avatar.sm {
  width: 84px; height: 84px; border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(145deg, var(--red), #e35b70);
  color: #fff; font-family: var(--serif); font-size: 34px; font-weight: 700;
}
.who-avatar.sm { width: 46px; height: 46px; font-size: 18px; }
.meta-line { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 8px; }
.tag {
  display: inline-block; margin-left: 8px; padding: 2px 10px;
  border-radius: 999px; font-size: 13px; vertical-align: middle;
  background: #f3e6ea; color: var(--red);
}
.tag.postgrad { background: #e7eef8; color: #1565c0; }
.seg { display: flex; background: #f3eee6; border-radius: 12px; padding: 4px; gap: 4px; }
.seg button, .seg label {
  border: 0; background: transparent; border-radius: 10px; padding: 10px 18px;
}
.seg button.on, .seg label:has(input:checked) { background: #fff; color: var(--red); font-weight: 700; box-shadow: 0 2px 8px rgba(0,0,0,.06); }

.metric-grid, .card-grid { display: grid; gap: 18px; }
.metric-grid { grid-template-columns: repeat(4, 1fr); margin-bottom: 22px; }
.metric-grid article, .cat-card, .act-card, .branch-card {
  background: var(--card); border-radius: 16px; padding: 22px 20px;
  box-shadow: 0 8px 24px rgba(80, 40, 20, .05);
}
.metric-grid strong { display: block; font-family: var(--serif); font-size: 42px; line-height: 1; }
.metric-grid strong small { font-size: 18px; color: #8a847c; }
.metric-grid span, .act-card p, .branch-card em, .cat-card em { color: var(--muted); }
.metric-grid .gold strong { color: #b8860b; }
.metric-grid .green strong { color: var(--pass); }
.metric-grid .red strong { color: var(--fail); }
.metric-grid.compact { margin: 0 0 22px; }
.card-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.card-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.card-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.cat-card, .act-card, .branch-card {
  display: flex; flex-direction: column; gap: 10px; min-height: 150px;
  border: 1px solid transparent; transition: transform .22s ease, border-color .22s ease;
}
.cat-card { border-top: 5px solid var(--accent, var(--red)); }
.cat-card strong, .act-card strong, .branch-card strong { font-size: 22px; font-family: var(--serif); }
.cat-card:hover, .act-card:hover, .branch-card:hover { transform: translateY(-6px); border-color: var(--red); }

.milestone-track {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; position: relative;
}
.milestone { text-align: center; position: relative; }
.milestone-date { font-size: 13px; color: var(--muted); min-height: 22px; }
.milestone-dot {
  width: 18px; height: 18px; margin: 10px auto; border-radius: 50%;
  background: #ddd; position: relative; z-index: 1;
}
.milestone.done .milestone-dot { background: var(--pass); }
.milestone.current .milestone-dot { background: var(--red); box-shadow: 0 0 0 6px rgba(196,30,58,.15); animation: pulseGlow 1.8s infinite; }
.milestone-title { font-weight: 700; font-size: 15px; }
.milestone-track::before {
  content: ""; position: absolute; left: 6%; right: 6%; top: 40px; height: 3px; background: #eadfce;
}

.phase { border: 1px solid var(--line); border-radius: 14px; margin-bottom: 12px; overflow: hidden; background: #fff; }
.phase.is-current { border-color: var(--red); background: #fff8f6; }
.phase summary { display: flex; gap: 14px; align-items: center; padding: 16px 18px; cursor: pointer; list-style: none; }
.phase summary::-webkit-details-marker { display: none; }
.phase summary strong { font-size: 18px; }
.phase summary small { display: block; color: var(--muted); }
.phase summary em { margin-left: 8px; font-style: normal; font-size: 12px; background: var(--red); color: #fff; border-radius: 999px; padding: 2px 8px; }
.phase-badge, .node-dot {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: #cfc6ba; color: #fff; font-weight: 700; flex: 0 0 auto;
}
.phase.is-current .phase-badge { background: var(--red); }
.node-row { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 14px; padding: 14px 18px; border-top: 1px solid var(--line); }
.node-row.completed .node-dot { background: var(--pass); }
.node-row.current .node-dot { background: var(--red); }
.node-row p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.node-row time { color: var(--muted); white-space: nowrap; }
.phase-body.open .node-row:first-child { border-top: 0; }

.stat-pills, .chips, .notice-flags { display: flex; gap: 8px; flex-wrap: wrap; }
.pill, .status-tag {
  border-radius: 999px; padding: 4px 10px; font-size: 13px; font-weight: 700;
}
.pill.pass, .status-tag.completed { background: #e8f5e9; color: var(--pass); }
.pill.fail, .status-tag.ongoing { background: #ffebf0; color: var(--fail); }
.pill.pending, .status-tag.upcoming { background: #f3f3f3; color: #777; }
.pill.gold, .status-tag.signup { background: #fff4dc; color: #9a6b00; }
.material-row, .notice-item, .review-row, .review-block {
  display: flex; justify-content: space-between; gap: 16px; align-items: center;
  padding: 14px 0; border-bottom: 1px solid var(--line);
}
.material-row p, .notice-item p, .issue { margin: 4px 0 0; color: var(--fail); }
.material-index { width: 36px; font-weight: 700; color: var(--red); }
.material-main { flex: 1; }
.material-status { font-weight: 700; }
.material-row.pass .material-status { color: var(--pass); }
.material-row.fail .material-status { color: var(--fail); }
.material-row.pending .material-status { color: #888; }

.info-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 20px; }
.info-grid div { background: #faf7f2; border-radius: 12px; padding: 14px 16px; }
.info-grid span { display: block; color: var(--muted); font-size: 13px; }
.data { width: 100%; border-collapse: collapse; }
.data th, .data td { text-align: left; padding: 14px 10px; border-bottom: 1px solid var(--line); }
.data th { color: var(--muted); font-weight: 600; }
.person { display: flex; gap: 12px; align-items: center; }
.person small { display: block; color: var(--muted); }
.linkish { color: var(--red); }
.empty { color: var(--muted); padding: 12px 0; }

.notice-item { color: inherit; }
.notice-item:hover strong { color: var(--red); }
.article { font-size: 17px; }
.lead { font-size: 16px; color: var(--muted); }
.bar { height: 8px; background: #f0e7dc; border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--red), var(--gold)); }
.bar.lg { height: 12px; margin: 12px 0 18px; }
.form, .publish { display: flex; flex-direction: column; gap: 12px; }
.form label { display: flex; flex-direction: column; gap: 6px; color: var(--muted); }
input[type="text"], input[type="search"], select, textarea {
  width: 100%; padding: 12px 14px; border: 1px solid #d9d0c4; border-radius: 10px; background: #fff;
}
.filter { margin-bottom: 16px; }
.filter > * { min-width: 180px; }
.primary, .danger, .text-btn {
  border: 0; border-radius: 10px; padding: 10px 18px; font-weight: 700;
}
.primary { background: var(--red); color: #fff; display: inline-flex; align-items: center; }
.primary.sm { padding: 8px 14px; }
.danger { background: #fff; color: var(--fail); border: 1px solid #f3c1c1; }
.text-btn { background: none; color: var(--muted); padding: 0; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.tabs a { padding: 12px 18px; border-radius: 12px 12px 0 0; background: #efe8de; font-weight: 700; }
.tabs a.on { background: #fff; color: var(--red); }
.review-row, .review-block { align-items: flex-start; flex-direction: column; }
.review-row .seg, .review-block .filter { width: 100%; }
.chips span { background: #f6f1ea; border-radius: 8px; padding: 4px 8px; font-size: 13px; }
.toast-stack { position: fixed; right: 24px; bottom: 24px; z-index: 40; display: flex; flex-direction: column; gap: 8px; }
.toast { background: #1f1a17; color: #fff; padding: 14px 18px; border-radius: 12px; box-shadow: 0 10px 24px rgba(0,0,0,.2); animation: rise .35s ease; }
.toast.success { background: #1b5e20; }
.toast.error { background: #8e1b1b; }

.modal[hidden] { display: none !important; }
.modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 8vh 24px 24px;
  box-sizing: border-box;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(28, 18, 16, .48);
  backdrop-filter: blur(2px);
}
.modal-card {
  position: relative;
  z-index: 1;
  width: min(640px, 96vw);
  max-height: min(82vh, 760px);
  margin-top: 0;
  overflow: auto;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(0,0,0,.28);
  animation: rise .22s ease;
}
.modal-card:has(.modal-form-wide) {
  width: min(860px, 96vw);
}
.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 18px;
}
.form-grid-2 label { margin: 0; }
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}
.modal-head h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 24px;
}
.modal-x {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: #f3eee6;
  color: var(--muted);
  font-size: 16px;
}
.modal-body { padding: 20px 22px 22px; }
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 8px;
}
body.modal-open { overflow: hidden; }

@media (max-width: 1100px) {
  .banner-row, .split, .metric-grid, .card-grid.cols-4, .card-grid.cols-3, .info-grid, .milestone-track, .role-grid {
    grid-template-columns: 1fr;
  }
  .banner-title, .banner-sub, .hero-title span { white-space: normal; letter-spacing: 0.04em; }
  .side-nav { position: static; }
  .top-nav { display: none; }
}
