:root {
  color-scheme: light;
  --bg: #ffffff;
  --bg-soft: #f7f8fa;
  --card: #ffffff;
  --line: #e9ebef;
  --line-2: #dde0e6;
  --text: #111318;
  --muted: #666d7a;
  --faint: #9aa1ac;
  --brand: #e11d2e;
  --brand-2: #c41624;
  --brand-soft: rgba(225, 29, 46, .08);
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .05);
  --shadow-md: 0 2px 4px rgba(16, 24, 40, .04), 0 10px 26px -14px rgba(16, 24, 40, .14);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(900px 420px at 88% -12%, rgba(225, 29, 46, .05), transparent 60%),
    radial-gradient(700px 380px at 6% -18%, rgba(99, 102, 241, .04), transparent 60%);
}
.container { max-width: 1140px; margin: 0 auto; padding: 0 20px; position: relative; z-index: 1; }
main.container { padding-top: 8px; padding-bottom: 40px; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--brand); }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .86);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding-top: 12px; padding-bottom: 12px; }
.brand { display: flex; align-items: center; }
.brand-logo { height: 56px; width: auto; display: block; }
.nav { display: flex; align-items: center; gap: 26px; font-size: 14px; font-weight: 500; }
.nav a { color: var(--muted); transition: color .15s; }
.nav a:hover { color: var(--text); }
.nav-cta {
  background: var(--brand); color: #fff !important; padding: 10px 18px; border-radius: 999px; font-weight: 600;
  box-shadow: 0 10px 24px -14px rgba(225, 29, 46, .75);
  transition: background .15s, transform .15s;
}
.nav-cta:hover { background: var(--brand-2); transform: translateY(-1px); }

/* Hero */
.hero { padding: 54px 0 10px; }
.hero-compact { padding-bottom: 0; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
  border: 1px solid var(--line-2); background: #fff;
  padding: 6px 13px; border-radius: 999px; margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}
.eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 8px rgba(225, 29, 46, .6); }
.hero h1 { margin: 0 0 12px; font-size: clamp(30px, 4.4vw, 46px); line-height: 1.08; letter-spacing: -.03em; font-weight: 800; }
.hero .lede { margin: 0 0 30px; color: var(--muted); font-size: 16px; max-width: 680px; }

/* Stat strip (About page) */
.stat-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 26px 0 0; }
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px;
  box-shadow: var(--shadow-sm);
}
.stat-label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.stat-value { font-size: 27px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat-value .accent { color: var(--brand); }
.stat-sub { display: block; margin-top: 4px; font-size: 12px; color: var(--faint); }

/* Search panel */
.search-panel {
  background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 18px;
  box-shadow: var(--shadow-md);
}
.filters { display: grid; grid-template-columns: 2.2fr 1fr 1fr 1fr 1.2fr; gap: 10px; }
.filters input, .filters select,
.inquiry-form input, .inquiry-form textarea, .uni-filter {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  font-size: 14px; font-family: inherit; background: #fff; color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.filters input::placeholder, .inquiry-form input::placeholder, .inquiry-form textarea::placeholder, .uni-filter::placeholder { color: var(--faint); }
.filters input:focus, .filters select:focus,
.inquiry-form input:focus, .inquiry-form textarea:focus, .uni-filter:focus {
  outline: none; border-color: rgba(225, 29, 46, .55); box-shadow: 0 0 0 3px rgba(225, 29, 46, .12);
}
.filters select {
  appearance: none; -webkit-appearance: none; padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666d7a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.filters .actions { grid-column: 1 / -1; display: flex; gap: 10px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: var(--radius-sm); border: 1px solid transparent;
  background: var(--brand); color: #fff; font-weight: 600; font-size: 14px; font-family: inherit;
  cursor: pointer; transition: background .15s, transform .15s, border-color .15s, color .15s;
  box-shadow: 0 10px 24px -16px rgba(225, 29, 46, .8);
}
.btn:hover { background: var(--brand-2); color: #fff; transform: translateY(-1px); text-decoration: none; }
.btn-ghost { background: #fff; color: var(--muted); border-color: var(--line-2); box-shadow: var(--shadow-sm); }
.btn-ghost:hover { color: var(--brand); border-color: rgba(225, 29, 46, .4); background: #fff; }
.btn-lg { padding: 13px 28px; font-size: 15px; }

/* Results */
.results-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 34px 0 14px; }
.results-head h2 { margin: 0; font-size: 18px; font-weight: 700; letter-spacing: -.01em; }
.results-head .count { color: var(--muted); font-size: 13px; }
.course-list { display: flex; flex-direction: column; gap: 12px; }
.course-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; display: grid; grid-template-columns: 1fr auto; gap: 6px 22px; align-items: center;
  box-shadow: var(--shadow-sm);
  transition: border-color .16s, box-shadow .16s, transform .16s;
}
.course-card:hover { border-color: rgba(225, 29, 46, .35); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.course-card h3 { margin: 0; font-size: 16.5px; font-weight: 700; letter-spacing: -.01em; }
.course-card .uni { color: var(--muted); font-size: 13px; margin-top: 3px; }
.course-card .uni a { color: var(--muted); }
.course-card .uni a:hover { color: var(--text); }
.course-card .meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.course-card .facts { display: flex; gap: 18px; flex-wrap: wrap; color: var(--muted); font-size: 13px; margin-top: 10px; }
.course-card .facts strong { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.course-card .right { text-align: right; }

/* Badges */
.badge {
  display: inline-flex; align-items: center; font-size: 12px; font-weight: 600;
  padding: 4px 10px; border-radius: 999px; border: 1px solid transparent;
  background: #f3f4f6; color: #4b5563; white-space: nowrap;
}
.badge-bachelor { background: #eef4ff; color: #1d4ed8; }
.badge-master { background: #f3edff; color: #6d28d9; }
.badge-doctoral { background: #eafaf0; color: #15803d; }
.badge-associate { background: #fff6e5; color: #b45309; }
.badge-english { background: #e8fbf7; color: #0f766e; }
.badge-chinese { background: #fdecec; color: #b91c1c; }
.badge-other { background: #f3f4f6; color: #4b5563; }

/* Pagination */
.pagination { display: flex; gap: 6px; justify-content: center; margin: 32px 0 12px; flex-wrap: wrap; }
.pagination a, .pagination span {
  min-width: 38px; text-align: center; padding: 9px 10px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: #fff; color: var(--muted); font-size: 14px;
  transition: border-color .15s, color .15s;
}
.pagination .current { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 700; }
.pagination a:hover { border-color: rgba(225, 29, 46, .45); color: var(--brand); text-decoration: none; }

/* University grid */
.uni-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; margin-top: 20px; }
.uni-card {
  display: block; color: inherit; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-sm);
  transition: border-color .16s, transform .16s, box-shadow .16s;
}
.uni-card:hover { border-color: rgba(225, 29, 46, .4); box-shadow: var(--shadow-md); transform: translateY(-2px); color: inherit; }
.uni-card h3 { margin: 0 0 6px; font-size: 15.5px; font-weight: 700; letter-spacing: -.01em; }
.uni-card .city { color: var(--muted); font-size: 13px; }
.uni-card .count-chip {
  display: inline-block; margin-top: 12px; font-size: 12.5px; font-weight: 600; color: var(--text);
  border: 1px solid var(--line-2); background: var(--bg-soft); padding: 4px 10px; border-radius: 999px;
}
.uni-card .open-hint { display: block; margin-top: 10px; font-size: 12.5px; font-weight: 600; color: var(--brand); opacity: 0; transition: opacity .15s; }
.uni-card:hover .open-hint { opacity: 1; }
.uni-filter { max-width: 380px; margin-top: 6px; }

/* Detail pages */
.breadcrumbs { color: var(--faint); font-size: 13px; margin: 20px 0 0; }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--text); }
.detail-head { display: flex; justify-content: space-between; gap: 20px; align-items: flex-end; margin: 16px 0 22px; flex-wrap: wrap; }
.detail-head .meta { display: flex; gap: 8px; flex-wrap: wrap; }
.detail-head h1 { margin: 10px 0 6px; font-size: clamp(24px, 3.2vw, 34px); letter-spacing: -.02em; line-height: 1.15; font-weight: 800; }
.detail-head .sub { color: var(--muted); margin: 0; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 0 0 22px; }
.stat-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px;
  box-shadow: var(--shadow-sm);
}
.stat-card .stat-label { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.stat-card .stat-label svg { width: 14px; height: 14px; stroke: var(--faint); flex: none; }
.stat-card .stat-value { font-size: 18px; font-weight: 700; letter-spacing: -.01em; line-height: 1.35; word-break: break-word; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin: 0 0 18px; box-shadow: var(--shadow-sm); }
.panel h2 { margin: 0 0 14px; font-size: 17px; letter-spacing: -.01em; font-weight: 700; }
.panel .sub { color: var(--muted); margin: 0 0 18px; }
.detail-rows { display: grid; grid-template-columns: 1fr 1fr; gap: 0 32px; margin: 0; }
.detail-rows > div { display: flex; justify-content: space-between; gap: 12px; padding: 11px 2px; border-bottom: 1px solid var(--line); }
.detail-rows dt { color: var(--muted); font-size: 14px; }
.detail-rows dd { margin: 0; font-weight: 600; text-align: right; }
.cta-row { display: flex; gap: 10px; flex-wrap: wrap; }

/* Inquiry form */
.inquiry-section { margin-top: 26px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field-full { grid-column: 1 / -1; }
.field label { font-size: 13px; color: var(--muted); font-weight: 500; }
.inquiry-form textarea { resize: vertical; min-height: 110px; }
.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.inquiry-form .btn { margin-top: 16px; }
.form-note { color: var(--faint); font-size: 12.5px; margin: 10px 0 0; }
.alert { border-radius: var(--radius-sm); padding: 13px 16px; font-size: 14px; margin: 16px 0 0; border: 1px solid; }
.alert-success { background: #eafaf0; border-color: #b5e7c8; color: #166534; }
.alert-error { background: #fdecec; border-color: #f5c2c2; color: #991b1b; }

/* Apply page */
.apply-layout { display: grid; grid-template-columns: 1.6fr 1fr; gap: 18px; margin-top: 18px; align-items: start; }
.apply-aside { display: flex; flex-direction: column; gap: 18px; }
.apply-aside .panel { margin: 0; }
.check-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 11px; }
.check-list li { position: relative; padding-left: 26px; color: var(--muted); font-size: 14px; }
.check-list li::before {
  content: ''; position: absolute; left: 0; top: 4px; width: 15px; height: 15px; border-radius: 50%;
  background: var(--brand-soft); border: 1px solid rgba(225, 29, 46, .4);
}
.check-list li::after {
  content: ''; position: absolute; left: 5px; top: 8px; width: 5px; height: 8px;
  border-right: 2px solid var(--brand); border-bottom: 2px solid var(--brand); transform: rotate(40deg);
}

/* About page */
.about-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 18px; margin-top: 18px; align-items: start; }
.about-copy p { color: var(--muted); margin: 0 0 14px; }
.about-copy strong { color: var(--text); }
.office-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.office-list li { border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.office-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.office-list strong { display: block; font-size: 14px; }
.office-list span { color: var(--muted); font-size: 13.5px; display: block; margin-top: 2px; }
.office-list a { color: var(--brand); }
.about-photo { width: 100%; border-radius: var(--radius); border: 1px solid var(--line); display: block; }
.service-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.service-item { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; font-size: 14px; font-weight: 600; background: var(--bg-soft); }

/* Footer */
.site-footer { border-top: 1px solid var(--line); background: var(--bg-soft); margin-top: 64px; position: relative; z-index: 1; }
.footer-inner { display: grid; grid-template-columns: auto 1fr; gap: 18px 40px; padding-top: 30px; padding-bottom: 36px; align-items: start; }
.footer-brand { display: flex; align-items: center; gap: 12px; }
.footer-brand img { border-radius: 50%; }
.footer-brand strong { display: block; font-size: 15px; }
.footer-brand span { color: var(--muted); font-size: 13px; }
.footer-links { display: flex; gap: 20px; justify-content: flex-end; flex-wrap: wrap; font-size: 13.5px; }
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--text); }
.footer-note { grid-column: 1 / -1; color: var(--faint); font-size: 12.5px; margin: 4px 0 0; max-width: 920px; }

/* Responsive */
@media (max-width: 960px) {
  .stat-strip { grid-template-columns: repeat(2, 1fr); }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .filters { grid-template-columns: 1fr 1fr; }
  .course-card { grid-template-columns: 1fr; }
  .course-card .right { text-align: left; }
  .detail-rows { grid-template-columns: 1fr; }
  .apply-layout, .about-grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
  .footer-links { justify-content: flex-start; }
}
@media (max-width: 620px) {
  .filters { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .nav { gap: 14px; font-size: 13px; }
  .nav-hide-sm { display: none; }
  .brand-logo { height: 40px; }
  .hero { padding-top: 38px; }
}

/* Dashboard (/dashboard) */
.dash { padding-top: 30px; }
.dash h1 { margin: 0 0 6px; font-size: 30px; letter-spacing: -.02em; font-weight: 800; }
.dash .sub { color: var(--muted); font-size: 14px; margin: 0 0 20px; }
.dash .sub a { color: var(--brand); }
.dash-login { display: flex; justify-content: center; padding: 70px 0; }
.login-card {
  width: 100%; max-width: 380px; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow-md);
}
.login-card h1 { margin: 0 0 6px; font-size: 24px; }
.login-card .sub { color: var(--muted); font-size: 13px; margin: 0 0 18px; }
.login-error { color: var(--brand); font-size: 13px; margin: 0 0 12px; font-weight: 600; }
.dash-status {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 20px; box-shadow: var(--shadow-sm); margin-bottom: 16px;
}
.dash-status .sub { margin: 0; font-size: 13px; color: var(--faint); }
.status-badge {
  display: inline-block; font-size: 11.5px; font-weight: 700; letter-spacing: .07em;
  text-transform: uppercase; padding: 5px 11px; border-radius: 999px; white-space: nowrap;
}
.status-badge.ok { background: rgba(16, 185, 129, .12); color: #047857; }
.status-badge.check { background: rgba(245, 158, 11, .16); color: #b45309; }
.status-badge.alert { background: var(--brand-soft); color: var(--brand-2); }
.dash-alert {
  background: var(--brand-soft); border: 1px solid rgba(225, 29, 46, .25);
  border-radius: var(--radius-sm); padding: 14px 16px; margin-bottom: 16px; font-size: 14px;
}
.dash-alert ul { margin: 8px 0 0; padding-left: 18px; }
.dash-delta { font-weight: 700; font-variant-numeric: tabular-nums; }
.dash-delta.up { color: #047857; }
.dash-delta.down { color: var(--brand-2); }
.dash-delta.flat { color: var(--faint); font-weight: 500; }
.dash-panel { margin-top: 16px; }
.dash-panel h2 { display: flex; align-items: baseline; gap: 10px; margin: 0 0 12px; font-size: 17px; }
.dash-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.dash-table th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--faint); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.dash-table td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.dash-table tr:last-child td { border-bottom: 0; }
.dash-table .num, .dash-table td.num { font-variant-numeric: tabular-nums; }
.dash-table td.muted { color: var(--muted); }
.table-scroll { overflow-x: auto; }
.dash-bars { display: flex; align-items: flex-end; gap: 3px; height: 84px; margin: 8px 0 6px; }
.dash-bar { flex: 1; min-width: 3px; background: rgba(225, 29, 46, .22); border-radius: 3px 3px 0 0; transition: background .15s; }
.dash-bar:hover { background: var(--brand); }
@media (max-width: 620px) {
  .dash-status { align-items: flex-start; }
}

