* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; background: #f8f9fa; color: #333; line-height: 1.6; }
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }

/* 顶部导航 */
.header { background: #fff; border-bottom: 1px solid #eee; position: sticky; top: 0; z-index: 100; }
.header-inner { max-width: 1200px; margin: 0 auto; padding: 0 20px; height: 60px; display: flex; align-items: center; justify-content: space-between; }
.logo { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.logo-icon { width: 36px; height: 36px; background: linear-gradient(135deg, #667eea, #764ba2); border-radius: 8px; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: bold; font-size: 18px; }
.logo-text h1 { font-size: 18px; font-weight: 700; }
.logo-text p { font-size: 12px; color: #999; }
.nav-menu { display: flex; gap: 24px; }
.nav-menu a { font-size: 14px; color: #666; transition: color .2s; }
.nav-menu a:hover { color: #667eea; }

/* 容器 */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* 首页 Hero */
.hero { background: linear-gradient(135deg, #f5f7fa 0%, #e4e8ec 100%); padding: 60px 0 50px; text-align: center; }
.hero h2 { font-size: 36px; font-weight: 800; margin-bottom: 12px; }
.hero h2 span { background: linear-gradient(135deg, #667eea, #764ba2); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.hero p { color: #666; font-size: 16px; margin-bottom: 30px; }
.search-box { max-width: 600px; margin: 0 auto; position: relative; }
.search-box input { width: 100%; padding: 16px 20px 16px 50px; border: 2px solid #e0e0e0; border-radius: 12px; font-size: 16px; outline: none; transition: border-color .2s; background: #fff; }
.search-box input:focus { border-color: #667eea; }
.search-box .search-icon { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); color: #999; font-size: 18px; }
.hot-tags { margin-top: 20px; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.hot-tags a { padding: 6px 14px; background: #fff; border-radius: 20px; font-size: 13px; color: #666; border: 1px solid #eee; transition: all .2s; }
.hot-tags a:hover { border-color: #667eea; color: #667eea; }

/* 学制分类卡片 */
.system-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin: 40px 0; }
.system-card { background: #fff; border-radius: 12px; padding: 24px; cursor: pointer; transition: all .2s; border: 1px solid #eee; }
.system-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,.08); }
.system-card .tag { display: inline-block; padding: 4px 10px; border-radius: 4px; font-size: 12px; font-weight: 600; margin-bottom: 12px; }
.system-card h3 { font-size: 20px; margin-bottom: 8px; }
.system-card p { font-size: 14px; color: #888; margin-bottom: 12px; }
.system-card .count { font-size: 14px; color: #667eea; font-weight: 600; }
.tag-63 { background: #e3f2fd; color: #1976d2; }
.tag-54 { background: #f3e5f5; color: #7b1fa2; }
.tag-high { background: #e8f5e9; color: #388e3c; }

/* 区块标题 */
.section { margin: 40px 0; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.section-header h3 { font-size: 22px; font-weight: 700; }
.section-header a { font-size: 14px; color: #667eea; }

/* 教材网格 */
.book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 20px; }
.book-card { background: #fff; border-radius: 10px; overflow: hidden; cursor: pointer; transition: all .2s; border: 1px solid #eee; }
.book-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,.1); }
.book-cover { aspect-ratio: 3/4; background: #f0f0f0; display: flex; align-items: center; justify-content: center; overflow: hidden; position: relative; }
.book-cover img { width: 100%; height: 100%; object-fit: cover; }
.book-cover .no-cover { font-size: 48px; color: #ccc; }
.book-info { padding: 12px; }
.book-tags { display: flex; gap: 6px; margin-bottom: 6px; flex-wrap: wrap; }
.book-tag { font-size: 11px; padding: 2px 6px; border-radius: 3px; background: #f0f0f0; color: #666; }
.book-title { font-size: 14px; font-weight: 600; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.book-meta { font-size: 12px; color: #999; margin-top: 4px; }

/* 教材导航 */
.nav-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.nav-item { background: #fff; border-radius: 10px; padding: 16px; border: 1px solid #eee; }
.nav-item h4 { font-size: 16px; margin-bottom: 10px; color: #333; }
.nav-item .sub-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.nav-item .sub-tags a { font-size: 13px; color: #666; padding: 4px 10px; background: #f5f5f5; border-radius: 4px; transition: all .2s; }
.nav-item .sub-tags a:hover { background: #667eea; color: #fff; }

/* 详情页 */
.detail-hero { background: #fff; padding: 30px 0; border-bottom: 1px solid #eee; }
.breadcrumb { font-size: 14px; color: #999; margin-bottom: 20px; }
.breadcrumb a { color: #667eea; }
.detail-main { display: grid; grid-template-columns: 280px 1fr; gap: 40px; }
.detail-cover { aspect-ratio: 3/4; border-radius: 12px; overflow: hidden; box-shadow: 0 8px 24px rgba(0,0,0,.1); }
.detail-cover img { width: 100%; height: 100%; object-fit: cover; }
.detail-info h1 { font-size: 28px; margin-bottom: 12px; }
.detail-tags { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.detail-tags span { padding: 4px 12px; border-radius: 4px; font-size: 13px; }
.detail-actions { display: flex; gap: 12px; margin-bottom: 24px; }
.btn { padding: 12px 28px; border-radius: 8px; font-size: 15px; font-weight: 600; cursor: pointer; border: none; transition: all .2s; display: inline-flex; align-items: center; gap: 8px; }
.btn-primary { background: #1a1a1a; color: #fff; }
.btn-primary:hover { background: #333; }
.btn-outline { background: #fff; color: #333; border: 1px solid #ddd; }
.btn-outline:hover { border-color: #999; }
.btn-sm { padding: 8px 16px; font-size: 13px; }
.detail-desc { font-size: 14px; color: #666; margin-bottom: 20px; }
.info-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; background: #f9f9f9; padding: 20px; border-radius: 10px; }
.info-item { font-size: 14px; }
.info-item .label { color: #999; margin-right: 8px; }

/* 目录 */
.toc-section { margin: 30px 0; }
.toc-list { background: #fff; border-radius: 10px; padding: 20px; border: 1px solid #eee; }
.toc-item { padding: 8px 0; border-bottom: 1px solid #f0f0f0; font-size: 14px; display: flex; gap: 10px; }
.toc-item:last-child { border-bottom: none; }
.toc-item .num { color: #999; min-width: 24px; }

/* 相关教材 */
.related-section { margin: 30px 0; }

/* 列表页 */
.list-header { background: #fff; padding: 24px 0; border-bottom: 1px solid #eee; }
.list-header h2 { font-size: 24px; margin-bottom: 8px; }
.list-header p { color: #888; font-size: 14px; }
.filter-bar { display: flex; flex-wrap: wrap; gap: 12px; margin: 20px 0; }
.filter-select { padding: 8px 14px; border: 1px solid #ddd; border-radius: 6px; font-size: 14px; background: #fff; outline: none; }
.filter-select:focus { border-color: #667eea; }
.pagination { display: flex; justify-content: center; gap: 8px; margin: 30px 0; }
.pagination button { padding: 8px 14px; border: 1px solid #ddd; background: #fff; border-radius: 6px; cursor: pointer; font-size: 14px; }
.pagination button.active { background: #667eea; color: #fff; border-color: #667eea; }
.pagination button:disabled { opacity: .5; cursor: not-allowed; }

/* 后台管理 */
.admin-login { max-width: 400px; margin: 80px auto; background: #fff; padding: 40px; border-radius: 12px; box-shadow: 0 4px 20px rgba(0,0,0,.08); }
.admin-login h2 { text-align: center; margin-bottom: 24px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 14px; margin-bottom: 6px; color: #666; }
.form-group input, .form-group textarea, .form-group select { width: 100%; padding: 10px 12px; border: 1px solid #ddd; border-radius: 6px; font-size: 14px; outline: none; }
.form-group input:focus, .form-group textarea:focus { border-color: #667eea; }
.admin-header { background: #1a1a1a; color: #fff; padding: 12px 20px; display: flex; justify-content: space-between; align-items: center; }
.admin-header h2 { font-size: 18px; }
.admin-header .actions { display: flex; gap: 10px; }
.admin-table { width: 100%; border-collapse: collapse; background: #fff; }
.admin-table th, .admin-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #eee; font-size: 13px; }
.admin-table th { background: #f5f5f5; font-weight: 600; }
.admin-table tr:hover { background: #fafafa; }
.admin-table .cover-thumb { width: 40px; height: 54px; object-fit: cover; border-radius: 4px; }
.batch-bar { background: #fff; padding: 16px 20px; border-bottom: 1px solid #eee; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.batch-bar input[type="text"] { flex: 1; min-width: 300px; padding: 8px 12px; border: 1px solid #ddd; border-radius: 6px; }
.modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,.5); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.modal { background: #fff; border-radius: 12px; padding: 24px; max-width: 600px; width: 90%; max-height: 80vh; overflow-y: auto; }
.modal h3 { margin-bottom: 16px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.toast { position: fixed; top: 20px; right: 20px; padding: 12px 20px; border-radius: 8px; color: #fff; font-size: 14px; z-index: 2000; animation: slideIn .3s; }
.toast-success { background: #4caf50; }
.toast-error { background: #f44336; }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* 页脚 */
.footer { background: #1a1a1a; color: #999; padding: 40px 0 20px; margin-top: 60px; }
.footer-inner { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 30px; }
.footer h4 { color: #fff; font-size: 15px; margin-bottom: 16px; }
.footer p, .footer a { font-size: 13px; color: #999; line-height: 2; }
.footer a:hover { color: #fff; }
.footer-bottom { text-align: center; padding-top: 20px; border-top: 1px solid #333; font-size: 12px; }

.loading { text-align: center; padding: 60px; color: #999; }
.empty { text-align: center; padding: 60px; color: #999; }
.empty .icon { font-size: 48px; margin-bottom: 12px; }

@media (max-width: 768px) {
  .system-cards { grid-template-columns: 1fr; }
  .detail-main { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .nav-menu { display: none; }
  .hero h2 { font-size: 28px; }
}
