/* ==================== 基础重置 ==================== */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f0f0f5;
  color: #1a1a2e;
  line-height: 1.6;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; outline: none; }
input { font-family: inherit; outline: none; }

/* ==================== 通用组件 ==================== */
.toast {
  position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
  background: #1a1a2e; color: #fff; padding: 12px 24px; border-radius: 8px;
  font-size: 14px; z-index: 9999; box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  animation: toastIn 0.3s ease;
}
.toast.success { background: #16a34a; }
.toast.error { background: #dc2626; }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, -20px); } to { opacity: 1; transform: translate(-50%, 0); } }

.spinner {
  width: 32px; height: 32px; border: 3px solid #e5e7eb; border-top-color: #4f46e5;
  border-radius: 50%; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-center {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 60vh; gap: 12px; color: #6b7280;
}

/* ==================== 头部导航 ==================== */
.top-nav {
  background: linear-gradient(135deg, #4f46e5, #6366f1);
  color: #fff; padding: 0 20px; height: 56px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 100; box-shadow: 0 2px 8px rgba(79,70,229,0.3);
}
.top-nav .nav-title { font-size: 18px; font-weight: 600; }
.top-nav .nav-right { display: flex; align-items: center; gap: 12px; }
.top-nav .nav-user { font-size: 14px; opacity: 0.9; }
.top-nav .nav-btn {
  background: rgba(255,255,255,0.2); color: #fff; padding: 6px 14px; border-radius: 6px;
  font-size: 13px; transition: background 0.2s;
}
.top-nav .nav-btn:hover { background: rgba(255,255,255,0.3); }
.top-nav .nav-btn.active { background: rgba(255,255,255,0.35); }

/* ==================== 首页 - 未登录 ==================== */
.home-hero {
  background: linear-gradient(135deg, #4f46e5 0%, #6366f1 50%, #818cf8 100%);
  color: #fff; padding: 60px 20px 80px; text-align: center; position: relative; overflow: hidden;
}
.home-hero::after {
  content: ''; position: absolute; bottom: -40px; left: 0; right: 0; height: 80px;
  background: #f0f0f5; border-radius: 50% 50% 0 0 / 100% 100% 0 0;
}
.home-hero .hero-icon {
  width: 72px; height: 72px; margin: 0 auto 16px;
  background: rgba(255,255,255,0.15); border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: 36px; backdrop-filter: blur(10px);
}
.home-hero h1 { font-size: 28px; font-weight: 700; margin-bottom: 8px; }
.home-hero p { font-size: 15px; opacity: 0.85; max-width: 480px; margin: 0 auto; }
.home-hero .hero-buttons { display: flex; gap: 12px; justify-content: center; margin-top: 24px; }

.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 10px 24px;
  border-radius: 8px; font-size: 15px; font-weight: 600; transition: all 0.2s;
}
.btn-primary { background: #fff; color: #4f46e5; }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.2); }
.btn-outline { background: rgba(255,255,255,0.15); color: #fff; border: 1.5px solid rgba(255,255,255,0.5); }
.btn-outline:hover { background: rgba(255,255,255,0.25); }
.btn-indigo { background: #4f46e5; color: #fff; }
.btn-indigo:hover { background: #4338ca; }
.btn-danger { background: #dc2626; color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-block { display: flex; width: 100%; justify-content: center; }

/* ==================== 模块卡片 ==================== */
.section { max-width: 960px; margin: 0 auto; padding: 0 16px; }
.section-title { font-size: 18px; font-weight: 700; margin: 32px 0 16px; color: #1a1a2e; display: flex; align-items: center; gap: 8px; }
.section-title .badge { font-size: 12px; background: #eef2ff; color: #4f46e5; padding: 2px 8px; border-radius: 10px; font-weight: 500; }

.module-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.module-card {
  background: #fff; border-radius: 12px; padding: 20px 16px; text-align: center;
  transition: all 0.2s; cursor: pointer; border: 2px solid transparent;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.module-card:hover { border-color: #4f46e5; transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,0.08); }
.module-card .card-icon {
  width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  font-size: 22px; color: #fff;
}
.module-card .card-name { font-size: 15px; font-weight: 600; }
.module-card .card-desc { font-size: 12px; color: #6b7280; line-height: 1.4; }

/* SVG图标颜色 */
.icon-svg { width: 24px; height: 24px; fill: currentColor; }

/* ==================== 公告区域 ==================== */
.ann-list { display: flex; flex-direction: column; gap: 10px; }
.ann-item {
  background: #fff; border-radius: 10px; padding: 16px; border-left: 4px solid #4f46e5;
  transition: box-shadow 0.2s;
}
.ann-item:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.06); }
.ann-item .ann-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.ann-item .ann-title { font-size: 15px; font-weight: 600; }
.ann-item .ann-type { font-size: 11px; background: #eef2ff; color: #4f46e5; padding: 2px 8px; border-radius: 8px; }
.ann-item .ann-content { font-size: 13px; color: #4b5563; line-height: 1.6; white-space: pre-wrap; }
.ann-item .ann-meta { font-size: 12px; color: #9ca3af; margin-top: 8px; display: flex; gap: 12px; }
.ann-empty { text-align: center; padding: 32px; color: #9ca3af; font-size: 14px; }

/* ==================== 登录页 ==================== */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card {
  background: #fff; border-radius: 16px; padding: 40px 32px; max-width: 380px; width: 100%;
  box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}
.login-card .login-logo {
  width: 56px; height: 56px; margin: 0 auto 16px; background: linear-gradient(135deg, #4f46e5, #6366f1);
  border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 28px; color: #fff;
}
.login-card h2 { text-align: center; font-size: 22px; margin-bottom: 8px; }
.login-card .login-sub { text-align: center; font-size: 14px; color: #6b7280; margin-bottom: 28px; }
.login-tabs { display: flex; gap: 0; margin-bottom: 24px; background: #f3f4f6; border-radius: 8px; padding: 4px; }
.login-tab { flex: 1; text-align: center; padding: 10px; font-size: 14px; font-weight: 600; color: #6b7280; border-radius: 6px; transition: all 0.2s; }
.login-tab.active { background: #fff; color: #4f46e5; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; color: #374151; }
.form-group input {
  width: 100%; padding: 12px 14px; border: 2px solid #e5e7eb; border-radius: 8px; font-size: 15px; transition: border 0.2s;
}
.form-group input:focus { border-color: #4f46e5; }
.form-group textarea { width: 100%; padding: 12px 14px; border: 2px solid #e5e7eb; border-radius: 8px; font-size: 14px; resize: vertical; min-height: 80px; font-family: inherit; }
.form-group select { width: 100%; padding: 12px 14px; border: 2px solid #e5e7eb; border-radius: 8px; font-size: 14px; background: #fff; }
.login-hint { font-size: 12px; color: #9ca3af; text-align: center; margin-top: 16px; }
.login-back { text-align: center; margin-top: 20px; }
.login-back a { font-size: 14px; color: #4f46e5; }

/* ==================== 学员仪表盘 ==================== */
.dash-container { max-width: 960px; margin: 0 auto; padding: 16px; }
.welcome-banner {
  background: linear-gradient(135deg, #4f46e5, #6366f1); color: #fff;
  border-radius: 14px; padding: 24px 20px; margin-bottom: 20px;
  display: flex; justify-content: space-between; align-items: center;
}
.welcome-banner .wb-left h2 { font-size: 20px; margin-bottom: 4px; }
.welcome-banner .wb-left p { font-size: 13px; opacity: 0.85; }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat-card { background: #fff; border-radius: 12px; padding: 18px 16px; text-align: center; }
.stat-card .stat-value { font-size: 28px; font-weight: 700; color: #4f46e5; }
.stat-card .stat-label { font-size: 12px; color: #6b7280; margin-top: 4px; }
.stat-card .stat-sub { font-size: 11px; color: #9ca3af; margin-top: 2px; }
.stat-card.green .stat-value { color: #16a34a; }
.stat-card.orange .stat-value { color: #ea580c; }
.stat-card.red .stat-value { color: #dc2626; }

.panel { background: #fff; border-radius: 12px; padding: 20px; margin-bottom: 16px; }
.panel-title { font-size: 16px; font-weight: 700; margin-bottom: 14px; display: flex; align-items: center; justify-content: space-between; }

.exam-list { display: flex; flex-direction: column; gap: 10px; }
.exam-item { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; background: #f9fafb; border-radius: 8px; }
.exam-item .exam-info { display: flex; flex-direction: column; gap: 2px; }
.exam-item .exam-cat { font-size: 14px; font-weight: 600; }
.exam-item .exam-date { font-size: 12px; color: #9ca3af; }
.exam-item .exam-score { font-size: 20px; font-weight: 700; }
.exam-item .exam-score.pass { color: #16a34a; }
.exam-item .exam-score.fail { color: #dc2626; }

.progress-bar { height: 8px; background: #e5e7eb; border-radius: 4px; overflow: hidden; margin-top: 6px; }
.progress-bar .fill { height: 100%; background: #4f46e5; border-radius: 4px; transition: width 0.5s; }

/* ==================== 管理员仪表盘 ==================== */
.admin-overview { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-bottom: 20px; }
.overview-card { background: #fff; border-radius: 12px; padding: 20px; text-align: center; position: relative; overflow: hidden; }
.overview-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: #4f46e5; }
.overview-card.green::before { background: #16a34a; }
.overview-card.orange::before { background: #ea580c; }
.overview-card.blue::before { background: #0891b2; }
.overview-card .ov-value { font-size: 32px; font-weight: 700; }
.overview-card .ov-label { font-size: 13px; color: #6b7280; margin-top: 4px; }

.trend-chart { display: flex; align-items: flex-end; gap: 6px; height: 100px; padding: 10px 0; }
.trend-bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.trend-bar .bar { width: 100%; max-width: 40px; background: #4f46e5; border-radius: 4px 4px 0 0; min-height: 2px; transition: height 0.5s; }
.trend-bar .bar-label { font-size: 10px; color: #9ca3af; }

.batch-table, .cat-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.batch-table th, .cat-table th { text-align: left; padding: 8px 12px; background: #f9fafb; font-weight: 600; color: #374151; border-radius: 6px; }
.batch-table td, .cat-table td { padding: 8px 12px; border-bottom: 1px solid #f3f4f6; }
.batch-table tr:last-child td, .cat-table tr:last-child td { border-bottom: none; }

/* ==================== 管理员系统入口 ==================== */
.admin-modules { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.admin-module { background: #fff; border-radius: 10px; padding: 16px; display: flex; gap: 12px; align-items: center; transition: all 0.2s; cursor: pointer; border: 2px solid transparent; }
.admin-module:hover { border-color: #4f46e5; transform: translateY(-1px); }
.admin-module .am-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 18px; flex-shrink: 0; }
.admin-module .am-info { flex: 1; }
.admin-module .am-name { font-size: 14px; font-weight: 600; }
.admin-module .am-desc { font-size: 12px; color: #6b7280; }

/* ==================== 公告管理 ==================== */
.ann-form { background: #fff; border-radius: 12px; padding: 20px; margin-bottom: 16px; }
.ann-form .form-row { display: flex; gap: 12px; margin-bottom: 12px; }
.ann-form .form-row > * { flex: 1; }
.ann-actions { display: flex; gap: 8px; margin-top: 8px; }

/* ==================== 模态框 ==================== */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 200; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal { background: #fff; border-radius: 14px; padding: 28px; max-width: 400px; width: 100%; }
.modal h3 { font-size: 18px; margin-bottom: 16px; }
.modal .modal-actions { display: flex; gap: 10px; margin-top: 20px; }

/* ==================== SSO跳转中 ==================== */
.sso-loading { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; }
.sso-loading .sso-icon { font-size: 48px; }
.sso-loading p { font-size: 16px; color: #6b7280; }

/* ==================== 双入口首页 ==================== */
.entry-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; max-width: 720px; margin: -28px auto 0; padding: 0 16px; position: relative; z-index: 2; }
.entry-card {
  border-radius: 16px; padding: 24px 20px; color: #fff; cursor: pointer;
  transition: all 0.25s; display: flex; align-items: center; gap: 16px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}
.entry-card:hover { transform: translateY(-3px); box-shadow: 0 12px 32px rgba(0,0,0,0.22); }
.entry-card.student { background: linear-gradient(135deg, #4f46e5, #6366f1); }
.entry-card.enterprise { background: linear-gradient(135deg, #059669, #10b981); }
.entry-card .entry-icon {
  width: 56px; height: 56px; border-radius: 14px; background: rgba(255,255,255,0.18);
  display: flex; align-items: center; justify-content: center; font-size: 26px; flex-shrink: 0;
}
.entry-card .entry-info { flex: 1; }
.entry-card .entry-title { font-size: 18px; font-weight: 700; margin-bottom: 3px; }
.entry-card .entry-desc { font-size: 12.5px; opacity: 0.88; line-height: 1.5; }
.entry-card .entry-arrow { font-size: 20px; opacity: 0.8; }

/* ==================== 通知中心 ==================== */
.badge-dot {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: #dc2626; color: #fff; font-size: 11px; font-weight: 700;
}
.nav-btn .badge-dot { position: absolute; top: -5px; right: -8px; }
.nav-btn { position: relative; }

.filter-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.filter-tab {
  padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
  background: #fff; color: #6b7280; border: 2px solid #e5e7eb; transition: all 0.2s;
}
.filter-tab:hover { border-color: #c7d2fe; }
.filter-tab.active { background: #4f46e5; border-color: #4f46e5; color: #fff; }

.notif-list { display: flex; flex-direction: column; gap: 10px; }
.notif-item {
  background: #fff; border-radius: 12px; padding: 16px; cursor: pointer;
  border-left: 4px solid transparent; transition: all 0.2s;
}
.notif-item:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.notif-item.unread { background: #f5f6ff; border-left-color: #4f46e5; }
.notif-item .notif-top { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.notif-item .notif-title { font-size: 15px; font-weight: 600; flex: 1; }
.notif-item.unread .notif-title { color: #4338ca; font-weight: 700; }
.notif-item .notif-meta { font-size: 12px; color: #9ca3af; display: flex; gap: 10px; align-items: center; }

.notif-cat { font-size: 11px; padding: 2px 10px; border-radius: 8px; font-weight: 600; flex-shrink: 0; }
.notif-cat.c-开班 { background: #dcfce7; color: #15803d; }
.notif-cat.c-考试 { background: #fef3c7; color: #b45309; }
.notif-cat.c-领证 { background: #dbeafe; color: #1d4ed8; }
.notif-cat.c-政策 { background: #fce7f3; color: #be185d; }
.notif-cat.c-其他 { background: #f3f4f6; color: #4b5563; }
.notif-cat.c-pinned { background: #fef2f2; color: #dc2626; }

.unread-dot { width: 8px; height: 8px; border-radius: 50%; background: #dc2626; flex-shrink: 0; }
.notif-item.unread .unread-dot { display: block; }
.notif-item .unread-dot { display: none; }

.notif-detail { background: #fff; border-radius: 12px; padding: 24px 20px; }
.notif-detail .nd-title { font-size: 19px; font-weight: 700; margin-bottom: 10px; }
.notif-detail .nd-meta { font-size: 12.5px; color: #9ca3af; margin-bottom: 18px; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.notif-detail .nd-content { font-size: 15px; line-height: 1.9; color: #374151; white-space: pre-wrap; word-break: break-word; }

/* ==================== 通知管理（管理端） ==================== */
.notif-form { background: #fff; border-radius: 12px; padding: 20px; margin-bottom: 16px; }
.notif-form .form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.notif-form .form-full { grid-column: 1 / -1; }
.form-group.inline { display: flex; align-items: center; gap: 8px; margin-bottom: 0; }
.form-group.inline label { margin-bottom: 0; font-size: 13px; }

.notif-admin-item {
  background: #fff; border-radius: 12px; padding: 16px 18px; margin-bottom: 10px;
  border-left: 4px solid #e5e7eb; transition: box-shadow 0.2s;
}
.notif-admin-item:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.06); }
.notif-admin-item.draft { border-left-color: #9ca3af; opacity: 0.85; }
.notif-admin-item.published { border-left-color: #16a34a; }
.notif-admin-item .nai-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.notif-admin-item .nai-title { font-size: 15px; font-weight: 600; flex: 1; min-width: 160px; }
.notif-admin-item .nai-sub { font-size: 12px; color: #9ca3af; display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.notif-admin-item .nai-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.status-badge { font-size: 11px; padding: 2px 10px; border-radius: 8px; font-weight: 600; }
.status-badge.s-published { background: #dcfce7; color: #15803d; }
.status-badge.s-draft { background: #f3f4f6; color: #6b7280; }
.status-badge.s-scheduled { background: #fef3c7; color: #b45309; }
.target-badge { font-size: 11px; background: #eef2ff; color: #4f46e5; padding: 2px 10px; border-radius: 8px; }

.read-progress { height: 6px; background: #f3f4f6; border-radius: 3px; overflow: hidden; flex: 1; min-width: 80px; }
.read-progress .fill { height: 100%; background: #16a34a; border-radius: 3px; }

/* ==================== 企业端 ==================== */
.top-nav.green { background: linear-gradient(135deg, #059669, #10b981); box-shadow: 0 2px 8px rgba(5,150,105,0.3); }
.enterprise-banner {
  background: linear-gradient(135deg, #059669, #10b981); color: #fff;
  border-radius: 14px; padding: 24px 20px; margin-bottom: 20px;
  display: flex; justify-content: space-between; align-items: center;
}
.enterprise-banner h2 { font-size: 20px; margin-bottom: 4px; }
.enterprise-banner p { font-size: 13px; opacity: 0.88; }
.btn-green { background: #059669; color: #fff; }
.btn-green:hover { background: #047857; }

.placeholder-card {
  background: #fff; border-radius: 12px; padding: 20px 16px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  border: 2px dashed #d1d5db; cursor: pointer; transition: all 0.2s;
}
.placeholder-card:hover { border-color: #10b981; background: #f0fdf4; }
.placeholder-card .pc-icon { width: 44px; height: 44px; border-radius: 12px; background: #f3f4f6; display: flex; align-items: center; justify-content: center; font-size: 20px; color: #9ca3af; }
.placeholder-card .pc-name { font-size: 14px; font-weight: 600; color: #374151; }
.placeholder-card .pc-desc { font-size: 12px; color: #9ca3af; }
.placeholder-card .pc-tag { font-size: 10px; background: #fef3c7; color: #b45309; padding: 2px 8px; border-radius: 8px; }

/* ==================== 响应式 ==================== */
@media (max-width: 640px) {
  .home-hero { padding: 40px 16px 60px; }
  .home-hero h1 { font-size: 22px; }
  .module-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-overview { grid-template-columns: repeat(2, 1fr); }
  .admin-modules { grid-template-columns: 1fr; }
  .welcome-banner { flex-direction: column; text-align: center; gap: 12px; }
  .section { padding: 0 12px; }
  .top-nav { padding: 0 12px; }
  .top-nav .nav-user { display: none; }
  .entry-cards { grid-template-columns: 1fr; margin-top: -24px; }
  .notif-form .form-grid { grid-template-columns: 1fr; }
  .entry-card { padding: 18px 16px; }
}
