/* ===== 思索升学 - 全新设计系统 ===== */

/* Google Font: Noto Sans SC (Chinese + Latin) */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@300;400;500;600;700;800;900&display=swap');

:root {
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --primary-light: #eef2ff;
  --primary-50: #f5f6ff;
  --accent: #f59e0b;
  --accent-dark: #d97706;
  --accent-light: #fffbeb;
  --success: #059669;
  --danger: #dc2626;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --radius: 14px;
  --radius-lg: 18px;
  --shadow: 0 1px 2px rgba(0,0,0,0.04), 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -1px rgba(0,0,0,0.03);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.06), 0 4px 6px -2px rgba(0,0,0,0.03);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.06), 0 10px 10px -5px rgba(0,0,0,0.02);
  --font-sans: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--font-sans);
  color: var(--gray-700);
  background: #fafbfc;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; transition: opacity 0.2s; }
a:hover { opacity: 0.8; text-decoration: none; }

/* ===== Navigation ===== */
.navbar {
  background: rgba(255,255,255,0.95);
  border-bottom: 1px solid rgba(229,231,235,0.6);
  padding: 0 1.5rem;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.navbar-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 36px;
}

.navbar .nav-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
  padding: 0 0 1px;
}

.navbar .brand {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.5px;
  text-decoration: none;
}

.navbar .brand .nav-logo {
  height: 30px;
  width: auto;
  display: block;
}

.navbar .brand span { font-weight: 700; color: var(--primary); }

.navbar .nav-calc-link {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
  padding: 4px 10px;
  background: rgba(79,70,229,0.06);
  border-radius: 8px;
  transition: all 0.2s;
}
.navbar .nav-calc-link:hover {
  background: var(--primary);
  color: #fff;
}

.navbar .nav-links a {
  color: var(--gray-600);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.5rem 0;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}

.navbar .nav-links a:hover,
.navbar .nav-links a.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.navbar .nav-links .btn-login {
  background: var(--primary);
  color: white !important;
  padding: 0.35rem 1rem;
  border-radius: 8px;
  border-bottom: none !important;
  font-weight: 600;
  font-size: 0.85rem;
  transition: all 0.2s;
}
.navbar .nav-links .btn-login:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
}
.user-name {
  font-size: 0.9rem;
  color: var(--primary);
  font-weight: 700;
}
.user-name::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  margin-right: 4px;
  vertical-align: middle;
}
.btn-logout {
  padding: 0.4rem 1rem;
  border: 1px solid var(--gray-300);
  background: white;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--gray-600);
  transition: all 0.2s;
}
.btn-logout:hover {
  border-color: var(--danger);
  color: var(--danger);
}
.admin-badge {
  background: var(--accent-light);
  color: #92400e;
  padding: 2px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
}

/* ===== Hero ===== */
.hero {
  background: linear-gradient(170deg, #1e1b4b 0%, #312e81 30%, #4338ca 70%, #4f46e5 100%);
  color: white;
  padding: 7rem 2rem 6rem;
  text-align: center;
  overflow: hidden;
  position: relative;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: 
    radial-gradient(ellipse 700px 500px at 15% 30%, rgba(255,255,255,0.04) 0%, transparent 60%),
    radial-gradient(ellipse 500px 400px at 85% 70%, rgba(255,255,255,0.03) 0%, transparent 60%),
    radial-gradient(circle 250px at 50% 0%, rgba(255,255,255,0.02) 0%, transparent 70%);
  pointer-events: none;
}
.hero-content { position: relative; z-index: 1; }
.hero h1 {
  font-size: 3.2rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
  letter-spacing: 2px;
}
.hero .slogan-large {
  font-size: 2rem;
  font-weight: 300;
  opacity: 0.9;
  margin-bottom: 1.25rem;
  letter-spacing: 4px;
}
.hero .slogan-large span {
  font-weight: 700;
  color: #fbbf24;
}
.hero .hero-sub {
  font-size: 1.1rem;
  opacity: 0.75;
  max-width: 650px;
  margin: 0 auto 2rem;
  line-height: 1.8;
}

/* ===== Stats Section ===== */
.stats-section {
  background: white;
  padding: 2rem 2rem;
  position: relative;
}
.stats-section::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gray-200), transparent);
}
.stats-grid {
  max-width: 1000px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
}
.stat-item {
  text-align: center;
  padding: 1.5rem 1rem;
  position: relative;
}
.stat-item:not(:last-child)::after {
  content: '';
  position: absolute;
  right: 0;
  top: 20%;
  height: 60%;
  width: 1px;
  background: linear-gradient(180deg, transparent, var(--gray-200), transparent);
}
.stat-item .stat-number {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.2;
}
.stat-item .stat-label {
  font-size: 0.9rem;
  color: var(--gray-500);
  margin-top: 0.35rem;
  font-weight: 500;
}
@media (max-width: 768px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-item:nth-child(2)::after,
  .stat-item:nth-child(4)::after { display: none; }
  .hero h1 { font-size: 2rem; }
  .hero .slogan-large { font-size: 1.4rem; }
  .stats-grid { gap: 0.5rem; }
}

/* ===== Sections ===== */
.section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 2rem;
}
.section-title {
  text-align: center;
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--gray-900);
  position: relative;
}
.section-title::after {
  content: '';
  display: block;
  width: 50px;
  height: 3px;
  background: var(--primary);
  border-radius: 2px;
  margin: 0.75rem auto 0;
}
.section-subtitle {
  text-align: center;
  color: var(--gray-500);
  margin-bottom: 3rem;
  font-size: 1rem;
}

/* ===== Feature Cards ===== */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}
.feature-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 2.25rem 1.75rem;
  text-align: center;
  box-shadow: var(--shadow);
  border: 1px solid var(--gray-100);
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}
.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--primary);
  opacity: 0;
  transition: opacity 0.35s;
}
.feature-card:hover::before { opacity: 1; }
.feature-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 8px 30px rgba(79,70,229,0.1);
  border-color: rgba(79,70,229,0.12);
}
.feature-card .icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin: 0 auto 1rem;
  transition: transform 0.3s;
  background: var(--primary-light);
}
.feature-card:hover .icon { transform: scale(1.08); }
.feature-card h4 { font-size: 1.05rem; font-weight: 700; margin-bottom: 0.5rem; color: var(--gray-900); }
.feature-card p { font-size: 0.85rem; color: var(--gray-500); line-height: 1.6; }

/* ===== Cards (General) ===== */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}
.card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: all 0.3s;
  border: 1px solid var(--gray-100);
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.card-body { padding: 1.5rem; text-align: center; }
.card-title { font-size: 1.15rem; font-weight: 700; margin-bottom: 0.5rem; color: var(--gray-900); }
.card-text { color: var(--gray-600); font-size: 0.92rem; line-height: 1.7; }
.card-icon {
  width: 50px; height: 50px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin: 0 auto 1rem;
}
.card-icon.blue { background: var(--primary-light); color: var(--primary); }
.card-icon.green { background: #ecfdf5; color: #059669; }
.card-icon.orange { background: var(--accent-light); color: #b45309; }

/* ===== Course Items ===== */
.course-section { margin-bottom: 0.75rem; }
.course-section h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
  padding-bottom: 0.25rem;
  border-bottom: 2px solid var(--primary-light);
  color: var(--gray-700);
}
.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.5rem 0.75rem;
}
.course-item {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 0.4rem 1.25rem;
  transition: all 0.15s;
}
.course-item:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.course-item .type-badge {
  display: inline-block;
  margin-bottom: 0.3rem;
  font-size: 0.78rem;
  color: var(--gray-600);
  background: var(--gray-100);
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 500;
}
.course-item .subject { font-weight: 700; font-size: 1rem; color: var(--gray-900); }
.course-item .meta {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.4rem;
  flex-wrap: wrap;
}
.course-item .price { display: none; }
.course-item .duration { color: var(--gray-500); font-size: 0.85rem; }
.course-item .desc { margin-top: 0.4rem; color: var(--gray-700); font-size: 0.9rem; font-weight: 500; background: var(--gray-50); padding: 6px 10px; border-radius: 8px; line-height: 1.5; overflow-wrap: break-word; word-break: break-word; }
.course-item .desc-info { color: var(--gray-400); font-size: 0.82rem; }
.detail-btn { display: inline-block; padding: 5px 14px; font-size: 0.78rem; font-weight: 600; color: #374151; background: #f1f5f9; border: 1px solid #e2e8f0; border-radius: 8px; text-decoration: none; transition: all .2s; }

/* Admin course table truncation */
.data-table td.td-process { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.8rem; color: #6b7280; }
.data-table td.td-desc { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.8rem; color: #6b7280; }
.data-table td.td-subject { font-weight: 600; }
.data-table td.td-grade { font-size: 0.85rem; }
.data-table td.td-duration { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 80px; }
.badge-type { display: inline-block; padding: 2px 8px; background: #f1f5f9; border-radius: 6px; font-size: 0.78rem; white-space: nowrap; }
.detail-btn:hover { background: #e2e8f0; border-color: #cbd5e1; transform: translateY(-1px); }

/* ===== Teacher Cards ===== */
.teacher-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1.5rem;
}
.teacher-card {
  background: white;
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  box-shadow: var(--shadow);
  border: 1px solid var(--gray-100);
  transition: all 0.35s;
}
.teacher-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-light);
}
.teacher-card .avatar {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  font-size: 1.75rem;
  color: var(--primary);
  transition: transform 0.3s;
}
.teacher-card:hover .avatar { transform: scale(1.08); }
.teacher-card h4 { font-size: 1rem; font-weight: 600; margin-bottom: 0.3rem; }
.teacher-card p { font-size: 0.85rem; color: var(--gray-500); line-height: 1.7; }

/* ===== Photo Gallery ===== */
.photo-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}
.photo-card {
  background: white;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: all 0.3s;
}
.photo-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.photo-card img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
}
.photo-card .caption {
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  color: var(--gray-700);
}

/* ===== Reservation Section ===== */
.reservation-section {
  background: linear-gradient(170deg, #1e1b4b 0%, #312e81 50%, #4338ca 100%);
  color: white;
  padding: 4rem 2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.reservation-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 20% 50%, rgba(255,255,255,0.04) 0%, transparent 50%),
                    radial-gradient(circle at 80% 50%, rgba(255,255,255,0.03) 0%, transparent 50%);
}
.reservation-section h3 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  position: relative;
}
.reservation-section .phone-number {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: 3px;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(4px);
  display: inline-block;
  padding: 0.5rem 2rem;
  border-radius: 50px;
  margin: 0.5rem 0 0.25rem;
  position: relative;
}
.reservation-section p {
  opacity: 0.85;
  font-size: 0.95rem;
  position: relative;
}

/* ===== 登录/注册页面 ===== */
.login-layout {
  display: flex;
  min-height: 100vh;
}

.auth-container {
  flex: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(170deg, #1e1b4b 0%, #312e81 30%, #4338ca 70%, #4f46e5 100%);
  padding: 2rem;
  position: relative;
  overflow: hidden;
}
.auth-container::before {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: rgba(255,255,255,0.03);
  top: -200px;
  right: -200px;
}
.auth-container::after {
  content: '';
  position: absolute;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: rgba(255,255,255,0.03);
  bottom: -100px;
  left: -100px;
}

.auth-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 0.6rem 1.5rem 1.5rem;
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow-xl);
  position: relative;
  z-index: 1;
}
.auth-card h2 {
  text-align: center;
  font-size: 1.3rem;
  margin-bottom: 0.15rem;
  color: var(--gray-900);
}
.auth-card .subtitle {
  text-align: center;
  color: var(--gray-500);
  margin-bottom: 0.8rem;
  font-size: 0.8rem;
}

.campus-info {
  width: 420px;
  max-width: 100%;
  background: white;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1.5rem;
  overflow-y: auto;
  overflow-wrap: break-word;
  word-break: break-word;
}
.campus-info h3 {
  font-size: 1.1rem;
  color: var(--gray-900);
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}
.campus-info h3::after {
  content: '';
  display: none;
}
.campus-card {
  background: var(--gray-50);
  border-radius: 12px;
  padding: 1.2rem;
  border: 1px solid var(--gray-200);
  transition: all 0.2s;
}
.campus-card:hover {
  border-color: var(--primary-light);
  box-shadow: var(--shadow);
}
.campus-card .campus-name {
  font-weight: 700;
  color: var(--primary);
  font-size: 1rem;
  margin-bottom: 0.3rem;
}
.campus-card .campus-name .tag {
  display: inline-block;
  font-size: 0.7rem;
  background: var(--accent-light);
  color: #92400e;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 600;
  margin-left: 6px;
}
.campus-card .campus-addr {
  color: var(--gray-600);
  font-size: 0.85rem;
  line-height: 1.6;
}
.campus-card .campus-phone {
  color: var(--gray-500);
  font-size: 0.82rem;
  margin-top: 0.2rem;
}
.map-container {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--gray-200);
  margin-top: 0.5rem;
}
.map-container iframe {
  width: 100%;
  height: 160px;
  border: 0;
  display: block;
}
.map-tip {
  font-size: 0.75rem;
  text-align: center;
  color: var(--gray-400);
  padding: 4px 0;
}

@media (max-width: 800px) {
  .login-layout { flex-direction: column; }
  .campus-info { width: 100%; max-height: none; padding: 1.5rem; }
  .map-container iframe { height: 130px; }
}

/* ===== Forms ===== */
.auth-form {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(170deg, #1e1b4b 0%, #312e81 30%, #4338ca 70%, #4f46e5 100%);
  padding: 2rem;
  position: relative;
  overflow: hidden;
}
.auth-form::before {
  content: '';
  position: absolute;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: rgba(255,255,255,0.03);
  top: -150px;
  left: -150px;
}
.auth-form::after {
  content: '';
  position: absolute;
  width: 350px;
  height: 350px;
  background: rgba(255,255,255,0.025);
  border-radius: 50%;
  bottom: -40px;
  right: -60px;
}

.form-group { margin-bottom: 0.6rem; }
.form-group label {
  display: block;
  margin-bottom: 0.2rem;
  font-weight: 500;
  font-size: 0.82rem;
  color: var(--gray-700);
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  font-size: 0.7rem;
  transition: all 0.2s;
  outline: none;
  font-family: inherit;
  background: white;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}
.form-group textarea { min-height: 100px; resize: vertical; }

/* 禁用 Edge/Chrome 浏览器原生的密码查看按钮（避免与自定义眼睛图标重复） */
input[type="password"]::-ms-reveal,
input[type="password"]::-ms-clear,
input[type="password"]::-webkit-credentials-auto-fill-button {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* Password toggle eye */
.password-wrap {
  position: relative;
}
.password-wrap input { padding-right: 40px !important; }
.password-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  font-size: 1.1rem;
  line-height: 1;
  color: #94a3b8;
  transition: color 0.2s;
}
.password-toggle:hover { color: #475569; }
.password-toggle:focus { outline: none; }

.btn {
  display: inline-block;
  padding: 0.5rem 1.25rem;
  border: none;
  border-radius: 6px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}
.btn-primary {
  background: var(--primary);
  color: white;
  width: 100%;
}
.btn-primary:hover {
  background: var(--primary-dark);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.btn-success { background: var(--success); color: white; }
.btn-success:hover { opacity: 0.9; }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { opacity: 0.9; }
.btn-warning { background: var(--accent); color: white; }
.btn-warning:hover { opacity: 0.9; }
.btn-sm { padding: 0.4rem 0.9rem; font-size: 0.85rem; }
.btn-outline {
  background: transparent;
  border: 1px solid var(--gray-300);
  color: var(--gray-600);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-50); }

.auth-link {
  text-align: center;
  margin-top: 0.5rem;
  font-size: 0.82rem;
  color: var(--gray-500);
}
.auth-link a { font-weight: 600; }

/* ===== Alerts ===== */
.alert {
  padding: 0.4rem 0.7rem;
  border-radius: 6px;
  margin-bottom: 0.5rem;
  font-size: 0.82rem;
  display: none;
}
.alert.show { display: block; }
.alert.error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert.error.show { animation: alertShake 0.4s ease; }
@keyframes alertShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}
.alert.success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.alert.info { background: var(--primary-light); color: #1e40af; border: 1px solid #bfdbfe; }

/* ===== Dashboard ===== */
.dashboard {
  max-width: 1500px;
  margin: 0 auto;
  padding: 0.5rem 2rem;
}
.dashboard h2 {
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
  color: var(--gray-900);
}

.tabs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 1px;
  margin-bottom: 0.75rem;
  background: var(--gray-100);
  border-radius: 10px;
  padding: 3px;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  will-change: transform;
}
.tab {
  padding: 0.5rem 0.38rem;
  border-radius: 8px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--gray-600);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  text-align: center;
  transition: color 0.15s, background 0.15s, box-shadow 0.15s, border-color 0.15s;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.tab:hover { color: var(--gray-800); background: rgba(255,255,255,0.5); }
.tab-icon { width: 20px; height: 20px; vertical-align: middle; margin-right: 3px; flex-shrink: 0; display: inline-block; }
.tab .tab-icon { display: inline; }
.tab.active {
  background: linear-gradient(135deg, #eff6ff, white);
  color: var(--primary);
  box-shadow: 0 2px 8px rgba(37,99,235,0.15);
  border: 1px solid rgba(37,99,235,0.12);
  font-weight: 700;
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ===== Gallery Empty ===== */
.gallery-empty {
  text-align: center;
  padding: 3rem;
  color: var(--gray-400);
  font-size: 1rem;
}
.gallery-empty svg { display: block; margin: 0 auto 0.75rem; }

/* ===== Admin ===== */
.admin-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}
.admin-container h2 { font-size: 1.5rem; margin-bottom: 1.5rem; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.data-table th {
  background: var(--gray-50);
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gray-600);
  border-bottom: 1px solid var(--gray-200);
}
.data-table td {
  padding: 0.7rem 1rem;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--gray-100);
}
.data-table tr:hover td { background: var(--gray-50); }
.data-table .actions { display: flex; gap: 6px; }

.admin-tabs { margin-bottom: 2rem; }
.admin-section { margin-bottom: 2rem; }
.admin-section h3 {
  font-size: 1.15rem;
  margin-bottom: 1rem;
  color: var(--gray-800);
}

.admin-card {
  background: white;
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
  border: 1px solid var(--gray-100);
}

.admin-card .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.admin-card .form-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 768px) {
  .admin-card .form-row,
  .admin-card .form-row-3 {
    grid-template-columns: 1fr;
  }
}

/* ===== Info Section ===== */
.info-section {
  background: white;
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
  margin-bottom: 2rem;
}
.info-section h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--gray-900);
}
.info-section p {
  color: var(--gray-600);
  line-height: 1.8;
  margin-bottom: 1rem;
}

/* ===== Footer ===== */
.footer {
  text-align: center;
  color: white;
  font-size: 0.9rem;
  line-height: 1.7;
}

/* ===== Modal ===== */
.modal-overlay {
  position: fixed; top:0; left:0; right:0; bottom:0;
  background: rgba(0,0,0,0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  backdrop-filter: blur(4px);
}
.modal-overlay.show { display: flex; }
.modal {
  background: white;
  border-radius: var(--radius-lg);
  padding: 2rem;
  max-width: 520px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  animation: modalIn 0.25s ease-out;
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal h3 { font-size: 1.2rem; margin-bottom: 1.25rem; color: var(--gray-900); }
.modal .btn-group { display: flex; gap: 0.75rem; margin-top: 1.5rem; justify-content: flex-end; }
.modal .btn-group .btn { width: auto; }

/* ===== Chat ===== */
.chat-window {
  position: fixed;
  bottom: 90px;
  right: 24px;
  width: 360px;
  max-height: 520px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
  display: none;
  flex-direction: column;
  z-index: 999;
  overflow: hidden;
  animation: chatIn 0.3s ease-out;
}
@keyframes chatIn {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.chat-window.open { display: flex; }
.chat-header {
  background: linear-gradient(135deg, #312e81, #4338ca);
  color: white;
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 10px;
}
.chat-messages {
  flex: 1;
  padding: 1rem;
  overflow-y: auto;
  min-height: 280px;
  max-height: 340px;
}
.chat-msg { display: flex; align-items: flex-start; margin-bottom: 12px; }
.chat-msg.user { justify-content: flex-end; }
.chat-msg.cs { justify-content: flex-start; }
.chat-msg .bubble {
  max-width: 80%;
  padding: 0.6rem 0.9rem;
  border-radius: 12px;
  font-size: 0.88rem;
  line-height: 1.5;
  word-break: break-word;
}
.chat-msg.user .bubble {
  background: var(--primary);
  color: white;
  border-bottom-right-radius: 4px;
}
.chat-msg.cs .bubble {
  background: var(--gray-100);
  color: var(--gray-800);
  border-bottom-left-radius: 4px;
}
.chat-msg .msg-time {
  font-size: 0.65rem;
  margin-top: 2px;
  opacity: 0.7;
}
.chat-input-area {
  display: flex;
  gap: 8px;
  padding: 0.75rem;
  border-top: 1px solid var(--gray-200);
  background: white;
}
.chat-input-area input {
  flex: 1;
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--gray-300);
  border-radius: 20px;
  font-size: 0.88rem;
  outline: none;
}
.chat-input-area input:focus { border-color: var(--primary); }
.chat-input-area button {
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.chat-input-area button:hover { background: var(--primary-dark); }
.chat-input-area button:disabled { opacity: 0.5; cursor: default; }

/* ===== Chat Badge on Tab ===== */
.chat-badge {
  background: #ef4444;
  color: white;
  font-size: 0.7rem;
  padding: 1px 6px;
  border-radius: 8px;
  margin-left: 4px;
  vertical-align: middle;
}

/* ===== Responsive ===== */
/* Small phones */
@media (max-width: 480px) {
  .navbar .brand .nav-logo { height: 26px; }
  .hero { padding: 3rem 1rem 2.5rem; }
  .hero h1 { font-size: 1.5rem; }
  .hero .slogan-large { font-size: 1.1rem; letter-spacing: 2px; }
  .hero .hero-sub { font-size: 0.9rem; }
  .hero .cta-btn { padding: 0.75rem 2rem; font-size: 0.95rem; }
  .stat-item .stat-number { font-size: 1.8rem; }
  .stat-item .stat-label { font-size: 0.75rem; }
  .stats-section { padding: 1.5rem 0.5rem; }
  .section { padding: 1.5rem 0.75rem; }
  .section-title { font-size: 1.2rem; }
  .section-title::after { width: 40px; }
  .section-subtitle { font-size: 0.85rem; margin-bottom: 1.5rem; }
  .tabs { display: flex; flex-wrap: wrap; gap: 2px; padding: 3px; }
  .tab { padding: 0.35rem 0.45rem; font-size: 0.72rem; touch-action: manipulation; }
  .tab-icon { width: 20px !important; height: 20px !important; margin-right: 2px; }
  .dashboard { padding: 0.6rem; }
  .auth-card { padding: 1.25rem; margin: 0.5rem; }
  .auth-card h2 { font-size: 1.2rem; }
  .nagbar { height: auto; min-height: 54px; flex-wrap: wrap; gap: 0; }
  .nagbar .brand { font-size: 0.95rem; }
  .teacher-card .avatar { width: 56px; height: 56px; font-size: 1.4rem; }
}

/* Tablets & small screens */
@media (max-width: 768px) {
  .hero h1 { font-size: 1.75rem; }
  .hero .slogan-large { font-size: 1.3rem; }
  .hero { padding: 4rem 1.25rem 3rem; }
  .navbar { padding: 0 0.75rem; gap: 0; }
  .navbar .navbar-row { min-height: 36px; padding: 0; }
  .navbar .brand { font-size: 1rem; padding: 0; }
  .navbar .brand .nav-logo { height: 26px; }
  .navbar .nav-calc-link { font-size: 0.7rem; padding: 2px 7px; }
  .navbar .nav-links { gap: 0.9rem; overflow-x: auto; -webkit-overflow-scrolling: touch; justify-content: flex-start; padding: 0 0 4px; width: 100%; }
  .navbar .nav-links a { font-size: 0.78rem; white-space: nowrap; padding: 0.3rem 0; flex-shrink: 0; }
  .navbar .nav-links .btn-login { padding: 0.3rem 0.65rem; font-size: 0.73rem; flex-shrink: 0; }
  .navbar .nav-links #user-menu .user-name { font-size: 0.78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 80px; }
  .navbar .nav-links #user-menu .user-menu-sep { display: none; }
  .navbar .nav-links #user-menu .btn-logout { padding: 0.25rem 0.6rem !important; font-size: 0.75rem !important; }
  .navbar .nav-links #user-menu { gap: 4px !important; min-width: 0; flex-shrink: 1; }
  .section { padding: 1.75rem 1rem; }
  .section-title { font-size: 1.3rem; }
  .dashboard { padding: 0.75rem; }
  .cards { grid-template-columns: 1fr; }
  .about-intro-box { font-size: 0.88rem; padding: 1rem 1.25rem; margin-bottom: 2rem; }
  .course-grid { grid-template-columns: 1fr; }
  .photo-gallery { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .auth-card { padding: 1.5rem; margin: 1rem; }
  .chat-window { width: calc(100vw - 32px); right: 16px; top: 110px; }
  .data-table { font-size: 0.78rem; }
  .data-table th,
  .data-table td { padding: 0.5rem 0.6rem; }
  .course-item { padding: 0.3rem 1rem; }
  .photo-card img { height: 150px; }
  .hero .cta-btn { padding: 0.85rem 2.2rem; font-size: 1rem; }
  .feature-card { padding: 1.5rem 1rem; }
  .features-grid { grid-template-columns: 1fr; gap: 1rem; }
  .teacher-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 1rem; }
  .stat-item .stat-number { font-size: 2rem; }
  .stats-section { padding: 1.5rem 1rem; }
  .footer { padding: 0.75rem 0.75rem 1rem; }
  .footer-phone { margin-bottom: 0.4rem; }
  .footer-phone a#reservation-phone { font-size: 0.7rem !important; padding: 0.15rem 0.5rem !important; letter-spacing: 0.5px !important; border-radius: 20px !important; }
  .footer-phone div:first-child { font-size: 0.78rem !important; margin-bottom: 0.2rem !important; }
  .footer-phone p { font-size: 0.7rem !important; margin-top: 0.2rem !important; }
  .footer p { font-size: 0.75rem; }
  .footer-divider { margin: 0 auto 0.4rem; }
  .info-section { padding: 1.25rem; }
  .admin-card { padding: 1rem; }
  .admin-card .form-row { grid-template-columns: 1fr; }
  .admin-container { padding: 1rem; }
  .modal { padding: 1.25rem; max-width: 95%; }
  .modal .form-row { grid-template-columns: 1fr; gap: 0.5rem; }
  .modal .form-group { margin-bottom: 0.65rem; }
}

/* Dashboard specific responsive tweaks */
@media (max-width: 768px) {
  /* Admin chat: stack sidebar and main view */
  #admin-chat-container { display: block !important; }
  #admin-chat-container > div { width: 100% !important; max-width: 100% !important; }
  #admin-chat-sidebar { max-height: 35vh !important; }
  #admin-chat-messages { min-height: 200px !important; }
  /* Tables overflow */
  div[style*="overflow-x:auto"] { -webkit-overflow-scrolling: touch; }
  /* Admin info: single column */
  #admin-info-form .form-row,
  #admin-info-form .form-row-3 { grid-template-columns: 1fr !important; }
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--gray-100); }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }

/* ===== Status Badges ===== */
.badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 0.75rem; font-weight: 600; }
.badge-pending { background: #fef3c7; color: #b45309; }
.badge-confirmed { background: #d1fae5; color: #059669; }
.badge-cancelled { background: #fee2e2; color: #dc2626; }

/* ===== 操作按钮（预约管理） ===== */
.btn-act-confirm {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 0.78rem; padding: 5px 12px; border: 1.5px solid #10b981; border-radius: 20px;
  background: #ecfdf5; color: #059669; cursor: pointer; font-weight: 600;
  margin-right: 6px; transition: all 0.2s; line-height: 1;
}
.btn-act-confirm:hover { background: #10b981; color: #fff; box-shadow: 0 2px 8px rgba(16,185,129,0.25); }
.btn-act-delete {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 0.78rem; padding: 5px 12px; border: 1.5px solid #f87171; border-radius: 20px;
  background: #fef2f2; color: #dc2626; cursor: pointer; font-weight: 600;
  transition: all 0.2s; line-height: 1;
}
.btn-act-delete:hover { background: #ef4444; color: #fff; box-shadow: 0 2px 8px rgba(239,68,68,0.25); }

/* ============================================================
   🎨 美化增强 v3 — 靛蓝统一色调 · 精致克制
   ============================================================ */

/* --- 全局微调 --- */
body {
  background: #fafbfc;
  background-attachment: fixed;
}

/* --- 导航栏增强 --- */
.navbar {
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(229,231,235,0.5);
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.navbar .brand {
  font-size: 1.28rem;
  gap: 8px;
}
.navbar .brand .brand-text {
  font-weight: 800;
  color: var(--primary);
}
.navbar .brand .brand-text span { color: var(--primary); font-weight: 800; }

/* --- Logo 图标 --- */
.brand-logo {
  display: inline-flex;
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: 8px;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1rem;
  box-shadow: 0 2px 8px rgba(79,70,229,0.2);
}

/* --- 客服 logo --- */
.cs-logo {
  display: inline;
  height: 1.2em;
  width: auto;
  vertical-align: middle;
  margin-right: 2px;
}

/* --- 登录/注册页 logo --- */
.brand-logo-img {
  display: block;
  width: 80px;
  height: auto;
  margin: 0 auto 0.75rem;
}

/* --- Hero 增强 --- */
.hero {
  background: linear-gradient(170deg, #1e1b4b 0%, #312e81 30%, #4338ca 70%, #4f46e5 100%);
  padding: 7rem 2rem 5.5rem;
}
.hero::before {
  background-image:
    radial-gradient(ellipse 800px 500px at 20% 10%, rgba(251,191,36,0.06) 0%, transparent 60%),
    radial-gradient(ellipse 600px 400px at 80% 90%, rgba(79,70,229,0.04) 0%, transparent 60%),
    radial-gradient(circle 300px at 50% 0%, rgba(255,255,255,0.02) 0%, transparent 70%);
}
.hero h1 { font-size: 3.2rem; text-shadow: 0 2px 20px rgba(0,0,0,0.1); }
.hero .slogan-large { font-size: 2.1rem; }
.hero-cta-group { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; margin-top: 2rem; }

/* --- 按钮增强 --- */
.btn {
  position: relative;
  overflow: hidden;
  font-weight: 600;
  letter-spacing: 0.3px;
  border-radius: 8px;
}
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.12), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}
.btn:hover::after { opacity: 1; }
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  box-shadow: 0 2px 10px rgba(79,70,229,0.2);
}
.btn-primary:hover {
  box-shadow: 0 4px 16px rgba(79,70,229,0.3);
  transform: translateY(-2px);
}
.btn-success {
  background: linear-gradient(135deg, #059669, #047857);
  box-shadow: 0 2px 10px rgba(5,150,105,0.2);
}
.btn-danger {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  box-shadow: 0 2px 10px rgba(220,38,38,0.2);
}
.btn-warning {
  background: linear-gradient(135deg, #d97706, #b45309);
  box-shadow: 0 2px 10px rgba(217,119,6,0.2);
}
.btn-outline {
  background: white;
  border-color: var(--gray-200);
  color: var(--gray-600);
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-50);
  box-shadow: 0 2px 8px rgba(79,70,229,0.08);
}

/* --- Dashboard 主区域增强 --- */
.dashboard {
  max-width: 1500px;
  margin: 0 auto;
  padding: 0.5rem 2rem;
}

/* Dashboard 欢迎头部 */
.dashboard-welcome {
  background:
    linear-gradient(135deg, #1d4ed8 0%, #4338ca 52%, #7c3aed 100%);
  border-radius: 20px;
  padding: 1.35rem 1.5rem;
  margin-bottom: 0.75rem;
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  box-shadow: 0 10px 28px rgba(67,56,202,0.22);
  position: relative;
  overflow: hidden;
}
.dashboard-welcome::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle 240px at 88% 28%, rgba(255,255,255,0.16) 0%, transparent 58%),
    radial-gradient(circle 180px at 15% 90%, rgba(255,255,255,0.08) 0%, transparent 50%);
  pointer-events: none;
}
.welcome-copy,
.welcome-badges {
  position: relative;
  z-index: 1;
}
.welcome-copy {
  min-width: 0;
  flex: 1;
}
.welcome-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.65rem;
  margin-bottom: 0.55rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.16);
  border: 1px solid rgba(255,255,255,0.14);
  color: rgba(255,255,255,0.9);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
}
.dashboard-welcome h2 {
  font-size: 1.45rem;
  font-weight: 800;
  margin: 0;
  color: white;
  position: relative;
  z-index: 1;
  letter-spacing: 0;
}
.dashboard-welcome p {
  font-size: 0.9rem;
  opacity: 0.85;
  margin-top: 0.3rem;
  position: relative;
  z-index: 1;
}
.welcome-badges {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.dashboard-welcome .welcome-role {
  background: rgba(255,255,255,0.18);
  backdrop-filter: blur(10px);
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 700;
  position: relative;
  z-index: 1;
  border: 1px solid rgba(255,255,255,0.16);
  line-height: 1.2;
  white-space: nowrap;
}
.dashboard-welcome .welcome-meta {
  background: rgba(15,23,42,0.18);
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.92);
  border-radius: 999px;
  padding: 0.4rem 0.8rem;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  position: relative;
  z-index: 1;
}

/* --- Tabs 标签栏增强 --- */
.tabs {
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(229,231,235,0.6);
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
  border-radius: 12px;
}
.tab {
  padding: 0.65rem 0.5rem;
  border-radius: 8px;
  font-weight: 600;
  color: var(--gray-500);
  text-align: center;
  position: relative;
  transition: color 0.15s, background 0.15s, box-shadow 0.15s, border-color 0.15s;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.tab:hover {
  color: var(--gray-700);
  background: rgba(79,70,229,0.04);
}
.tab.active {
  background: white;
  color: var(--primary);
  box-shadow: 0 2px 8px rgba(79,70,229,0.1);
  border: 1px solid rgba(79,70,229,0.08);
}

/* --- 卡片系统增强 --- */
.card {
  border: 1px solid rgba(229,231,235,0.7);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(79,70,229,0.08);
  border-color: rgba(79,70,229,0.1);
}

/* ===== 关于我们 ===== */
.about-intro-box {
  position: relative;
  max-width: 720px;
  margin: 0 auto 3rem;
  padding: 1.75rem 2rem;
  background: linear-gradient(135deg, #f5f6ff 0%, #fafbfd 50%, #fefefe 100%);
  border: 1px solid rgba(79,70,229,0.08);
  border-radius: 14px;
  color: var(--gray-600);
  font-size: 0.95rem;
  line-height: 1.85;
  box-shadow: 0 2px 10px rgba(79,70,229,0.04);
}
.about-intro-box::before,
.about-intro-box::after {
  content: '"';
  position: absolute;
  font-size: 3rem;
  color: rgba(79,70,229,0.08);
  font-family: Georgia, serif;
  line-height: 1;
}
.about-intro-box::before {
  top: 0.25rem;
  left: 0.6rem;
}
.about-intro-box::after {
  bottom: -0.25rem;
  right: 0.6rem;
  transform: rotate(180deg);
}

.course-item {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  padding: 1.1rem 1.3rem;
  transition: all 0.25s cubic-bezier(0.4,0,0.2,1);
  position: relative;
}
.course-item::after {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--primary);
  border-radius: 0 3px 3px 0;
  opacity: 0;
  transition: opacity 0.3s;
}
.course-item:hover::after { opacity: 1; }
.course-item:hover {
  border-color: rgba(79,70,229,0.2);
  box-shadow: 0 4px 14px rgba(79,70,229,0.06);
  transform: translateY(-3px);
  padding-left: 1.5rem;
}

.teacher-card {
  border: 1px solid rgba(229,231,235,0.6);
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
}
.teacher-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 30px rgba(79,70,229,0.08);
  border-color: rgba(79,70,229,0.1);
}

.feature-card {
  border: 1px solid rgba(229,231,235,0.6);
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}
.photo-card {
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  border: 1px solid rgba(229,231,235,0.6);
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.photo-card:hover {
  box-shadow: 0 8px 25px rgba(79,70,229,0.1);
  border-color: var(--primary-light);
  transform: translateY(-4px);
}
.photo-card img {
  transition: transform 0.4s ease;
}
.photo-card:hover img {
  transform: scale(1.03);
}

/* 校区地图卡片美化 */
.campus-map-wrap {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--gray-200);
  box-shadow: 0 2px 6px rgba(0,0,0,0.03);
  transition: box-shadow 0.25s ease;
}
.campus-map-wrap:hover {
  box-shadow: 0 6px 16px rgba(79,70,229,0.08);
  border-color: var(--primary-light);
}
/* 地图层穿透触摸，避免拦截页面滑动；导航按钮保持可点击 */
.campus-map {
  pointer-events: none;
}
/* 地图上悬浮导航按钮 */
.campus-nav-btn {
  position: absolute;
  bottom: 10px;
  right: 10px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0.45rem 0.9rem;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(4px);
  color: var(--primary);
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  transition: all 0.2s;
  z-index: 5;
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
}
.campus-nav-btn:hover,
.campus-nav-btn:active {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 14px rgba(79,70,229,0.3);
}

/* 高德 Key 配置行：移动端垂直排列 */
@media (max-width: 600px) {
  #amap-key-row {
    flex-direction: column;
    align-items: stretch !important;
    gap: 8px !important;
    padding: 0.75rem !important;
  }
  #amap-key-row input {
    min-width: 0;
    font-size: 0.8rem !important;
  }
}
/* 桌面端限制 Key 输入框宽度 */
@media (min-width: 601px) {
  #amap-key-input {
    max-width: 340px;
    flex: 0 1 340px !important;
  }
}

/* --- Data Table 增强 --- */
.data-table {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  border: 1px solid rgba(229,231,235,0.6);
}
.data-table th {
  background: var(--gray-50);
  padding: 0.85rem 1rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid var(--gray-100);
}
.data-table td {
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--gray-100);
}
.data-table tr:nth-child(even) td { background: rgba(249,250,251,0.5); }
.data-table tr:hover td {
  background: rgba(79,70,229,0.02);
}
.data-table tr:last-child td { border-bottom: none; }

/* --- 管理员卡片增强 --- */
.admin-card {
  background: white;
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  margin-bottom: 1.5rem;
  border: 1px solid rgba(229,231,235,0.6);
  transition: box-shadow 0.3s;
}
.admin-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,0.04); }
.admin-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  color: var(--gray-800);
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--gray-100);
}

/* --- Info Section 增强 --- */
.info-section {
  background: white;
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  margin-bottom: 2rem;
  border: 1px solid rgba(229,231,235,0.6);
}
.info-section h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--gray-900);
  display: flex;
  align-items: center;
  gap: 8px;
}
.info-section p {
  color: var(--gray-600);
  line-height: 1.9;
  font-size: 0.95rem;
}

/* --- 表单输入增强 --- */
.form-group input,
.form-group select,
.form-group textarea {
  border-color: var(--gray-200);
  background: #fafbfc;
  transition: all 0.25s cubic-bezier(0.4,0,0.2,1);
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.02);
}
.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover { background: white; border-color: var(--gray-300); }
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  background: white;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,0.08);
}

/* --- 状态徽标增强 --- */
.badge {
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.3px;
}
.badge-pending {
  background: #fef3c7;
  color: #92400e;
  box-shadow: 0 0 0 1px rgba(251,191,36,0.2);
}
.badge-confirmed {
  background: #d1fae5;
  color: #065f46;
  box-shadow: 0 0 0 1px rgba(52,211,153,0.2);
}
.badge-cancelled {
  background: #fee2e2;
  color: #991b1b;
  box-shadow: 0 0 0 1px rgba(239,68,68,0.2);
}

/* --- Modal 增强 --- */
.modal-overlay {
  background: rgba(15,23,42,0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.modal {
  background: white;
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15), 0 4px 16px rgba(0,0,0,0.05);
  animation: modalIn 0.3s cubic-bezier(0.4,0,0.2,1);
}
.modal h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  color: var(--gray-900);
  display: flex;
  align-items: center;
  gap: 8px;
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.92) translateY(16px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* --- 客服聊天增强 --- */
.chat-window {
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.1), 0 2px 6px rgba(0,0,0,0.04);
  border: 1px solid rgba(229,231,235,0.6);
}
.chat-header {
  background: linear-gradient(135deg, #312e81 0%, #4338ca 100%);
  padding: 1rem 1.25rem;
}

/* --- 管理员客服管理面板增强 --- */
#admin-chat-sidebar {
  overflow-y: auto;
}
.conv-item {
  padding: 0.85rem 1rem;
  border-radius: 10px;
  cursor: pointer;
  margin-bottom: 6px;
  background: white;
  border: 1px solid var(--gray-100);
  transition: all 0.2s;
}
.conv-item:hover {
  background: var(--gray-50);
  border-color: var(--gray-200);
  transform: translateX(3px);
}
.conv-item.active {
  background: var(--primary-light);
  border-color: rgba(79,70,229,0.15);
  box-shadow: 0 1px 4px rgba(79,70,229,0.04);
}

/* --- 报名管理 --- */
.status-select {
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  transition: all 0.2s;
  background: white;
}
.status-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,0.08);
}

/* --- 空状态增强 --- */
.gallery-empty {
  padding: 4rem 2rem;
  background: white;
  border-radius: var(--radius);
  border: 1px dashed var(--gray-200);
}
.gallery-empty svg { display: block; margin: 0 auto 0.75rem; }

/* --- Footer 增强 --- */
.footer {
  background: linear-gradient(170deg, #1e1b4b 0%, #312e81 50%, #4338ca 100%);
  color: white;
  padding: 1.25rem 1.5rem 1.5rem;
}

.footer-phone {
  margin-bottom: 0.5rem;
}

.footer-phone a#reservation-phone {
  font-size: 1.2rem !important;
  padding: 0.25rem 1rem !important;
  letter-spacing: 1px !important;
}

.footer-divider {
  width: 32px;
  height: 1px;
  background: rgba(255,255,255,0.12);
  margin: 0 auto 0.6rem;
}

/* --- 占位/加载动画 --- */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.skeleton {
  background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-50) 50%, var(--gray-100) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px;
}

/* --- 页面渐入动画 --- */
@keyframes fadeUp {
  from { opacity: 0; }
  to { opacity: 1; }
}
.dashboard, .admin-container, .info-section, .auth-card {
  animation: fadeUp 0.3s ease-out;
}

/* --- 小工具: 分割线装饰 --- */
.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gray-200), transparent);
  margin: 1.5rem 0;
}

/* --- 管理标题 --- */
.admin-section-header {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.admin-section-header h2 {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--primary);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 1px;
}
.admin-section-header .header-actions {
  display: flex;
  gap: 0.5rem;
}

/* --- 响应式美化增强 --- */
@media (max-width: 768px) {
  .dashboard-welcome {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 1.15rem;
  }
  .welcome-badges {
    width: 100%;
    justify-content: flex-start;
  }
  .dashboard-welcome h2 { font-size: 1.15rem; }
  .dashboard-welcome .welcome-role,
  .dashboard-welcome .welcome-meta { align-self: flex-start; }
  .admin-section-header { flex-direction: column; align-items: flex-start; }
  .admin-section-header .header-actions { width: 100%; }
  .admin-section-header .header-actions .btn { flex: 1; }
}
@media (max-width: 480px) {
  .dashboard { padding: 0.6rem; }
  .dashboard-welcome { padding: 1rem; border-radius: 16px; }
  .dashboard-welcome h2 { font-size: 1rem; }
  .conv-item { padding: 0.65rem 0.75rem; }
  .dashboard-welcome .welcome-role,
  .dashboard-welcome .welcome-meta { font-size: 0.76rem; }
}

/* --- 提醒卡片 --- */
.notice-card {
  background: linear-gradient(135deg, var(--primary-50), #e8f4fd);
  border: 1px solid rgba(37,99,235,0.1);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
  color: var(--gray-700);
}
.notice-card .notice-icon {
  width: 36px; height: 36px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1rem;
  flex-shrink: 0;
}

/* --- 聊天管理增强: 侧栏 + 主区 --- */
#admin-chat-container {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1rem;
  min-height: 400px;
}
#admin-chat-container > div:first-child {
  background: white;
  border-radius: var(--radius);
  border: 1px solid rgba(226,232,240,0.6);
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  overflow-y: auto;
  max-height: 450px;
}
#admin-chat-container > div:last-child {
  background: white;
  border-radius: var(--radius);
  border: 1px solid rgba(226,232,240,0.6);
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  display: flex;
  flex-direction: column;
  min-height: 400px;
}
#chat-view-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--gray-200);
  background: linear-gradient(135deg, var(--gray-50), #f8fafc);
  border-radius: var(--radius) var(--radius) 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
#chat-view-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  background: #fafbfc;
}
#chat-view-reply {
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--gray-200);
  background: white;
  border-radius: 0 0 var(--radius) var(--radius);
}

/* --- 新消息角标动画 --- */
#admin-chat-badge {
  display: none;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
  font-size: 0.7rem;
  padding: 1px 7px;
  border-radius: 20px;
  margin-left: 4px;
  font-weight: 700;
  vertical-align: middle;
  box-shadow: 0 1px 4px rgba(239,68,68,0.3);
  animation: badgePulse 2s ease-in-out 1;
}
@keyframes badgePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

/* --- "新" 标签动画 --- */
.new-badge {
  display: inline-block !important;
  background: linear-gradient(135deg, #ef4444, #dc2626) !important;
  color: white !important;
  font-size: 0.62rem !important;
  padding: 1px 7px !important;
  border-radius: 6px !important;
  margin-left: 6px !important;
  font-weight: 700 !important;
  box-shadow: 0 1px 3px rgba(239,68,68,0.2);
  animation: newBadgeBounce 0.6s cubic-bezier(0.68,-0.55,0.265,1.55);
}
@keyframes newBadgeBounce {
  0% { transform: scale(0); }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

/* Admin course sort bar */
.admin-course-sort {
  display: flex; gap: 2px; margin-bottom: 8px;
  background: #f1f5f9; border-radius: 8px; padding: 2px;
}
.sort-btn {
  flex: 1; padding: 5px 8px; border: none; border-radius: 6px;
  background: transparent; color: #64748b;
  font-size: 0.78rem; font-weight: 600; font-family: inherit;
  cursor: pointer; transition: all .15s;
  white-space: nowrap;
}
.sort-btn:hover { background: #e2e8f0; color: #334155; }
.sort-btn.active {
  background: #fff; color: #4f46e5;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.sort-arrow { font-size: 0.7rem; }

/* Admin course card layout */
#admin-course-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.admin-course-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 0.75rem 1rem;
  transition: all 0.15s;
  overflow: hidden;
}
.admin-course-card:hover {
  border-color: #c7d2fe;
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}
.admin-course-card .card-top {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 12px;
}
.admin-course-card .card-info { flex: 1; min-width: 0; }
.admin-course-card .card-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.admin-course-card .card-subject { font-weight: 600; font-size: 0.95rem; color: #1e293b; }
.admin-course-card .card-grade { font-size: 0.82rem; color: #64748b; }
.admin-course-card .card-duration { font-size: 0.82rem; color: #64748b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-course-card .card-label { font-size: 0.72rem; color: #6366f1; font-weight: 500; margin-right: 2px; }
.admin-course-card .card-process,
.admin-course-card .card-desc {
  font-size: 0.8rem;
  color: #6b7280;
  line-height: 1.4;
  overflow: hidden;
  overflow-wrap: break-word;
  word-break: break-word;
  margin-top: 2px;
}
.admin-course-card .card-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
  align-items: center;
}
.admin-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: #94a3b8;
  font-size: 0.95rem;
}
.admin-empty span { font-size: 2rem; display: block; margin-bottom: 0.5rem; }
@media (max-width: 600px) {
  .admin-course-card { padding: 0.75rem; }
  .admin-course-card .card-top { flex-direction: column; gap: 10px; }
  .admin-course-card .card-title-row { gap: 6px; }
  .admin-course-card .card-actions { align-self: stretch; width: 100%; }
  .admin-course-card .card-actions .btn { flex: 1; min-height: 34px; }
}

/* Admin header compact buttons */
.btn-add-course,
.btn-export {
  padding: 0.25rem 0.75rem;
  font-size: 0.82rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  white-space: nowrap;
  transition: all 0.15s;
}
.btn-add-course { background: var(--primary); color: #fff; }
.btn-add-course:hover { background: var(--primary-dark); }
.btn-export { background: #059669; color: #fff; }
.btn-export:hover { background: #047857; }

@media (max-width: 600px) {
  .btn-add-course {
    padding: 4px 10px;
    font-size: 0.78rem;
    min-height: 30px;
  }
}
  /* 标题 */
  #tab-admin-ai-config h3,
  #tab-ai h3 { font-size: 0.92rem !important; margin-bottom: 0.3rem !important; }
  #tab-admin-ai-config h4,
  #tab-ai h4 { font-size: 0.78rem !important; margin: 0 0 0.3rem 0 !important; }
  /* 说明文字 */
  #tab-admin-ai-config .admin-section > p:first-of-type,
  #tab-ai .admin-section > p:first-of-type { font-size: 0.7rem !important; margin-bottom: 0.5rem !important; }
  #tab-admin-ai-config p,
  #tab-ai p { font-size: 0.68rem !important; }
  /* 表单组 */
  #tab-admin-ai-config .form-group,
  #tab-ai .form-group { margin-bottom: 0.4rem !important; }
  #tab-admin-ai-config .form-group label,
  #tab-ai .form-group label { font-size: 0.72rem !important; margin-bottom: 0.15rem !important; }
  /* 输入框更大，方便手机点击 */
  #tab-admin-ai-config .form-group input,
  #tab-admin-ai-config .form-group textarea,
  #tab-ai .form-group input,
  #tab-ai .form-group textarea {
    font-size: 0.82rem !important;
    padding: 0.55rem 0.65rem !important;
    border-radius: 8px !important;
  }
  #tab-admin-ai-config textarea,
  #tab-ai textarea { min-height: 100px !important; font-size: 0.8rem !important; }

  /* === 底部控制栏：纵向堆叠 === */
  #tab-admin-ai-config .admin-section > div:not(.admin-card):last-of-type,
  #tab-ai .admin-section > div:not(.admin-card):last-of-type {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 6px !important;
    margin-top: 0.5rem !important;
    background: #f8fafc;
    border-radius: 10px;
    padding: 0.6rem 0.75rem !important;
    border: 1px solid var(--gray-200);
  }
  /* 第一行：保存按钮 + 状态 */
  #tab-admin-ai-config .admin-section > div:not(.admin-card):last-of-type > button:first-child,
  #tab-ai .admin-section > div:not(.admin-card):last-of-type > button:first-child {
    align-self: flex-start;
    padding: 0.45rem 1.1rem !important;
    font-size: 0.85rem !important;
  }
  /* 隐藏状态文字的 margin-left:auto */
  #tab-admin-ai-config .admin-section > div:not(.admin-card) span[style*="margin-left"],
  #tab-ai .admin-section > div:not(.admin-card) span[style*="margin-left"] {
    margin-left: 0 !important;
  }
  /* 设置行：标签+输入 紧凑排列 */
  #tab-admin-ai-config .admin-section > div:not(.admin-card):last-of-type span,
  #tab-ai .admin-section > div:not(.admin-card):last-of-type span {
    font-size: 0.7rem !important;
    white-space: nowrap;
  }
  #tab-admin-ai-config .admin-section > div:not(.admin-card):last-of-type input[type="number"],
  #tab-ai .admin-section > div:not(.admin-card):last-of-type input[type="number"] {
    width: 52px !important;
    padding: 0.35rem !important;
    font-size: 0.78rem !important;
    text-align: center !important;
  }

  /* === 快捷预设：全宽按钮 === */
  #tab-admin-ai-config .admin-card:last-child .btn-sm,
  #tab-ai .admin-card:last-child .btn-sm {
    flex: 1 1 auto;
    font-size: 0.72rem !important;
    padding: 0.4rem 0.5rem !important;
  }
  #tab-admin-ai-config .admin-card:last-child > div,
  #tab-ai .admin-card:last-child > div {
    gap: 4px !important;
  }

  /* === admin.html 客服对话双栏变单栏 === */
  #tab-chat .admin-section > div[style*="grid-template-columns"] {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.5rem !important;
  }

/* ===== AI助手设置 ===== */
.ai-ctrl-bar {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: -0.3rem;
}
.ai-ctrl-head {
  display: flex;
  align-items: center;
  gap: 6px;
}
.ai-ctrl-head button {
  padding: 6px 20px !important;
  font-size: 0.82rem !important;
  line-height: 1.3 !important;
  min-width: unset !important;
  width: auto !important;
}
.ai-ctrl-head span {
  font-size: 0.72rem;
  color: var(--gray-400);
}
.ai-ctrl-grid {
  display: flex;
  align-items: center;
  gap: 3px 6px;
  flex-wrap: wrap;
  font-size: 0.75rem;
  color: var(--gray-400);
}
.ai-ctrl-item {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  white-space: nowrap;
  cursor: default;
  margin: 0;
  padding: 0;
  font-weight: normal;
}
.ai-ctrl-grid span {
  font-size: 0.75rem;
  color: var(--gray-400);
  white-space: nowrap;
}
.ai-ctrl-grid input[type="number"] {
  width: 48px;
  padding: 0.2rem 0.25rem;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  font-size: 0.75rem;
  text-align: center;
  background: #fff;
  -moz-appearance: textfield;
}
.ai-ctrl-grid input[type="number"]::-webkit-inner-spin-button,
.ai-ctrl-grid input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
/* MaxToken 加宽 */
.ai-ctrl-grid input[type="number"].wider,
#ai-max-tokens2 {
  width: 80px !important;
}

/* ===== AI助手设置 移动端 ===== */
@media (max-width: 600px) {
  .ai-ctrl-bar {
    margin-top: 0.4rem !important;
    background: #f8fafc;
    border-radius: 12px;
    padding: 0.5rem;
    border: 1px solid var(--gray-200);
    gap: 5px !important;
  }
  .ai-ctrl-head {
    display: grid !important;
    grid-template-columns: 1fr;
    align-items: stretch !important;
    justify-content: normal !important;
    gap: 6px !important;
    width: 100%;
  }
  .ai-ctrl-head button {
    width: 100% !important;
    min-height: 38px !important;
    padding: 8px 12px !important;
    font-size: 0.82rem !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    white-space: nowrap !important;
  }
  .ai-ctrl-head span {
    display: block;
    width: 100%;
    min-height: 0;
    font-size: 0.7rem !important;
    line-height: 1.4;
    text-align: left;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .ai-ctrl-grid {
    padding-top: 5px;
    border-top: 1px solid var(--gray-200);
    width: 100%;
  }
  .ai-ctrl-grid span {
    font-size: 0.68rem !important;
  }
  .ai-ctrl-grid input[type="number"] {
    width: 40px !important;
    padding: 0.15rem 0.2rem !important;
    font-size: 0.68rem !important;
    -moz-appearance: textfield !important;
  }
  .ai-ctrl-grid input[type="number"]::-webkit-inner-spin-button,
  .ai-ctrl-grid input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none !important;
    margin: 0;
  }
  .ai-ctrl-grid input[type="number"].wider,
  #ai-max-tokens2 {
    width: 70px !important;
  }
/* AI卡片 */
  #tab-admin-ai-config .admin-card,
  #tab-ai .admin-card {
    padding: 0.6rem 0.75rem !important;
    margin-bottom: 0.4rem !important;
    border-radius: 10px !important;
  }
  #tab-admin-ai-config h3, #tab-ai h3 {
    font-size: 0.9rem !important;
    margin-bottom: 0.3rem !important;
  }
  #tab-admin-ai-config h4, #tab-ai h4 {
    font-size: 0.78rem !important;
    margin: 0 0 0.3rem 0 !important;
  }
  #tab-admin-ai-config p, #tab-ai p {
    font-size: 0.68rem !important;
    margin-bottom: 0.4rem !important;
  }
  #tab-admin-ai-config .form-group, #tab-ai .form-group {
    margin-bottom: 0.35rem !important;
  }
  #tab-admin-ai-config .form-group label, #tab-ai .form-group label {
    font-size: 0.7rem !important;
    margin-bottom: 0.1rem !important;
  }
  #tab-admin-ai-config .form-group input,
  #tab-admin-ai-config .form-group textarea,
  #tab-ai .form-group input,
  #tab-ai .form-group textarea {
    font-size: 0.82rem !important;
    padding: 0.5rem 0.6rem !important;
    border-radius: 8px !important;
  }
  #tab-admin-ai-config textarea, #tab-ai textarea {
    min-height: 90px !important;
    font-size: 0.8rem !important;
  }

  /* 快捷预设 */
  #tab-admin-ai-config .admin-card:last-child .btn-sm,
  #tab-ai .admin-card:last-child .btn-sm {
    flex: 1 1 auto !important;
    font-size: 0.72rem !important;
    padding: 0.4rem 0.5rem !important;
  }
}
