/* ==========================================
   培训黄页 - 全站公共样式
   ========================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #1677ff;
  --primary-dark: #0958d9;
  --accent: #ff6b35;
  --text: #1a1a2e;
  --text-sub: #666;
  --border: #e5e7eb;
  --bg: #f7f8fc;
  --white: #fff;
  --radius: 10px;
  --shadow: 0 2px 16px rgba(22,119,255,.10);
  --shadow-sm: 0 1px 4px rgba(0,0,0,.08);
}

body { font-family: 'PingFang SC','Microsoft YaHei',sans-serif; color: var(--text); background: var(--bg); font-size: 15px; line-height: 1.6; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; display: block; }
ul { list-style: none; }

/* ---- 布局 ---- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.container-sm { max-width: 860px; margin: 0 auto; padding: 0 20px; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-5 { margin-top: 20px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }

/* ---- 全站顶部导航 ---- */
.site-header { background: var(--white); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; }
.site-header .inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.site-logo { font-size: 20px; font-weight: 700; color: var(--primary); letter-spacing: .5px; }
.site-logo span { color: var(--accent); }
.site-nav a { margin-left: 20px; color: var(--text-sub); font-size: 14px; transition: color .2s; }
.site-nav a:hover { color: var(--primary); }
.site-nav .btn-login { background: var(--primary); color: #fff !important; padding: 6px 16px; border-radius: 20px; }
.site-nav .btn-login:hover { background: var(--primary-dark); }

/* ---- 搜索框 ---- */
.search-hero { background: linear-gradient(135deg, #1677ff 0%, #0d4fc8 100%); padding: 56px 20px; text-align: center; color: #fff; }
.search-hero h1 { font-size: 32px; font-weight: 700; margin-bottom: 10px; }
.search-hero p { font-size: 16px; opacity: .85; margin-bottom: 28px; }
.search-box { display: flex; max-width: 600px; margin: 0 auto; background: #fff; border-radius: 40px; overflow: hidden; box-shadow: 0 4px 24px rgba(0,0,0,.18); }
.search-box input { flex: 1; border: 0; outline: none; padding: 14px 22px; font-size: 15px; color: var(--text); background: transparent; }
.search-box button { background: var(--primary); color: #fff; border: 0; padding: 14px 32px; font-size: 15px; cursor: pointer; transition: background .2s; }
.search-box button:hover { background: var(--primary-dark); }

/* ---- 分类标签 ---- */
.cats-wrap { display: flex; flex-wrap: wrap; gap: 10px; padding: 20px 0; }
.cat-tag { display: inline-flex; align-items: center; gap: 6px; background: var(--white); border: 1px solid var(--border); border-radius: 20px; padding: 7px 16px; font-size: 14px; color: var(--text-sub); transition: all .2s; cursor: pointer; }
.cat-tag:hover, .cat-tag.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ---- 机构卡片 ---- */
.org-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 20px; padding: 20px 0; }
.org-card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow-sm); transition: box-shadow .25s, transform .25s; display: flex; flex-direction: column; color: var(--text); overflow: hidden; }
.org-card:hover { box-shadow: var(--shadow); transform: translateY(-3px); color: var(--text); }
.org-card-banner { height: 120px; background: linear-gradient(135deg,#e8f4ff,#c3d8ff); position: relative; flex-shrink: 0; }
.org-card-banner img { width: 100%; height: 100%; object-fit: cover; }
.org-card-logo { width: 60px; height: 60px; border-radius: 12px; background: #fff; border: 2px solid var(--border); position: absolute; bottom: -30px; left: 16px; box-shadow: var(--shadow-sm); overflow: hidden; }
.org-card-logo img { width: 100%; height: 100%; object-fit: cover; }
.org-card-logo .logo-fallback { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 22px; background: var(--primary); color: #fff; font-weight: 700; }
.org-card-body { padding: 40px 16px 16px; flex: 1; display: flex; flex-direction: column; }
.org-card-name { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.org-card-intro { font-size: 13px; color: var(--text-sub); margin-bottom: 10px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.org-card-meta { display: flex; gap: 8px; font-size: 12px; color: #aaa; flex-wrap: wrap; }
.org-card-meta span { background: var(--bg); padding: 2px 8px; border-radius: 10px; }
.campus-links { margin-top: auto; display: flex; flex-wrap: wrap; gap: 4px; padding-top: 8px; }
.city-badge { font-size: 12px; font-weight: 400; color: #fff; background: var(--primary); padding: 1px 6px; border-radius: 8px; margin-left: 6px; vertical-align: middle; }
.campus-count { color: var(--primary) !important; }
.campus-link { font-size: 11px; padding: 2px 6px; background: #e6f4ff; color: #1677ff; border-radius: 4px; text-decoration: none; }
.campus-link:hover { background: #bae0ff; }
.campus-more { font-size: 11px; padding: 2px 6px; color: #999; }

/* ---- 机构空间页 ---- */
.space-header { background: var(--white); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; }
.space-header .inner { display: flex; align-items: center; justify-content: space-between; height: 60px; max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.space-logo { font-size: 20px; font-weight: 700; color: var(--primary); }

.space-nav { position: sticky; top: 60px; z-index: 50; }
.space-nav .inner { display: flex; gap: 0; max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.space-nav a { padding: 14px 18px; font-size: 15px; color: var(--text-sub); border-bottom: 2px solid transparent; transition: all .2s; text-decoration: none; }
.space-nav a:hover { color: var(--primary); }
.space-nav a.active { color: var(--primary); border-bottom-color: var(--primary); }

.space-body { background: var(--bg); padding: 24px 0; min-height: 60vh; }

.card { background: var(--white); border-radius: var(--radius); padding: 24px; margin-bottom: 20px; box-shadow: var(--shadow-sm); }
.card-title { font-size: 17px; font-weight: 600; margin-bottom: 16px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }

/* ---- 课程列表 ---- */
.course-list { display: flex; flex-direction: column; gap: 16px; }
.course-item { display: flex; gap: 16px; padding: 16px; background: var(--bg); border-radius: 8px; transition: box-shadow .2s; }
.course-item:hover { box-shadow: var(--shadow-sm); }
.course-cover { width: 120px; height: 80px; border-radius: 6px; object-fit: cover; flex-shrink: 0; }
.course-cover-fb { width: 120px; height: 80px; border-radius: 6px; background: linear-gradient(135deg,#e8f4ff,#c3d8ff); display: flex; align-items: center; justify-content: center; font-size: 28px; flex-shrink: 0; }
.course-info { flex: 1; min-width: 0; }
.course-name { font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.course-meta { font-size: 13px; color: var(--text-sub); margin-bottom: 6px; }
.course-price { color: var(--accent); font-weight: 700; font-size: 18px; }
.course-price span { font-size: 12px; font-weight: 400; color: var(--text-sub); }

/* ---- 校区卡片 ---- */
.campus-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.campus-card { padding: 16px; background: var(--bg); border-radius: 8px; border: 1px solid var(--border); }
.campus-city { font-weight: 600; font-size: 15px; margin-bottom: 6px; }
.campus-city a { text-decoration: none; }
.is-main { background: var(--primary); color: #fff; font-size: 11px; padding: 1px 8px; border-radius: 8px; margin-left: 6px; font-weight: 400; }
.campus-addr { font-size: 13px; color: var(--text-sub); margin-top: 4px; }
.campus-phone { font-size: 13px; color: var(--text-sub); margin-top: 2px; }

/* ---- 联系方式 ---- */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.contact-item { display: flex; align-items: center; gap: 10px; }
.contact-icon { width: 36px; height: 36px; background: #e6f4ff; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.contact-label { font-size: 12px; color: var(--text-sub); }
.contact-val { font-size: 14px; font-weight: 500; }

/* ---- 侧边栏信息 ---- */
.aside-info-item { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.aside-info-item:last-child { border-bottom: 0; }
.aside-info-item .label { color: var(--text-sub); }
.aside-info-item .val { font-weight: 500; }

/* ---- 按钮 ---- */
.btn { display: inline-block; padding: 8px 20px; border-radius: 6px; font-size: 14px; text-align: center; cursor: pointer; transition: all .2s; text-decoration: none; border: 0; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-block { display: block; width: 100%; }

/* ---- 空间页布局 ---- */
.space-layout { display: flex; gap: 24px; padding: 0; }
.space-main { flex: 1; min-width: 0; }
.space-aside { width: 300px; flex-shrink: 0; }
.space-aside .card { margin-bottom: 16px; }

/* ---- 搜索页 ---- */
.search-page-header { background: var(--white); padding: 20px 0; border-bottom: 1px solid var(--border); }
.search-page-header h2 { font-size: 18px; margin-bottom: 12px; }

/* ---- 分页 ---- */
.pagination { display: flex; justify-content: center; gap: 6px; padding: 20px 0; flex-wrap: wrap; }
.pagination a, .pagination span { padding: 8px 14px; border-radius: 6px; font-size: 14px; border: 1px solid var(--border); background: var(--white); color: var(--text-sub); transition: all .2s; }
.pagination a:hover { border-color: var(--primary); color: var(--primary); }
.pagination .current { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ---- 机构登录/注册 ---- */
.auth-page { min-height: 70vh; display: flex; align-items: center; justify-content: center; }
.auth-box { background: var(--white); border-radius: var(--radius); padding: 40px; width: 100%; max-width: 420px; box-shadow: var(--shadow); }
.auth-box h2 { text-align: center; margin-bottom: 24px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 14px; margin-bottom: 6px; color: var(--text-sub); }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 10px 14px; border: 1px solid var(--border); border-radius: 6px; font-size: 14px; outline: none; transition: border-color .2s; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: var(--primary); }
.btn-primary { display: inline-block; background: var(--primary); color: #fff; padding: 10px 24px; border-radius: 6px; border: 0; font-size: 15px; cursor: pointer; transition: background .2s; width: 100%; text-align: center; }
.btn-primary:hover { background: var(--primary-dark); }
.auth-link { text-align: center; margin-top: 16px; font-size: 13px; color: var(--text-sub); }
.auth-link a { color: var(--primary); }

/* ---- 后台通用 ---- */
.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar { width: 220px; background: #001529; color: #fff; padding: 20px 0; position: fixed; top: 0; left: 0; bottom: 0; overflow-y: auto; }
.admin-sidebar h3 { padding: 0 20px 16px; font-size: 16px; border-bottom: 1px solid rgba(255,255,255,.1); margin-bottom: 10px; }
.admin-sidebar a { display: block; padding: 10px 20px; color: rgba(255,255,255,.65); font-size: 14px; transition: all .2s; }
.admin-sidebar a:hover, .admin-sidebar a.active { color: #fff; background: var(--primary); }
.admin-content { flex: 1; margin-left: 220px; background: var(--bg); min-height: 100vh; }
.admin-topbar { background: var(--white); padding: 0 24px; display: flex; justify-content: space-between; align-items: center; height: 56px; border-bottom: 1px solid var(--border); }
.admin-topbar .page-title { font-weight: 600; font-size: 16px; }
.admin-topbar .user-info { color: var(--text-sub); }
.admin-topbar .user-info a { color: var(--accent); margin-left: 12px; }
.admin-body { padding: 24px; }

/* ---- 后台卡片表格 ---- */
.panel { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; margin-bottom: 20px; }
.panel-header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; font-weight: 600; font-size: 15px; }
.panel-body { padding: 20px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { background: var(--bg); padding: 10px 12px; text-align: left; font-weight: 600; border-bottom: 1px solid var(--border); color: var(--text-sub); }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: var(--bg); }
.badge { display: inline-block; padding: 2px 10px; border-radius: 10px; font-size: 12px; font-weight: 500; }
.badge-success { background: #f6ffed; color: #389e0d; }
.badge-warning { background: #fffbe6; color: #d48806; }
.badge-danger  { background: #fff2f0; color: #cf1322; }
.badge-info    { background: #e6f4ff; color: #0958d9; }

/* ---- 后台统计卡 ---- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px,1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--white); border-radius: var(--radius); padding: 20px; display: flex; align-items: center; gap: 16px; box-shadow: var(--shadow-sm); }
.stat-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 22px; }
.stat-num { font-size: 26px; font-weight: 700; }
.stat-label { font-size: 13px; color: var(--text-sub); }

/* ---- Footer ---- */
.site-footer { background: #001529; color: rgba(255,255,255,.5); text-align: center; padding: 24px; font-size: 13px; margin-top: 40px; }
.site-footer a { color: rgba(255,255,255,.6); }

/* ---- 响应式 ---- */
@media (max-width: 768px) {
  .space-layout { flex-direction: column; }
  .space-aside { width: 100%; }
  .contact-grid { grid-template-columns: 1fr; }
  .admin-sidebar { display: none; }
  .admin-content { margin-left: 0; }
  .org-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .org-grid { grid-template-columns: 1fr; }
  .search-hero h1 { font-size: 22px; }
}

/* 机构卡片banner占位符 */
.banner-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}
.banner-org-name {
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
    text-align: center;
    padding: 8px 16px;
    text-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
/* 机构卡片banner占位符 - 多彩渐变 */
.banner-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
/* 默认渐变色 */
.banner-placeholder { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
/* 语言培训类 - 蓝色系 */
.banner-placeholder.cat-1, .banner-placeholder.cat-72, .banner-placeholder.cat-9, .banner-placeholder.cat-16 { background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%); }
/* IT技术类 - 绿色系 */
.banner-placeholder.cat-2, .banner-placeholder.cat-17, .banner-placeholder.cat-18, .banner-placeholder.cat-19 { background: linear-gradient(135deg, #10b981 0%, #059669 100%); }
/* 职业资格类 - 橙色系 */
.banner-placeholder.cat-3, .banner-placeholder.cat-25, .banner-placeholder.cat-26, .banner-placeholder.cat-27 { background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%); }
/* 艺术培训类 - 粉色系 */
.banner-placeholder.cat-4, .banner-placeholder.cat-33, .banner-placeholder.cat-36, .banner-placeholder.cat-37 { background: linear-gradient(135deg, #ec4899 0%, #db2777 100%); }
/* 学科辅导类 - 青色系 */
.banner-placeholder.cat-6, .banner-placeholder.cat-49, .banner-placeholder.cat-50, .banner-placeholder.cat-51 { background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%); }
/* 财经金融类 - 金色系 */
.banner-placeholder.cat-7, .banner-placeholder.cat-57, .banner-placeholder.cat-58 { background: linear-gradient(135deg, #eab308 0%, #ca8a04 100%); }
/* 体育健身类 - 红色系 */
.banner-placeholder.cat-5, .banner-placeholder.cat-41, .banner-placeholder.cat-42, .banner-placeholder.cat-48 { background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%); }

.banner-org-name {
    position: relative;
    z-index: 2;
    color: #fff;
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    padding: 12px 16px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
    letter-spacing: 2px;
}

/* 装饰元素 */
.banner-placeholder::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%);
    animation: bannerShine 8s ease-in-out infinite;
}
.banner-placeholder::after {
    content: '';
    position: absolute;
    bottom: -20px;
    right: -20px;
    width: 80px;
    height: 80px;
    background: rgba(255,255,255,0.08);
    border-radius: 50%;
}

@keyframes bannerShine {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(10%, 10%); }
}

/* 前台入口快捷链接 */
.front-links {
  padding: 10px 12px;
  border-bottom: 1px solid #344;
  margin-bottom: 8px;
}
.front-links a {
  display: block;
  font-size: 12px;
  color: #8cf;
  padding: 3px 0;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.front-links a:hover {
  color: #fff;
}
