:root {
  --ink: #10233f;
  --ink-soft: #3d516c;
  --line: rgba(16, 35, 63, 0.12);
  --panel: rgba(255, 255, 255, 0.82);
  --accent: #0b6e6e;
  --accent-2: #c45c26;
  --bg-1: #e8f1f4;
  --bg-2: #f7f3ea;
  --shadow: 0 18px 40px rgba(16, 35, 63, 0.08);
  --radius: 18px;
  --font-display: "ZCOOL XiaoWei", "Noto Serif SC", serif;
  --font-body: "Noto Sans SC", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 10%, rgba(11, 110, 110, 0.16), transparent 34%),
    radial-gradient(circle at 88% 0%, rgba(196, 92, 38, 0.14), transparent 28%),
    linear-gradient(160deg, var(--bg-1), var(--bg-2));
  background-attachment: fixed;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: #085858; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(14px);
  background: rgba(247, 243, 234, 0.78);
  border-bottom: 1px solid var(--line);
}

.navbar { padding: .85rem 0; }
.navbar-brand {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  color: var(--ink) !important;
  font-weight: 700;
}
.brand-mark {
  width: 2rem;
  height: 2rem;
  border-radius: .7rem;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--accent), #149494);
  color: #fff;
  font-family: var(--font-display);
}
.brand-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.05rem;
  letter-spacing: .04em;
  font-size: .92rem;
  line-height: 1.2;
  white-space: nowrap;
}
.brand-line {
  display: block;
}
@media (min-width: 992px) {
  .brand-text { font-size: .98rem; }
}
.nav-link {
  color: var(--ink-soft) !important;
  font-weight: 500;
  padding: .45rem .7rem !important;
}
.nav-link:hover { color: var(--ink) !important; }
.navbar-toggler {
  border: 1px solid var(--line);
  padding: .35rem .55rem;
}
.navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(16,35,63,0.75)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .28rem .7rem .28rem .28rem;
  border-radius: 999px;
  background: rgba(11, 110, 110, 0.1);
  color: var(--accent);
  font-size: .88rem;
}
.user-chip-link {
  text-decoration: none;
  color: var(--accent);
}
.user-chip-link:hover {
  color: #085858;
  background: rgba(11, 110, 110, 0.16);
}

.avatar {
  object-fit: cover;
  border-radius: 50%;
  background: #fff;
  border: 2px solid rgba(255,255,255,.9);
  box-shadow: 0 2px 8px rgba(16, 35, 63, 0.12);
  flex-shrink: 0;
}
.avatar-sm { width: 28px; height: 28px; }
.avatar-md { width: 40px; height: 40px; }
.avatar-lg { width: 64px; height: 64px; }
.avatar-xl { width: 120px; height: 120px; }

.avatar-preview-panel { padding: 2rem 1.25rem; }

.avatar-picker {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .85rem;
}
@media (max-width: 575.98px) {
  .avatar-picker { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.avatar-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .35rem;
  padding: .7rem .5rem;
  border-radius: 14px;
  border: 2px solid transparent;
  background: rgba(255,255,255,.7);
  cursor: pointer;
  transition: border-color .15s ease, transform .15s ease;
}
.avatar-option input { position: absolute; opacity: 0; pointer-events: none; }
.avatar-option img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
}
.avatar-option span {
  font-size: .82rem;
  color: var(--ink-soft);
}
.avatar-option:hover { transform: translateY(-2px); border-color: rgba(11,110,110,.25); }
.avatar-option.is-selected {
  border-color: var(--accent);
  background: rgba(11, 110, 110, 0.08);
}

.person-cell {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
}

.btn {
  border-radius: 999px;
  padding: .55rem 1.1rem;
  font-weight: 600;
  border: none;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), #0f8a8a);
  color: #fff;
  box-shadow: 0 10px 24px rgba(11, 110, 110, 0.25);
}
.btn-primary:hover { background: #085e5e; color: #fff; }
.btn-accent {
  background: linear-gradient(135deg, var(--accent-2), #d9783d);
  color: #fff;
}
.btn-accent:hover { color: #fff; filter: brightness(0.95); }
.btn-ghost {
  background: transparent;
  border: 1px solid var(--line) !important;
  color: var(--ink);
}
.btn-ghost:hover { background: rgba(16, 35, 63, 0.04); color: var(--ink); }
.btn-sm { padding: .35rem .8rem; font-size: .88rem; }
.btn-outline-primary {
  border: 1px solid rgba(11, 110, 110, 0.35) !important;
  color: var(--accent);
  background: transparent;
}
.btn-outline-primary:hover {
  background: rgba(11, 110, 110, 0.08);
  color: var(--accent);
}

.hero {
  position: relative;
  overflow: hidden;
  padding: 4.5rem 0 3.5rem;
  min-height: calc(100vh - 76px);
  display: flex;
  align-items: center;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(120deg, rgba(16, 35, 63, 0.78), rgba(11, 110, 110, 0.55)),
    url("https://images.unsplash.com/photo-1451187580459-43490279c0fa?auto=format&fit=crop&w=1800&q=80") center/cover;
  z-index: 0;
}
.hero .container { position: relative; z-index: 1; color: #fff; }
.hero-kicker {
  display: inline-block;
  margin-bottom: 1rem;
  padding: .35rem .8rem;
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 999px;
  font-size: .85rem;
  letter-spacing: .08em;
  animation: rise .7s ease both;
}
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 4.6vw, 3.6rem);
  line-height: 1.15;
  max-width: 14ch;
  margin-bottom: 1rem;
  animation: rise .8s .05s ease both;
}
.hero p {
  max-width: 36rem;
  font-size: 1.08rem;
  opacity: .92;
  margin-bottom: 1.6rem;
  animation: rise .8s .12s ease both;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  animation: rise .8s .18s ease both;
}
.hero-actions .btn-ghost {
  border-color: rgba(255,255,255,.45) !important;
  color: #fff;
}
.hero-actions .btn-ghost:hover { background: rgba(255,255,255,.12); color: #fff; }

.section { padding: 3.5rem 0; }
.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  margin-bottom: .4rem;
}
.section-sub {
  color: var(--ink-soft);
  margin-bottom: 1.8rem;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
@media (min-width: 768px) {
  .stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.stat-card {
  padding: 1.15rem 1.2rem;
  border-radius: 16px;
  background: linear-gradient(160deg, rgba(255,255,255,.95), rgba(232,241,244,.9));
  border: 1px solid var(--line);
  animation: rise .6s ease both;
}
.stat-card .label { color: var(--ink-soft); font-size: .9rem; }
.stat-card .value {
  font-family: var(--font-display);
  font-size: 1.9rem;
  margin-top: .25rem;
}

.uni-list, .brochure-list, .major-list {
  display: grid;
  gap: 1rem;
}
@media (min-width: 768px) {
  .uni-list, .brochure-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .major-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.uni-item, .brochure-item, .major-item {
  padding: 1.2rem;
  border-radius: 16px;
  background: rgba(255,255,255,.78);
  border: 1px solid var(--line);
  transition: transform .2s ease, box-shadow .2s ease;
}
.uni-item:hover, .brochure-item:hover, .major-item:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}
.uni-item h3, .brochure-item h3, .major-item h3 {
  font-size: 1.15rem;
  margin: 0 0 .45rem;
  font-family: var(--font-display);
}
.meta {
  color: var(--ink-soft);
  font-size: .9rem;
}
.price {
  color: var(--accent-2);
  font-weight: 700;
}

.page-head {
  padding: 2rem 0 1rem;
}
.page-head h1 {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3vw, 2.2rem);
  margin-bottom: .35rem;
}

.table {
  --bs-table-bg: transparent;
  vertical-align: middle;
}
.table thead th {
  color: var(--ink-soft);
  font-weight: 600;
  border-bottom-color: var(--line);
  white-space: nowrap;
}
.table > :not(caption) > * > * {
  background: transparent;
  border-bottom-color: var(--line);
  padding: .85rem .6rem;
}

.form-control, .form-select {
  border-radius: 12px;
  border-color: var(--line);
  padding: .7rem .9rem;
  background: rgba(255,255,255,.9);
}
.form-control:focus, .form-select:focus {
  border-color: rgba(11, 110, 110, .45);
  box-shadow: 0 0 0 .2rem rgba(11, 110, 110, .12);
}
.form-label { font-weight: 600; color: var(--ink-soft); }

.badge-pill, .status-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: .25rem .65rem;
  font-size: .8rem;
  font-weight: 600;
}
.badge-info { background: rgba(11,110,110,.12); color: var(--accent); }
.badge-warning { background: rgba(196,146,38,.16); color: #8a5a00; }
.badge-success { background: rgba(34,140,80,.14); color: #1d6b3d; }
.badge-danger { background: rgba(180,50,50,.12); color: #9b2c2c; }
.badge-muted { background: rgba(16,35,63,.08); color: var(--ink-soft); }

.auth-shell {
  min-height: calc(100vh - 160px);
  display: grid;
  place-items: center;
  padding: 2rem 0;
}
.auth-panel {
  width: min(100%, 460px);
  padding: 1.8rem;
}
.auth-panel h1 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  margin-bottom: .4rem;
}

.qr-box {
  width: 240px;
  height: 240px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  padding: .75rem;
}
.qr-box img { width: 100%; height: 100%; object-fit: contain; }
.qr-box-avatar { padding: .55rem; }
.qr-promo-side {
  width: 240px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .75rem;
}
.qr-owner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  max-width: 100%;
  padding: .35rem .75rem .35rem .35rem;
  border-radius: 999px;
  background: rgba(11, 110, 110, 0.1);
  color: var(--accent);
  font-weight: 600;
  font-size: .9rem;
}
.qr-owner span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#btnCopyQr {
  width: 100%;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-bottom: 1rem;
}
.filter-bar .form-control,
.filter-bar .form-select { min-width: 140px; }

.site-footer {
  margin-top: 3rem;
  padding: 2.5rem 0 1.5rem;
  border-top: 1px solid var(--line);
  background: rgba(255,255,255,.45);
}
.footer-grid {
  display: grid;
  gap: 1.5rem;
}
@media (min-width: 768px) {
  .footer-grid { grid-template-columns: 2fr 1fr; }
}
.footer-brand {
  font-family: var(--font-display);
  font-size: 1.2rem;
  margin-bottom: .4rem;
}
.footer-title { font-weight: 700; margin-bottom: .5rem; }
.site-footer a {
  display: block;
  color: var(--ink-soft);
  margin-bottom: .35rem;
}
.footer-copy {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: .9rem;
}

.rich-content h3 { font-size: 1.1rem; margin-top: 1rem; }
.rich-content p { color: var(--ink-soft); }

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 991.98px) {
  .auth-actions { margin-top: .75rem; }
  .table-responsive { border-radius: 12px; }
}
