/* 山东2026高考志愿智能填报系统 - 样式 */

:root {
    --primary: #2563eb;
    --success: #16a34a;
    --warning: #f59e0b;
    --danger: #dc2626;
    --info: #0891b2;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background-color: #f8f9fa;
}

.hero-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 1rem;
    padding: 3rem 2rem;
}

.hero-section .lead {
    color: rgba(255,255,255,0.85) !important;
}

.step-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
}

.card {
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 .5rem 1.5rem rgba(0,0,0,.1) !important;
}

/* 策略标签 */
.badge-chong { background-color: var(--danger); }
.badge-wen { background-color: var(--primary); }
.badge-bao { background-color: var(--success); }

/* 推荐结果表格 */
.recommend-table .strategy-chong { border-left: 4px solid var(--danger); }
.recommend-table .strategy-wen { border-left: 4px solid var(--primary); }
.recommend-table .strategy-bao { border-left: 4px solid var(--success); }

/* 五维画像卡片 */
.portrait-card {
    border: 2px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 1.5rem;
    transition: border-color 0.2s;
}

.portrait-card:hover {
    border-color: var(--primary);
}

.portrait-card .icon {
    font-size: 2rem;
    color: var(--primary);
}

/* 搜索结果 */
.search-result-item {
    border-bottom: 1px solid #e5e7eb;
    padding: 0.75rem 0;
}

.search-result-item:hover {
    background-color: #f0f9ff;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .hero-section {
        padding: 2rem 1rem;
    }
    .hero-section h1 {
        font-size: 1.5rem;
    }
    .step-circle {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
}

/* 加载动画 */
.loading-spinner {
    display: inline-block;
    width: 2rem;
    height: 2rem;
    border: 3px solid rgba(0,0,0,.1);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 张雪峰页面 */
.quote-card {
    border-left: 4px solid var(--warning);
    background: linear-gradient(to right, #fffbeb, transparent);
}

/* 政策页面时间线 */
.timeline-item {
    position: relative;
    padding-left: 2rem;
    padding-bottom: 1.5rem;
    border-left: 2px solid #e5e7eb;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -7px;
    top: 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary);
}

.timeline-item:last-child {
    border-left: none;
}
/* ============================================
   山东2026高考志愿智能填报系统 - 移动端H5适配
   仅在 max-width: 767.98px 时生效
   ============================================ */

@media (max-width: 767.98px) {

  /* ---- 全局基础 ---- */
  body {
    padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px) + 12px);
    font-size: 15px;
    -webkit-text-size-adjust: 100%;
    overflow-x: hidden;
  }

  /* ---- 移动端紧凑顶栏 ---- */
  .mobile-top-bar {
    display: flex !important;
    align-items: center;
    height: 44px;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    color: white;
    padding: 0 16px;
    position: sticky;
    top: 0;
    z-index: 1029;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
  }
  .mobile-top-bar .top-logo {
    font-size: 1.1rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .mobile-top-bar .top-logo i {
    margin-right: 6px;
  }

  /* 隐藏桌面端navbar */
  .navbar {
    display: none !important;
  }

  /* ---- 底部Tab导航栏 ---- */
  .mobile-bottom-nav {
    display: flex !important;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(56px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: #ffffff;
    border-top: 1px solid #e5e7eb;
    z-index: 1030;
    justify-content: space-around;
    align-items: stretch;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.06);
  }

  .mobile-bottom-nav .nav-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #6b7280;
    font-size: 0.65rem;
    transition: color 0.2s;
    min-height: 48px;
    -webkit-tap-highlight-color: rgba(0,0,0,0.05);
    position: relative;
  }

  .mobile-bottom-nav .nav-tab i {
    font-size: 1.3rem;
    margin-bottom: 2px;
    transition: transform 0.2s;
  }

  .mobile-bottom-nav .nav-tab span {
    line-height: 1;
  }

  .mobile-bottom-nav .nav-tab.active {
    color: #2563eb;
    font-weight: 600;
  }

  .mobile-bottom-nav .nav-tab.active i {
    transform: scale(1.15);
  }

  .mobile-bottom-nav .nav-tab.active::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 3px;
    background: #2563eb;
    border-radius: 0 0 3px 3px;
  }

  /* 通过 body[data-page] 控制高亮 */
  body[data-page="home"] .mobile-bottom-nav .nav-tab[data-page="home"],
  body[data-page="recommend"] .mobile-bottom-nav .nav-tab[data-page="recommend"],
  body[data-page="search"] .mobile-bottom-nav .nav-tab[data-page="search"],
  body[data-page="methodology"] .mobile-bottom-nav .nav-tab[data-page="methodology"],
  body[data-page="policy"] .mobile-bottom-nav .nav-tab[data-page="policy"] {
    color: #2563eb;
    font-weight: 600;
  }

  body[data-page="home"] .mobile-bottom-nav .nav-tab[data-page="home"] i,
  body[data-page="recommend"] .mobile-bottom-nav .nav-tab[data-page="recommend"] i,
  body[data-page="search"] .mobile-bottom-nav .nav-tab[data-page="search"] i,
  body[data-page="methodology"] .mobile-bottom-nav .nav-tab[data-page="methodology"] i,
  body[data-page="policy"] .mobile-bottom-nav .nav-tab[data-page="policy"] i {
    transform: scale(1.15);
  }

  body[data-page="home"] .mobile-bottom-nav .nav-tab[data-page="home"]::after,
  body[data-page="recommend"] .mobile-bottom-nav .nav-tab[data-page="recommend"]::after,
  body[data-page="search"] .mobile-bottom-nav .nav-tab[data-page="search"]::after,
  body[data-page="methodology"] .mobile-bottom-nav .nav-tab[data-page="methodology"]::after,
  body[data-page="policy"] .mobile-bottom-nav .nav-tab[data-page="policy"]::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 3px;
    background: #2563eb;
    border-radius: 0 0 3px 3px;
  }

  /* ---- Hero区域 ---- */
  .hero-section {
    padding: 1.5rem 1rem !important;
    border-radius: 0.75rem !important;
    margin-left: -4px;
    margin-right: -4px;
  }
  .hero-section h1,
  .hero-section .display-5 {
    font-size: 1.4rem !important;
    line-height: 1.4;
  }
  .hero-section .lead {
    font-size: 0.85rem !important;
    margin-top: 0.5rem;
  }
  .hero-section .btn {
    display: block;
    width: 100%;
    margin: 0.5rem 0 !important;
    font-size: 0.95rem;
    min-height: 48px;
  }
  .hero-section .mt-4 {
    margin-top: 1rem !important;
  }

  /* ---- 标题缩放 ---- */
  h2 {
    font-size: 1.3rem !important;
  }
  h3 {
    font-size: 1.15rem !important;
  }
  h4 {
    font-size: 1.1rem !important;
  }
  h5 {
    font-size: 1rem !important;
  }
  .card-header h5 {
    font-size: 0.95rem !important;
  }

  /* ---- 容器间距 ---- */
  .container {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  .container.py-4,
  main.container.py-4 {
    padding-top: 0.75rem !important;
    padding-bottom: 0.75rem !important;
  }

  /* ---- 卡片 ---- */
  .card {
    margin-bottom: 0.75rem !important;
    border-radius: 0.75rem !important;
  }
  .card-body {
    padding: 0.875rem !important;
  }
  .card-header {
    padding: 0.625rem 0.875rem !important;
  }

  /* ---- 网格间距缩小 ---- */
  .row.g-4 {
    --bs-gutter-x: 0.5rem;
    --bs-gutter-y: 0.5rem;
  }
  .row.g-3 {
    --bs-gutter-x: 0.5rem;
    --bs-gutter-y: 0.5rem;
  }

  /* 核心数据卡片 - 手机端2列紧凑 */
  .col-6 .card-body .display-4 {
    font-size: 1.8rem !important;
  }
  .col-6 .card-body h3 {
    font-size: 1.3rem !important;
  }
  .col-6 .card-body p {
    font-size: 0.75rem !important;
  }

  /* ---- 表格转卡片 ---- */
  .table-responsive-mobile table thead {
    display: none;
  }

  .table-responsive-mobile table tr {
    display: block;
    border: 1px solid #dee2e6;
    border-radius: 10px;
    margin-bottom: 12px;
    padding: 12px 14px;
    background: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  }

  .table-responsive-mobile table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: none;
    padding: 5px 0;
    font-size: 0.85rem;
    gap: 8px;
  }

  .table-responsive-mobile table td::before {
    content: attr(data-label);
    font-weight: 600;
    color: #6b7280;
    flex-shrink: 0;
    font-size: 0.8rem;
    min-width: 70px;
  }

  .table-responsive-mobile table td strong {
    text-align: right;
  }

  /* 通用横向滚动兜底 */
  .table-responsive {
    -webkit-overflow-scrolling: touch;
  }

  /* ---- 表单全宽竖排 ---- */
  .form-control,
  .form-select {
    font-size: 16px !important; /* 防止iOS缩放 */
    min-height: 48px;
    border-radius: 8px;
  }

  .form-control-lg,
  .form-select-lg {
    min-height: 52px;
    font-size: 17px !important;
  }

  .form-label {
    font-size: 0.85rem;
    margin-bottom: 4px;
  }

  /* 表单内的col全部改为100%宽 */
  .card-body .row > [class*="col-"] {
    flex: 0 0 100%;
    max-width: 100%;
    margin-bottom: 0.5rem;
  }

  /* 五维画像卡片移动端优化 */
  .col-md-6.col-lg-4 {
    flex: 0 0 100%;
    max-width: 100%;
  }

  .portrait-card {
    padding: 1rem !important;
  }
  .portrait-card .icon {
    font-size: 1.5rem;
  }

  /* ---- 按钮 ---- */
  .btn {
    min-height: 44px;
    border-radius: 8px;
    font-size: 0.9rem;
  }

  .btn-lg {
    min-height: 52px;
    font-size: 1rem;
    padding: 0.625rem 1.25rem;
  }

  /* 生成按钮全宽 */
  #btnRecommend {
    width: 100%;
    font-size: 1rem;
  }

  /* 搜索/重置按钮 */
  .card-body .mt-3 .btn {
    flex: 1;
  }
  .card-body .mt-3 {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }
  .card-body .mt-3 .ms-2 {
    margin-left: 0 !important;
  }
  .card-body .mt-3 .ms-3 {
    margin-left: 0 !important;
    flex-basis: 100%;
    text-align: center;
    font-size: 0.85rem;
  }

  /* ---- 五维画像区域 ---- */
  .col-md-6.col-lg-4 .portrait-card h6 {
    font-size: 0.9rem;
  }
  .col-md-6.col-lg-4 .portrait-card small {
    font-size: 0.75rem;
  }

  /* ---- 冲稳保策略卡片 ---- */
  .col-md-4 .card-body h3 {
    font-size: 1.5rem !important;
  }
  .col-md-4 .card-body p {
    font-size: 0.8rem;
  }
  .col-md-4 .card-body small {
    font-size: 0.7rem;
  }

  /* ---- 决策五步法 ---- */
  .step-circle {
    width: 36px !important;
    height: 36px !important;
    font-size: 0.95rem !important;
  }
  .row.text-center .col h6 {
    font-size: 0.75rem;
  }
  .row.text-center .col small {
    font-size: 0.65rem;
  }

  /* ---- 分数线展示 ---- */
  .card-body .row.text-center h2,
  .card-body .row.text-center h3 {
    font-size: 1.8rem !important;
  }
  .card-body .row.text-center p {
    font-size: 0.8rem;
  }
  .card-body .row.text-center small {
    font-size: 0.7rem;
  }

  /* ---- 时间线 ---- */
  .timeline-item {
    padding-left: 1.25rem;
    padding-bottom: 1rem;
  }
  .timeline-item h6 {
    font-size: 0.9rem;
  }
  .timeline-item p {
    font-size: 0.8rem;
  }

  /* ---- 注意事项列表 ---- */
  .col-md-6 ul {
    padding-left: 1.25rem;
    font-size: 0.85rem;
  }
  .col-md-6 li {
    margin-bottom: 0.35rem;
  }

  /* ---- 推荐/预警专业列表 ---- */
  .list-group-item {
    font-size: 0.82rem;
    padding: 0.5rem 0.75rem;
  }

  /* ---- 行业前景卡片 ---- */
  .col-md-4 .card .card-body h6 {
    font-size: 0.9rem;
  }
  .col-md-4 .card .card-body p {
    font-size: 0.8rem;
  }
  .col-md-4 .card .card-body small {
    font-size: 0.7rem;
  }

  /* ---- 分页 ---- */
  .pagination {
    flex-wrap: wrap;
    justify-content: center;
  }
  .page-link {
    padding: 0.35rem 0.6rem;
    font-size: 0.8rem;
    min-height: 36px;
    min-width: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* ---- 页脚 ---- */
  footer {
    padding: 1.5rem 1rem !important;
    margin-bottom: 0 !important;
  }
  footer p {
    font-size: 0.75rem;
  }

  /* ---- 核心功能卡片 ---- */
  .col-md-6 .card .card-body .card-title {
    font-size: 0.95rem;
  }
  .col-md-6 .card .card-body .card-text {
    font-size: 0.82rem;
  }
  .col-md-6 .card .card-body ul.small li {
    font-size: 0.78rem;
  }
  .col-md-6 .card .card-body .btn {
    width: 100%;
  }

  /* ---- 五维画像表格转卡片 ---- */
  .table-bordered thead {
    display: none;
  }
  .table-bordered tr {
    display: block;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    margin-bottom: 10px;
    padding: 10px;
    background: white;
  }
  .table-bordered td {
    display: block;
    border: none;
    padding: 4px 0;
    font-size: 0.82rem;
  }
  .table-bordered td:first-child {
    font-weight: 700;
    color: #2563eb;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 4px;
    padding-bottom: 6px;
  }

  /* ---- 批次表格转卡片 ---- */
  .card-body > .table-bordered:not(.table-responsive-mobile *) {
    /* 上面的通用规则已覆盖 */
  }

  /* ---- Alert 提示框 ---- */
  .alert {
    font-size: 0.85rem;
    padding: 0.75rem;
    border-radius: 8px;
  }

  /* ---- 决策摘要 ---- */
  .badge.fs-6 {
    font-size: 0.8rem !important;
    padding: 0.35rem 0.6rem;
  }
  #adviceBox {
    font-size: 0.82rem;
  }

  /* ---- 免责声明 ---- */
  .alert-secondary small {
    font-size: 0.75rem;
  }

  /* ---- 核心理念 quote-card ---- */
  .quote-card {
    padding: 0.75rem !important;
    margin-bottom: 0.5rem !important;
  }
  .quote-card h6 {
    font-size: 0.85rem;
  }
  .quote-card p {
    font-size: 0.8rem;
  }

  /* ---- 数据来源 ---- */
  .card-body ul.small {
    font-size: 0.75rem;
  }

  /* ---- 分数线页面4列变2列 ---- */
  .card-body .row.text-center.g-4 > [class*="col-"] {
    flex: 0 0 50%;
    max-width: 50%;
  }

  /* ---- input-group 搜索框 ---- */
  .input-group {
    flex-wrap: nowrap;
  }
  .input-group .form-control {
    min-width: 0;
  }

  /* ---- 结果数量提示 ---- */
  #resultCount {
    display: block;
    width: 100%;
    text-align: center;
    margin-top: 0.5rem;
  }
}

/* ---- 桌面端隐藏移动端组件 ---- */
.mobile-top-bar {
  display: none;
}

.mobile-bottom-nav {
  display: none;
}

/* ---- 超小屏幕 (<375px) 额外优化 ---- */
@media (max-width: 374.98px) {
  .hero-section h1 {
    font-size: 1.2rem !important;
  }
  .hero-section .lead {
    font-size: 0.75rem !important;
  }
  .mobile-bottom-nav .nav-tab {
    font-size: 0.6rem;
  }
  .mobile-bottom-nav .nav-tab i {
    font-size: 1.1rem;
  }
}

/* ===== 统一导航栏样式 ===== */

/* 7项导航栏紧凑排版 */
.site-navbar .navbar-nav .nav-link {
  padding: 0.5rem 0.65rem !important;
  font-size: 0.9rem;
  white-space: nowrap;
  transition: background 0.2s;
}

.site-navbar .navbar-nav .nav-link:hover {
  background: rgba(255,255,255,0.15);
  border-radius: 4px;
}

/* 只有active项高亮，其他不亮 */
.site-navbar .navbar-nav .nav-link.active {
  background: rgba(255,255,255,0.2);
  border-radius: 4px;
  font-weight: 600;
}

/* 导航栏图标 */
.site-navbar .navbar-nav .nav-link i {
  margin-right: 3px;
  font-size: 0.95rem;
}

/* 导航栏品牌 */
.site-navbar .navbar-brand {
  font-size: 1rem;
  white-space: nowrap;
}

/* 小屏适配：7项导航栏 */
@media (max-width: 991.98px) {
  .site-navbar .navbar-nav .nav-link {
    padding: 0.4rem 0.5rem;
    font-size: 0.85rem;
  }
  .site-navbar .navbar-brand {
    font-size: 0.9rem;
  }
}

/* 中等屏幕（平板）：允许缩小间距 */
@media (min-width: 768px) and (max-width: 1024px) {
  .site-navbar .navbar-nav .nav-link {
    padding: 0.4rem 0.45rem;
    font-size: 0.82rem;
  }
  .site-navbar .navbar-brand {
    font-size: 0.85rem;
  }
}

/* 移动端底部导航 - 7项等分 */
.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-around;
  background: #fff;
  border-top: 1px solid #e0e0e0;
  padding: 4px 0;
  padding-bottom: max(4px, env(safe-area-inset-bottom));
  z-index: 1000;
}

.mobile-bottom-nav .nav-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: #888;
  font-size: 0.65rem;
  padding: 2px 4px;
  flex: 1;
  min-width: 0;
}

.mobile-bottom-nav .nav-tab i {
  font-size: 1.2rem;
  margin-bottom: 1px;
}

.mobile-bottom-nav .nav-tab.active {
  color: #0d6efd;
  font-weight: 600;
}

.mobile-bottom-nav .nav-tab.active i {
  color: #0d6efd;
}

/* 移动端底部导航7项缩小 */
@media (max-width: 576px) {
  .mobile-bottom-nav .nav-tab {
    font-size: 0.58rem;
  }
  .mobile-bottom-nav .nav-tab i {
    font-size: 1.1rem;
  }
}

/* 超小屏滚动底部导航 */
@media (max-width: 360px) {
  .mobile-bottom-nav {
    overflow-x: auto;
    justify-content: flex-start;
    padding: 4px 8px;
  }
  .mobile-bottom-nav .nav-tab {
    flex: 0 0 auto;
    min-width: 48px;
    padding: 2px 6px;
  }
}

/* 页面内容留底边距（移动端底部导航高度） */
@media (max-width: 991.98px) {
  main.container {
    padding-bottom: 70px;
  }
}
