:root {
  --bg: #f3efe4;
  --paper: rgba(255, 252, 245, 0.92);
  --panel: #fffdf8;
  --text: #1e1d18;
  --muted: #666050;
  --line: #d8cfbc;
  --brand: #194f43;
  --brand-2: #b56a2d;
  --brand-soft: #edf4ef;
  --warn-bg: #fff1dc;
  --warn-line: #d88f38;
  --shadow: 0 18px 48px rgba(53, 44, 24, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  font-family: "Avenir Next", "PingFang SC", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(27, 102, 88, 0.18), transparent 35%),
    radial-gradient(circle at top right, rgba(181, 106, 45, 0.18), transparent 28%),
    linear-gradient(180deg, #efe8d6 0%, var(--bg) 52%, #f8f3e8 100%);
}

.page {
  width: min(1280px, calc(100% - 24px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.hero {
  padding: 20px 4px 24px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--brand);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.2rem, 4vw, 4rem);
  line-height: 0.96;
}

.hero-copy {
  max-width: 760px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.7;
}

.card {
  background: var(--paper);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 22px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.auth-card {
  padding: 22px;
}

.grid-2 {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.auth-grid {
  margin-top: 16px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: end;
  margin-bottom: 12px;
}

.section-head h2,
.form-grid h3 {
  margin: 0;
}

.section-head p,
.hint,
.section-head + p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.form-grid {
  display: grid;
  gap: 10px;
}

.form-block {
  margin-top: 18px;
}

input,
select,
button {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--line);
  padding: 12px 14px;
  font-size: 0.96rem;
  background: rgba(255, 255, 255, 0.88);
  color: var(--text);
}

input:focus,
select:focus {
  outline: 2px solid rgba(25, 79, 67, 0.18);
  border-color: var(--brand);
}

button {
  border-color: var(--brand);
  background: linear-gradient(135deg, var(--brand), #23695a);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.16s ease, filter 0.16s ease;
}

button:hover {
  filter: brightness(1.04);
  transform: translateY(-1px);
}

.ghost-btn {
  width: auto;
  min-width: 118px;
  background: transparent;
  color: var(--brand);
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
}

.topbar-meta {
  display: grid;
  gap: 8px;
}

.topbar-meta div {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.summary-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-bottom: 18px;
}

.summary-card {
  position: relative;
  overflow: hidden;
  padding: 18px;
  border-radius: 18px;
  background: linear-gradient(160deg, rgba(25, 79, 67, 0.98), rgba(25, 79, 67, 0.84));
  color: #f6f6f0;
  box-shadow: var(--shadow);
}

.summary-card:nth-child(2n) {
  background: linear-gradient(160deg, rgba(181, 106, 45, 0.98), rgba(137, 80, 33, 0.88));
}

.summary-card span {
  display: block;
  font-size: 0.9rem;
  opacity: 0.88;
}

.summary-card strong {
  display: block;
  margin-top: 10px;
  font-size: 2.2rem;
  line-height: 1;
}

.banner {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1px solid var(--warn-line);
  border-radius: 16px;
  background: var(--warn-bg);
  color: #6d4518;
}

.banner code {
  color: inherit;
}

.stack-list {
  display: grid;
  gap: 12px;
}

.assignment-item,
.latest-switch,
.event-item {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  padding: 14px;
}

.assignment-main {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  font-size: 1rem;
}

.assignment-sub {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  color: var(--muted);
  font-size: 0.9rem;
}

.switch-title {
  font-size: 1.25rem;
  font-weight: 700;
}

.switch-meta {
  margin-top: 8px;
  color: var(--muted);
}

.empty {
  color: var(--muted);
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

th,
td {
  padding: 10px 8px;
  text-align: left;
  border-bottom: 1px solid rgba(216, 207, 188, 0.72);
  vertical-align: top;
}

th {
  color: var(--brand);
  background: rgba(25, 79, 67, 0.06);
}

code {
  font-family: "SFMono-Regular", "Menlo", monospace;
  font-size: 0.85em;
}

.event-list {
  display: grid;
  gap: 12px;
  max-height: 620px;
  overflow: auto;
}

.event-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.event-meta,
.event-item p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.emphasis-card {
  background: linear-gradient(180deg, rgba(255, 250, 239, 0.96), rgba(250, 246, 235, 0.92));
}

.hidden {
  display: none;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #1e1d18;
  color: #fff;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: all 0.2s ease;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.2);
}

.toast.error {
  background: #8c3d22;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 820px) {
  .page {
    width: min(100% - 18px, 1280px);
    padding-top: 18px;
  }

  .topbar,
  .assignment-main {
    flex-direction: column;
    align-items: flex-start;
  }
}
