/* ============================================================
   新盈学校 H5 - 全局样式
   Design Tokens 与小程序保持一致
   ============================================================ */

:root {
  /* 品牌色 */
  --brand: #1E5AA8;
  --brand-dark: #174A8A;
  --brand-light: #3D74C4;
  --accent: #F0A22E;
  --accent-light: #FFB94E;

  /* 功能色 */
  --success: #12A150;
  --danger: #E5484D;
  --info: #36BFFA;

  /* 文字 */
  --text-1: #17233D;
  --text-2: #4A5B75;
  --text-3: #8A94A6;
  --text-inv: #FFFFFF;

  /* 背景 */
  --bg-page: #F6F8FB;
  --bg-card: #FFFFFF;
  --bg-tap: #F0F4F9;
  --bg-tag: #EEF2F7;

  /* 边框/阴影 */
  --border: #E8EDF3;
  --shadow-card: 0 4px 20px rgba(30, 58, 95, 0.06);
  --shadow-tab: 0 -2px 12px rgba(30, 58, 95, 0.06);

  /* 圆角 */
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-full: 999px;

  /* 尺寸 */
  --tabbar-h: 56px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  /* 字体 */
  --ff: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: 100%;
  font-family: var(--ff);
  font-size: 14px;
  color: var(--text-1);
  background: #E9EEF4;
  -webkit-font-smoothing: antialiased;
}

/* 桌面端：手机框居中 */
body {
  display: flex;
  justify-content: center;
  background: linear-gradient(180deg, #DDE5F0 0%, #EDF1F7 100%);
  min-height: 100vh;
}

#app {
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  background: var(--bg-page);
  position: relative;
  padding-bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 16px);
  overflow-x: hidden;
}

/* 桌面端给阴影 */
@media (min-width: 481px) {
  #app {
    box-shadow: 0 0 60px rgba(30, 58, 95, 0.12);
    min-height: 100vh;
  }
  #tabbar {
    max-width: 480px;
  }
  .toast, .loading-overlay {
    max-width: 480px;
    margin: 0 auto;
  }
}

/* ---------- 通用 ---------- */
.page {
  padding: 16px 16px 24px;
}

.card {
  background: var(--bg-card);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
}

.sec-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 20px 0 12px;
}
.sec-title .t {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-1);
}
.sec-title .more {
  font-size: 13px;
  color: var(--text-3);
}

.footer {
  text-align: center;
  font-size: 11px;
  color: var(--text-3);
  margin-top: 24px;
  padding-bottom: 8px;
}

/* ---------- TabBar ---------- */
.tabbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(var(--tabbar-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-tab);
  display: flex;
  z-index: 100;
}
.tabbar .tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--text-3);
  font-size: 10px;
  cursor: pointer;
  transition: color 0.15s;
}
.tabbar .tab svg {
  width: 24px;
  height: 24px;
}
.tabbar .tab.active {
  color: var(--brand);
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  top: 35%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(23, 35, 61, 0.88);
  color: #fff;
  padding: 12px 24px;
  border-radius: var(--r-md);
  font-size: 14px;
  z-index: 999;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
  max-width: 300px;
  text-align: center;
  white-space: pre-line;
}
.toast.show {
  opacity: 1;
}

/* ---------- Loading ---------- */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 998;
}
.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(30, 90, 168, 0.2);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   首页
   ============================================================ */
.hero {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-light) 100%);
  border-radius: var(--r-lg);
  padding: 28px 24px 24px;
  color: #fff;
  margin-bottom: 16px;
}
.hero .school {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.hero .logo {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  background: rgba(255, 255, 255, 0.1);
}
.hero .school-name .cn {
  display: block;
  font-size: 18px;
  font-weight: 700;
}
.hero .school-name .en {
  display: block;
  font-size: 10px;
  opacity: 0.7;
  letter-spacing: 0.5px;
}
.hero .slogan {
  font-size: 15px;
  line-height: 1.7;
  margin-bottom: 6px;
}
.hero .slogan .em {
  color: #FFD680;
  font-weight: 600;
}
.hero .sub {
  font-size: 12px;
  opacity: 0.8;
  margin-bottom: 18px;
}
.hero .cta-row {
  display: flex;
  gap: 10px;
}
.hero .cta {
  flex: 1;
  height: 40px;
  line-height: 40px;
  text-align: center;
  border-radius: var(--r-full);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}
.hero .cta:active { opacity: 0.8; }
.hero .cta-solid {
  background: var(--accent);
  color: #5a3d00;
}
.hero .cta-ghost {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
}

/* 数据卡 */
.stats {
  display: flex;
  text-align: center;
  padding: 20px 0;
  margin-bottom: 16px;
}
.stats .st {
  flex: 1;
}
.stats .num {
  font-size: 28px;
  font-weight: 800;
  color: var(--brand);
}
.stats .unit {
  font-size: 13px;
  font-weight: 600;
}
.stats .label {
  display: block;
  font-size: 12px;
  color: var(--text-3);
  margin-top: 4px;
}

/* 公告 */
.notice {
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(90deg, #FFF8EC, #FFF3E0);
  border-radius: var(--r-md);
  padding: 12px 16px;
  margin-bottom: 16px;
}
.notice .tag {
  background: var(--accent);
  color: #5a3d00;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--r-sm);
  flex-shrink: 0;
}
.notice .txt {
  font-size: 13px;
  color: #8a6d3b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 宫格 */
.grid-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1px;
  background: var(--bg-card);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  margin-bottom: 4px;
}
.grid-nav .gn {
  width: calc(25% - 1px);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 0;
  background: var(--bg-card);
  cursor: pointer;
  transition: background 0.1s;
}
.grid-nav .gn:active { background: var(--bg-tap); }
.grid-nav .gi {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}
.grid-nav .gl {
  font-size: 12px;
  color: var(--text-2);
}

/* 新闻卡 */
.news-card {
  display: flex;
  gap: 12px;
  padding: 14px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: background 0.1s;
}
.news-card:active { background: var(--bg-tap); }
.news-card .thumb {
  width: 100px;
  height: 72px;
  border-radius: var(--r-md);
  flex-shrink: 0;
}
.news-card .nc-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}
.news-card .nc-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-1);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.news-card .nc-meta {
  display: flex;
  gap: 10px;
  align-items: center;
}
.news-card .cat {
  font-size: 11px;
  color: var(--brand);
  background: rgba(30, 90, 168, 0.08);
  padding: 2px 8px;
  border-radius: var(--r-sm);
}
.news-card .date {
  font-size: 11px;
  color: var(--text-3);
}

/* ============================================================
   专业大全
   ============================================================ */
.filter-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 16px 0 12px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.filter-bar::-webkit-scrollbar { display: none; }
.filter-bar .chip {
  flex-shrink: 0;
  padding: 7px 18px;
  border-radius: var(--r-full);
  font-size: 13px;
  color: var(--text-2);
  background: var(--bg-card);
  cursor: pointer;
  transition: all 0.15s;
}
.filter-bar .chip.active {
  background: var(--brand);
  color: #fff;
  font-weight: 600;
}

.major-card {
  display: flex;
  gap: 14px;
  padding: 16px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: background 0.1s;
}
.major-card:active { background: var(--bg-tap); }
.major-card .mc-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}
.major-card .mc-body {
  flex: 1;
  overflow: hidden;
}
.major-card .mc-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 4px;
}
.major-card .mc-intro {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 8px;
}
.major-card .mc-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: var(--r-sm);
  font-weight: 500;
}
.tag-up { background: rgba(30, 90, 168, 0.08); color: var(--brand); }
.tag-job { background: rgba(18, 161, 80, 0.08); color: var(--success); }
.tag-hot { background: rgba(240, 162, 46, 0.1); color: var(--accent); }

/* ============================================================
   专业详情
   ============================================================ */
.detail-cover {
  height: 200px;
  border-radius: var(--r-lg);
  display: flex;
  align-items: flex-end;
  padding: 20px;
  margin-bottom: 16px;
}
.detail-cover .dc-cat {
  background: rgba(255, 255, 255, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.5);
  color: #fff;
  font-size: 12px;
  padding: 4px 12px;
  border-radius: var(--r-full);
  backdrop-filter: blur(8px);
}
.detail-card {
  padding: 24px 20px;
  margin-bottom: 12px;
}
.detail-card h2 {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-1);
  margin-bottom: 14px;
}
.detail-card .txt {
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.8;
  text-align: justify;
}
.path-row {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}
.path-item {
  flex: 1;
  background: linear-gradient(180deg, #F3F7FD, #EDF3FB);
  border-radius: var(--r-md);
  padding: 14px 8px;
  text-align: center;
}
.path-item .pi-t {
  font-size: 13px;
  font-weight: 700;
  color: var(--brand);
  margin-bottom: 4px;
}
.path-item .pi-d {
  font-size: 11px;
  color: var(--text-2);
  white-space: pre-line;
  line-height: 1.5;
}
.course-list {
  font-size: 14px;
  color: var(--text-2);
  line-height: 2;
}
.course-list .sep { color: var(--text-3); margin: 0 4px; }

/* 悬浮报名栏 */
.float-apply {
  position: fixed;
  bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 12px);
  left: 16px;
  right: 16px;
  max-width: 448px;
  margin: 0 auto;
  display: flex;
  gap: 10px;
  z-index: 50;
}
.float-apply .fa-call {
  width: 52px;
  height: 52px;
  border-radius: var(--r-md);
  background: rgba(30, 90, 168, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  cursor: pointer;
  flex-shrink: 0;
}
.float-apply .fa-btn {
  flex: 1;
  height: 52px;
  line-height: 52px;
  text-align: center;
  border-radius: var(--r-md);
  background: var(--brand);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

/* ============================================================
   报名
   ============================================================ */
.form-card {
  padding: 24px 20px;
  margin-bottom: 12px;
}
.form-group {
  margin-bottom: 20px;
}
.form-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: 8px;
}
.form-label .req { color: var(--danger); }
.form-input, .form-select, .form-textarea {
  width: 100%;
  height: 48px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  padding: 0 16px;
  font-size: 15px;
  color: var(--text-1);
  background: #FAFBFD;
  outline: none;
  transition: border-color 0.15s;
  font-family: var(--ff);
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--brand);
}
.form-textarea {
  height: 90px;
  padding: 12px 16px;
  resize: none;
  line-height: 1.6;
}
.form-hint {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 6px;
}
.form-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.6;
  margin-bottom: 16px;
}
.form-check .cb {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-radius: 4px;
  flex-shrink: 0;
  margin-top: 1px;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
}
.form-check .cb.checked {
  background: var(--brand);
  border-color: var(--brand);
}
.form-check .cb.checked::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 1px;
  width: 4px;
  height: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.btn-submit {
  width: 100%;
  height: 50px;
  border: none;
  border-radius: var(--r-md);
  background: var(--brand);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
  font-family: var(--ff);
}
.btn-submit:active { opacity: 0.85; }
.btn-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* 成功态 */
.success-card {
  text-align: center;
  padding: 40px 24px;
}
.success-card .icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 20px;
  background: rgba(18, 161, 80, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
}
.success-card h2 {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 8px;
}
.success-card .s-desc {
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.8;
  margin-bottom: 24px;
  white-space: pre-line;
}
.success-card .s-actions {
  display: flex;
  gap: 10px;
}
.success-card .s-btn {
  flex: 1;
  height: 46px;
  line-height: 46px;
  border-radius: var(--r-md);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.success-card .s-btn-primary {
  background: var(--brand);
  color: #fff;
}
.success-card .s-btn-ghost {
  background: rgba(30, 90, 168, 0.08);
  color: var(--brand);
}

/* ============================================================
   我的
   ============================================================ */
.profile-header {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-light) 100%);
  border-radius: var(--r-lg);
  padding: 24px 20px;
  color: #fff;
  margin-bottom: 16px;
}
.profile-header .avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
}
.profile-header .name {
  font-size: 18px;
  font-weight: 700;
}
.profile-header .sub {
  font-size: 12px;
  opacity: 0.8;
  margin-top: 2px;
}

.my-list .item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  cursor: pointer;
  transition: background 0.1s;
  border-bottom: 1px solid var(--border);
}
.my-list .item:last-child { border-bottom: none; }
.my-list .item:active { background: var(--bg-tap); }
.my-list .item .icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.my-list .item .label {
  flex: 1;
  font-size: 15px;
  color: var(--text-1);
}
.my-list .item .arrow {
  color: var(--text-3);
  font-size: 14px;
}

.record-card {
  padding: 14px 16px;
  margin-bottom: 8px;
}
.record-card .rc-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.record-card .rc-major {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-1);
}
.record-card .rc-status {
  font-size: 12px;
  padding: 2px 10px;
  border-radius: var(--r-sm);
  background: rgba(240, 162, 46, 0.1);
  color: var(--accent);
}
.record-card .rc-info {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.6;
}
.record-card .rc-date {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 4px;
}

.empty {
  text-align: center;
  padding: 40px 0;
  color: var(--text-3);
  font-size: 14px;
}
.empty .emoji {
  font-size: 40px;
  margin-bottom: 8px;
}

/* ============================================================
   新闻详情
   ============================================================ */
.news-cover {
  height: 200px;
  border-radius: var(--r-lg);
  display: flex;
  align-items: flex-end;
  padding: 20px;
  margin-bottom: 16px;
}
.news-cover .nc-cat {
  background: rgba(255, 255, 255, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.5);
  color: #fff;
  font-size: 12px;
  padding: 4px 12px;
  border-radius: var(--r-full);
}
.news-body {
  padding: 28px 22px;
  margin-bottom: 12px;
}
.news-body .title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-1);
  line-height: 1.5;
  margin-bottom: 12px;
}
.news-body .meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-3);
  margin-bottom: 16px;
}
.news-body .divider {
  height: 1px;
  background: var(--border);
  margin-bottom: 16px;
}
.news-body .summary {
  display: flex;
  gap: 8px;
  background: #F3F7FD;
  border-radius: var(--r-md);
  padding: 14px;
  margin-bottom: 16px;
}
.news-body .sum-tag {
  flex-shrink: 0;
  color: var(--brand);
  font-weight: 600;
  font-size: 13px;
}
.news-body .sum-txt {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.7;
}
.news-body .para {
  font-size: 15px;
  color: var(--text-2);
  line-height: 1.9;
  margin-bottom: 16px;
  text-align: justify;
}

/* 返回按钮（详情页） */
.back-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  cursor: pointer;
  font-size: 14px;
  color: var(--brand);
}

/* 动画 */
.fade-in {
  animation: fadeIn 0.25s ease;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
