/* ===== 顾小仪 · 清华大学学生国旗仪仗队 ===== */
/* 临时品牌名“顾小仪”，正式名为“清小仪” */

:root {
  --red-900: #6f1010;
  --red-800: #8c1a1a;
  --red-700: #a82121;
  --red-100: #fbeaea;
  --gold: #d4af37;
  --gold-light: #f1dfa7;
  --ink: #2b2222;
  --paper: #fdfaf4;
  --white: #ffffff;
  --muted: #7d6b6b;
  --line: #e7d7c9;
  --shadow: 0 10px 30px rgba(111,16,16,.08);
  --radius: 16px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% -10%, rgba(212,175,55,.18), transparent 36rem),
    linear-gradient(180deg, #fff8f0 0%, var(--paper) 42%, #f8efe6 100%);
  min-height: 100vh;
}

a { color: var(--red-800); }

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: linear-gradient(90deg, #7a1212 0%, #9d1e1e 60%, #7a1212 100%);
  color: #fff;
  box-shadow: 0 6px 20px rgba(111,16,16,.28);
}

.header-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-logo {
  width: 46px;
  height: 46px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.25));
  background: rgba(255,255,255,.92);
  border-radius: 10px;
  padding: 4px;
}

.brand-text {
  min-width: 0;
}

.brand-name {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: .06em;
  white-space: nowrap;
}

.brand-sub {
  font-size: .72rem;
  color: var(--gold-light);
  opacity: .92;
  white-space: nowrap;
}

.nav {
  margin-left: auto;
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav button {
  border: 0;
  background: transparent;
  color: rgba(255,255,255,.82);
  padding: 9px 13px;
  border-radius: 10px;
  cursor: pointer;
  font-size: .95rem;
  font-family: inherit;
  transition: background .18s, color .18s;
}

.nav button:hover { background: rgba(255,255,255,.12); color: #fff; }
.nav button.active { background: rgba(255,255,255,.18); color: #fff; font-weight: 700; }

/* ---------- layout ---------- */
.page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 30px 20px 60px;
}

.section { display: none; }
.section.active { display: block; animation: fadeIn .3s ease; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.hero {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  color: #fff;
  background: linear-gradient(120deg, rgba(111,16,16,.92), rgba(78,9,9,.82));
  min-height: 300px;
  display: flex;
  align-items: center;
  padding: 38px;
  margin-bottom: 26px;
}

.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .35;
}

.hero-content { position: relative; z-index: 1; max-width: 760px; }

.hero-kicker {
  display: inline-block;
  background: rgba(212,175,55,.22);
  border: 1px solid rgba(241,223,167,.6);
  color: var(--gold-light);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: .78rem;
  letter-spacing: .16em;
  margin-bottom: 14px;
}

.hero h1 {
  margin: 0 0 12px;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  letter-spacing: .04em;
}

.hero p {
  margin: 0;
  color: rgba(255,255,255,.88);
  line-height: 1.9;
  font-size: 1rem;
}

/* ---------- cards ---------- */
.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}

.card + .card { margin-top: 18px; }

.section-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 4px 0 16px;
}

.section-title h2 {
  margin: 0;
  font-size: 1.45rem;
  color: var(--red-800);
}

.section-title .hint {
  color: var(--muted);
  font-size: .85rem;
}

.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--red-100);
  color: var(--red-800);
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .06em;
}

.badge.gold {
  background: #f7edc9;
  color: #86691b;
}

/* birthday grid */
.birthday-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.birthday-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 16px 14px;
  box-shadow: 0 6px 18px rgba(111,16,16,.06);
  transition: transform .18s, box-shadow .18s;
}

.birthday-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.birthday-card.today { border-color: var(--gold); background: linear-gradient(180deg,#fffdf4,#fff8ea); }

.birthday-card .name {
  font-size: 1.06rem;
  font-weight: 700;
  color: var(--red-800);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.birthday-card .line {
  margin-top: 8px;
  font-size: .9rem;
  line-height: 1.6;
  color: #5b4a4a;
}

.birthday-card .meta {
  margin-top: 8px;
  color: var(--muted);
  font-size: .78rem;
}

.today-heading {
  color: var(--red-700);
  font-size: 1.05rem;
  margin: 4px 0 14px;
}

.today-heading::before { content: "🎂 "; }

/* ---------- search ---------- */
.search-box {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.search-box input {
  flex: 1 1 280px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 1rem;
  font-family: inherit;
  background: #fff;
}

.search-box input:focus { outline: 2px solid rgba(168,33,33,.25); border-color: var(--red-700); }

.result-count { color: var(--muted); font-size: .88rem; }

.member-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }

.member-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 6px 18px rgba(111,16,16,.05);
}

.member-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.member-head .name { font-size: 1.18rem; font-weight: 700; color: var(--red-800); }

.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 14px;
  font-size: .9rem;
}

.info-grid .item { min-width: 0; }
.info-grid .label { color: var(--muted); font-size: .76rem; display: block; margin-bottom: 2px; }
.info-grid .value { line-height: 1.45; overflow-wrap: anywhere; }

.lock-note {
  margin-top: 14px;
  padding: 12px;
  border-radius: 10px;
  background: #fff8e6;
  border: 1px dashed #e2c978;
  color: #826916;
  font-size: .85rem;
}

.login-box {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px dashed var(--line);
}

.login-box form {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.login-box input {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 11px;
  font-size: .92rem;
  font-family: inherit;
}

.btn {
  border: 0;
  border-radius: 10px;
  background: var(--red-800);
  color: #fff;
  padding: 10px 16px;
  font-size: .92rem;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s;
}

.btn:hover { background: var(--red-900); }
.btn.ghost {
  background: transparent;
  color: var(--red-800);
  border: 1px solid var(--red-800);
}
.btn.ghost:hover { background: var(--red-100); }

.login-msg { color: var(--red-700); font-size: .86rem; margin-top: 8px; }

/* ---------- lead ---------- */
.lead-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 18px;
}

.lead-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.lead-card .lead-image {
  width: 100%;
  height: 210px;
  object-fit: cover;
  background: #f2e4d8;
}

.lead-card .lead-body { padding: 20px; }

.lead-card h3 {
  margin: 0 0 12px;
  color: var(--red-800);
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.lead-card p {
  margin: 0 0 10px;
  line-height: 1.9;
  font-size: .94rem;
  color: #4c3b3b;
  white-space: pre-line;
}

/* ---------- committee ---------- */
.committee-intro { line-height: 1.95; font-size: .98rem; color: #4c3b3b; white-space: pre-line; }

.committee-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.role-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-left: 5px solid var(--red-700);
  border-radius: 12px;
  padding: 16px 18px;
  box-shadow: 0 5px 16px rgba(111,16,16,.05);
}

.role-card h3 { margin: 0 0 10px; color: var(--red-800); font-size: 1.05rem; }
.role-card p { margin: 0; line-height: 1.85; font-size: .9rem; color: #4c3b3b; white-space: pre-line; }

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  background: #fff8f0;
  padding: 26px 20px;
  text-align: center;
  color: var(--muted);
  font-size: .84rem;
  line-height: 1.8;
}

.site-footer .foot-name { color: var(--red-800); font-weight: 700; }

/* ---------- responsive ---------- */
@media (max-width: 720px) {
  .header-inner { flex-wrap: wrap; gap: 10px; }
  .nav { width: 100%; justify-content: flex-start; }
  .hero { padding: 26px 20px; min-height: 260px; }
  .page { padding: 20px 14px 46px; }
  .info-grid { grid-template-columns: 1fr; }
  .birthday-grid { grid-template-columns: 1fr; }
}


/* ---------- single birthday ---------- */
.birthday-grid-single {
  grid-template-columns: 1fr;
  max-width: none;
}

.birthday-grid-multi {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

/* ---------- agent ---------- */
.agent-panel { padding: 18px; }

.agent-toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.agent-modes {
  display: flex;
  gap: 6px;
  background: var(--red-100);
  border-radius: 12px;
  padding: 4px;
}

.agent-mode {
  border: 0;
  background: transparent;
  color: var(--red-800);
  padding: 8px 14px;
  border-radius: 9px;
  cursor: pointer;
  font-size: .9rem;
  font-family: inherit;
  transition: background .15s, color .15s;
}

.agent-mode.active { background: var(--red-800); color: #fff; font-weight: 700; }

.agent-hint {
  background: #fff8e6;
  border: 1px dashed #e2c978;
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: .82rem;
}

.agent-messages {
  height: 380px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.agent-msg {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: .92rem;
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.agent-msg.bot { align-self: flex-start; background: #f8efe6; border: 1px solid var(--line); }
.agent-msg.user { align-self: flex-end; background: var(--red-800); color: #fff; }

.agent-msg.thinking {
  color: var(--red-700);
  font-style: italic;
}

.agent-msg.thinking::after {
  content: '';
  display: inline-block;
  width: 1em;
  text-align: left;
  animation: agent-thinking-dots 1.2s steps(4, end) infinite;
}

@keyframes agent-thinking-dots {
  0% { content: ''; }
  25% { content: '.'; }
  50% { content: '..'; }
  75% { content: '...'; }
}

.agent-input-row {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  align-items: flex-end;
}

.agent-input-row textarea {
  flex: 1 1 auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 13px;
  font-family: inherit;
  font-size: .95rem;
  resize: none;
  min-height: 44px;
  max-height: 140px;
  line-height: 1.5;
}

.agent-input-row textarea:focus { outline: 2px solid rgba(168,33,33,.25); border-color: var(--red-700); }



/* ---------- auth ---------- */
.lock-note.ok {
  background: #eaf6ea;
  border-color: #a9d5a9;
  color: #2f6b2f;
}

.auth-card {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px dashed var(--line);
}

.auth-user {
  min-height: 22px;
  margin-bottom: 12px;
  font-size: .9rem;
  color: var(--red-800);
  font-weight: 700;
}

.auth-tabs {
  display: flex;
  gap: 6px;
  background: var(--red-100);
  border-radius: 12px;
  padding: 4px;
  width: max-content;
  max-width: 100%;
  margin-bottom: 14px;
}

.auth-tab {
  border: 0;
  background: transparent;
  color: var(--red-800);
  padding: 8px 16px;
  border-radius: 9px;
  cursor: pointer;
  font-size: .9rem;
  font-family: inherit;
  transition: background .15s, color .15s;
}

.auth-tab.active {
  background: var(--red-800);
  color: #fff;
  font-weight: 700;
}

.auth-form-title {
  margin: 0 0 14px;
  font-size: 1rem;
  color: var(--red-800);
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
  font-size: .88rem;
  color: var(--muted);
}

.auth-field input {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: .94rem;
  font-family: inherit;
  background: #fff;
}

.auth-field input:focus {
  outline: 2px solid rgba(168,33,33,.25);
  border-color: var(--red-700);
}

.auth-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 4px;
}

.auth-msg {
  margin-top: 10px;
  min-height: 20px;
  font-size: .86rem;
  color: var(--muted);
}

.auth-msg.error { color: var(--red-700); }

.btn:disabled,
.agent-input-row textarea:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.agent-toolbar.agent-locked { opacity: .55; pointer-events: none; }

.agent-msg.locked {
  color: #826916;
  background: #fff8e6;
  border: 1px dashed #e2c978;
}

/* ---------- header auth button ---------- */
.header-auth {
  background: rgba(255,255,255,.14);
  color: #fff;
  border: 1px solid rgba(255,255,255,.55);
  padding: 8px 14px;
  white-space: nowrap;
}

.header-auth:hover {
  background: rgba(255,255,255,.24);
  color: #fff;
}

/* ---------- modal ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
}

.modal[hidden] { display: none; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(43, 20, 20, .52);
  backdrop-filter: blur(2px);
}

.modal-dialog {
  position: relative;
  width: min(460px, 100%);
  max-height: 92vh;
  overflow-y: auto;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(43,20,20,.28);
  padding: 24px;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

.modal-close:hover { color: var(--red-800); }

.modal-title {
  margin: 0 30px 12px 0;
  font-size: 1.25rem;
  color: var(--red-800);
}

/* ---------- profile ---------- */
.profile-card-inner { display: flex; flex-direction: column; gap: 16px; }

.profile-top {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.avatar-preview {
  width: 88px;
  height: 88px;
  flex: 0 0 auto;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--gold);
  background: #f8efe6;
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  font-size: .72rem;
  color: var(--muted);
}

.avatar-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8efe6;
  color: var(--muted);
}

.profile-id { min-width: 0; }

.profile-name {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--red-800);
  overflow-wrap: anywhere;
}

.profile-note { color: var(--muted); font-size: .86rem; margin-top: 4px; }

.avatar-upload {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.profile-tip { color: var(--muted); font-size: .78rem; margin: 0; }

@media (max-width: 720px) {
  .modal-dialog { padding: 18px; }
}
