:root {
  --yellow: #f6c63d;
  --yellow-soft: #fff6d6;
  --yellow-deep: #8a5b00;
  --blue: #4385ee;
  --green: #239866;
  --red: #c43b52;
  --ink: #1f2937;
  --muted: #64748b;
  --line: #e6e1d6;
  --surface: #ffffff;
  --page: #fffdf7;
  --radius: 10px;
  --shadow: 0 18px 42px rgba(40, 34, 12, 0.12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 88% 8%, rgba(246, 198, 61, 0.2), transparent 26rem),
    linear-gradient(135deg, #fffdf7 0%, #f7fbff 60%, #fff6d6 100%);
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.portal-page { display: grid; place-items: center; padding: 28px; }
.portal {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  width: min(1120px, 100%);
  min-height: 620px;
  overflow: hidden;
  border: 1px solid rgba(246, 198, 61, 0.4);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
}
.portal-hero { padding: clamp(28px, 6vw, 72px); }
.brand-lockup { display: flex; align-items: center; gap: 12px; }
.brand-lockup strong, .brand-lockup span { display: block; }
.brand-lockup strong { font-size: 20px; }
.brand-lockup span { margin-top: 3px; color: var(--muted); font-size: 12px; }
.brand-mark, .choice-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--yellow);
  color: #5b3b00;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(246, 198, 61, 0.35);
}
.status-pill, .tag, .state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 800;
}
.status-pill {
  margin-top: 54px;
  border: 1px solid rgba(246, 198, 61, 0.55);
  background: var(--yellow-soft);
  color: var(--yellow-deep);
}
.portal h1 { max-width: 560px; margin: 18px 0 10px; font-size: clamp(34px, 5vw, 58px); line-height: 1.12; }
.portal-hero > p { max-width: 560px; margin: 0; color: var(--muted); line-height: 1.8; }
.portal-actions { display: grid; gap: 12px; max-width: 620px; margin-top: 34px; }
.portal-choice {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.portal-choice:hover { transform: translateY(-2px); border-color: var(--yellow); box-shadow: 0 12px 24px rgba(31, 41, 55, .09); }
.portal-choice strong, .portal-choice small { display: block; }
.portal-choice strong { margin-bottom: 4px; }
.portal-choice small { color: var(--muted); font-size: 13px; }
.portal-choice b { color: var(--blue); white-space: nowrap; }
.choice-school .choice-icon { background: #eaf2ff; color: var(--blue); box-shadow: none; }
.portal-visual {
  position: relative;
  min-height: 620px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(246, 198, 61, .96), rgba(255, 239, 157, .88) 46%, rgba(234, 242, 255, .92)),
    repeating-linear-gradient(40deg, transparent 0 20px, rgba(255,255,255,.26) 21px 22px);
}
.sun { position: absolute; left: 50%; top: 48%; width: 150px; height: 150px; transform: translate(-50%, -50%); border-radius: 50%; background: #fffbe6; box-shadow: 0 0 0 22px rgba(255,255,255,.3), 0 0 80px rgba(255,255,255,.95); }
.orbit { position: absolute; left: 50%; top: 48%; border: 1px solid rgba(255,255,255,.75); border-radius: 50%; transform: translate(-50%, -50%) rotate(-22deg); }
.orbit-one { width: 390px; height: 190px; }
.orbit-two { width: 260px; height: 430px; transform: translate(-50%, -50%) rotate(38deg); }
.signal { position: absolute; width: 24px; height: 24px; border: 3px solid #fff; border-radius: 7px; transform: rotate(45deg); }
.signal-one { top: 24%; right: 20%; }
.signal-two { bottom: 27%; left: 19%; width: 16px; height: 16px; border-color: var(--blue); }
.signal-three { right: 15%; bottom: 18%; width: 12px; height: 12px; border-color: var(--green); }

.app-shell { display: grid; grid-template-columns: 246px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; padding: 22px 18px;
  background: rgba(255,255,255,.86); border-right: 1px solid var(--line);
  backdrop-filter: blur(14px);
}
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.brand-mark { width: 44px; height: 44px; border-radius: 13px; }
.brand strong, .brand span { display: block; }
.brand strong { font-size: 18px; }
.brand span { margin-top: 3px; color: var(--muted); font-size: 12px; }
.workspace-switcher { display: block; margin: -15px 0 18px; color: var(--blue); font-size: 12px; font-weight: 800; }
.nav-list { display: grid; gap: 7px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 43px;
  padding: 9px 11px; border: 0; border-radius: var(--radius); background: transparent;
  color: var(--muted); text-align: left;
}
.nav-item:hover { background: #f8fafc; }
.nav-item.active { background: var(--yellow-soft); color: var(--yellow-deep); font-weight: 800; }
.nav-icon { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: rgba(246,198,61,.18); }
.main { min-width: 0; padding: 24px 28px 96px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.eyebrow { margin: 0 0 4px; color: var(--yellow-deep); font-size: 12px; font-weight: 800; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 30px; }
h2 { font-size: 24px; line-height: 1.25; }
h3 { font-size: 18px; }
.top-actions, .action-row, .meta-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.primary-button, .ghost-button, .icon-button, .tiny-button {
  min-height: 40px; padding: 0 14px; border: 0; border-radius: var(--radius);
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.primary-button { background: var(--ink); color: #fff; font-weight: 800; }
.primary-button:hover, .ghost-button:hover, .icon-button:hover, .tiny-button:hover { transform: translateY(-1px); }
.ghost-button { border: 1px solid var(--line); background: #f8fafc; color: var(--ink); }
.icon-button { display: grid; min-width: 40px; place-items: center; border: 1px solid var(--line); background: #fff; }
.tiny-button { min-height: 32px; padding: 0 10px; background: var(--yellow-soft); color: var(--yellow-deep); font-size: 13px; font-weight: 800; }
.hero-strip {
  display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 22px; align-items: center;
  overflow: hidden; margin-bottom: 22px; padding: 22px; border: 1px solid rgba(246,198,61,.38);
  border-radius: var(--radius); background: linear-gradient(100deg, rgba(255,255,255,.94), rgba(255,246,214,.78)), repeating-linear-gradient(90deg, transparent 0 22px, rgba(67,133,238,.08) 23px 24px); box-shadow: var(--shadow);
}
.hero-copy p, .section-head p { max-width: 720px; margin-bottom: 0; color: var(--muted); line-height: 1.7; }
.light-card { position: relative; height: 138px; border-radius: var(--radius); background: linear-gradient(135deg, var(--yellow), #fff0a8 56%, #e9f2ff); border: 1px solid rgba(255,255,255,.8); }
.sun-core { position: absolute; inset: 28px auto auto 44px; width: 72px; height: 72px; border-radius: 50%; background: #fffbe6; box-shadow: 0 0 0 14px rgba(255,255,255,.24), 0 0 42px rgba(255,255,255,.82); }
.spark { position: absolute; width: 22px; height: 22px; border: 3px solid #fff; border-radius: 6px; transform: rotate(45deg); }
.s1 { right: 42px; top: 28px; } .s2 { right: 82px; bottom: 28px; width: 16px; height: 16px; border-color: var(--blue); } .s3 { right: 18px; bottom: 48px; width: 12px; height: 12px; border-color: var(--green); }
.content-area { min-height: 480px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-head p { margin-top: 4px; }
.grid { display: grid; gap: 14px; }
.stats-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.two-grid { grid-template-columns: minmax(0, 1.2fr) minmax(300px, .8fr); }
.card { padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(255,255,255,.94); box-shadow: 0 10px 26px rgba(15,23,42,.06); }
.card h3 { margin-bottom: 8px; } .card p { color: var(--muted); line-height: 1.7; }
.stat-card strong { display: block; font-size: 28px; } .stat-card span, .muted, .meta-row { color: var(--muted); }
.course-cover { display: grid; min-height: 118px; place-items: center; margin: -6px -6px 14px; border-radius: var(--radius); color: #614100; background: linear-gradient(135deg, rgba(246,198,61,.85), rgba(67,133,238,.2)), repeating-linear-gradient(45deg, transparent 0 15px, rgba(255,255,255,.24) 16px 17px); font-size: 42px; }
.tag { background: #f8fafc; color: var(--muted); } .state.pending { background: #fff3c4; color: #8a5b00; } .state.approved, .state.done { background: #dff8ea; color: #0f7a4b; } .state.rejected { background: #ffe4e6; color: #b4233b; } .state.info { background: #eaf2ff; color: #1d5fc0; }
.list, .timeline { display: grid; gap: 10px; }
.list-item, .timeline-item { display: grid; gap: 8px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.timeline-item { position: relative; padding-left: 40px; } .timeline-item::before { content: ""; position: absolute; left: 14px; top: 16px; width: 12px; height: 12px; border-radius: 50%; background: var(--yellow); box-shadow: 0 0 0 5px var(--yellow-soft); }
.form-card { display: grid; gap: 12px; }
label { display: grid; gap: 6px; color: var(--muted); font-size: 13px; font-weight: 700; }
input, select, textarea { width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; color: var(--ink); }
textarea { min-height: 98px; resize: vertical; }
.mobile-nav { display: none; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 20; max-width: 340px; padding: 12px 14px; border-radius: var(--radius); background: var(--ink); color: #fff; box-shadow: var(--shadow); opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity .18s ease, transform .18s ease; }
.toast.show { opacity: 1; transform: translateY(0); }
.modal { width: min(560px, calc(100vw - 28px)); padding: 0; border: 0; border-radius: var(--radius); box-shadow: var(--shadow); }
.modal::backdrop { background: rgba(31,41,55,.38); } .modal form { padding: 18px; } .modal-header, .modal-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; } .modal-actions { justify-content: flex-end; margin-top: 16px; }
.certificate { position: relative; overflow: hidden; padding: 26px; border: 2px solid var(--yellow); background: linear-gradient(135deg, #fff, #fff7d9); text-align: center; }
.certificate h3 { font-size: 24px; color: var(--yellow-deep); }
.back-link { display: inline-flex; margin-bottom: 18px; color: var(--blue); font-size: 13px; font-weight: 800; }
.empty-state { padding: 28px; border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted); text-align: center; }
#resultBox { white-space: pre-wrap; line-height: 1.7; }
.embedded-panel {
  margin: 12px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fffdf7;
}
.qr-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.qr-card { display: grid; gap: 12px; align-content: start; }
.qr-image {
  display: block;
  width: min(190px, 100%);
  aspect-ratio: 1;
  margin: 4px auto;
  border: 10px solid #fff;
  border-radius: var(--radius);
  box-shadow: 0 10px 22px rgba(15,23,42,.08);
}
.qr-link {
  display: block;
  overflow-wrap: anywhere;
  color: var(--blue);
  font-size: 12px;
  line-height: 1.5;
}
.survey-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 10px;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 980px) {
  .portal { grid-template-columns: 1fr; } .portal-visual { display: none; }
  .app-shell { grid-template-columns: 1fr; } .sidebar { display: none; }
  .main { padding: 18px 16px 92px; } .hero-strip { grid-template-columns: 1fr; }
  .stats-grid, .card-grid, .two-grid, .qr-grid { grid-template-columns: 1fr 1fr; }
  .mobile-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 8px; border-top: 1px solid var(--line); background: rgba(255,255,255,.94); backdrop-filter: blur(14px); }
  .mobile-nav .nav-item { justify-content: center; min-height: 48px; padding: 6px; font-size: 12px; } .mobile-nav .nav-label { display: none; }
}
@media (max-width: 640px) {
  .portal-page { padding: 0; } .portal { min-height: 100vh; border: 0; border-radius: 0; }
  .portal-hero { padding: 26px 20px 38px; } .status-pill { margin-top: 38px; } .portal h1 { font-size: 36px; }
  .topbar, .section-head { align-items: flex-start; flex-direction: column; } h1 { font-size: 24px; } h2 { font-size: 20px; }
  .top-actions { width: 100%; } .top-actions .primary-button { flex: 1; }
  .stats-grid, .card-grid, .two-grid, .qr-grid, .survey-details { grid-template-columns: 1fr; } .hero-strip { padding: 16px; } .card { padding: 14px; }
  .toast { right: 12px; bottom: 82px; left: 12px; max-width: none; }
}
