/* 史地教育云平台 - 全局样式 */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Microsoft YaHei', 'PingFang SC', sans-serif; font-size: 14px; color: #333; background: #f0f2f5; line-height: 1.6; }
a { color: #1a73e8; text-decoration: none; }
a:hover { color: #1557b0; }
.container { max-width: 1200px; margin: 0 auto; padding: 20px; }

/* Header */
.site-header { background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,0.08); position: sticky; top: 0; z-index: 100; }
.header-container { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; padding: 0 20px; height: 56px; }
.logo { font-size: 20px; font-weight: 700; color: #1a73e8; margin-right: 24px; white-space: nowrap; }
.main-nav { display: flex; gap: 4px; }
.main-nav a { padding: 8px 14px; border-radius: 4px; color: #555; font-size: 14px; }
.main-nav a:hover { background: #e8f0fe; color: #1a73e8; }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.header-search { display: flex; }
.header-search input { border: 1px solid #ddd; border-right: none; padding: 6px 12px; border-radius: 4px 0 0 4px; width: 160px; font-size: 13px; }
.header-search button { background: #1a73e8; color: #fff; border: none; padding: 6px 14px; border-radius: 0 4px 4px 0; cursor: pointer; font-size: 13px; }
.user-menu { display: flex; align-items: center; gap: 10px; }
.user-info { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.user-hover-menu { position: relative; }
.user-dropdown { display:none; position:absolute; right:0; top:calc(100% + 8px); min-width:130px; padding:6px; background:#fff; border:1px solid #e1e8f0; border-radius:8px; box-shadow:0 10px 24px rgba(20,45,75,.16); z-index:120; }
.user-dropdown a { display:block; padding:8px 12px; color:#38516a; white-space:nowrap; border-radius:5px; }
.user-dropdown a:hover { background:#edf5ff; color:#1463a5; }
.user-hover-menu { position:relative; padding-bottom:10px; margin-bottom:-10px; }
.user-hover-menu:hover .user-dropdown, .user-hover-menu:focus-within .user-dropdown { display:block; }
.points-badge { background: #fff3e0; color: #e65100; padding: 2px 8px; border-radius: 10px; font-size: 12px; }
.msg-link { position: relative; }
.badge { position: absolute; top: -6px; right: -10px; background: #f44336; color: #fff; border-radius: 10px; padding: 1px 5px; font-size: 11px; }
.btn-admin { background: #e8f0fe; padding: 4px 10px; border-radius: 4px; font-size: 13px; }
.btn-logout { color: #999; font-size: 13px; }
.auth-links a { padding: 6px 12px; border-radius: 4px; font-size: 13px; }
.auth-links a:last-child { background: #1a73e8; color: #fff; }

/* ============================================================
   通用组件样式
   ============================================================ */
.btn { display: inline-block; padding: 8px 18px; border: 1px solid #d1d5db; border-radius: 5px; background: #fff; color: #374151; font-size: 13px; font-weight: 500; cursor: pointer; text-decoration: none; transition: all 0.2s; }
.btn:hover { background: #f9fafb; border-color: #9ca3af; }
.btn-primary { background: #1a73e8; color: #fff; border-color: #1a73e8; }
.btn-primary:hover { background: #1557b0; border-color: #1557b0; }
.btn-outline { background: transparent; color: #1a73e8; border-color: #1a73e8; }
.btn-outline:hover { background: #1a73e8; color: #fff; }
.btn-sm { padding: 4px 12px; font-size: 12px; }
.btn-block { display: block; width: 100%; }
.btn-danger { background: #dc2626; color: #fff; border-color: #dc2626; }
.btn-danger:hover { background: #b91c1c; }

.alert { padding: 12px 16px; border-radius: 5px; margin-bottom: 16px; font-size: 13px; }
.alert-error { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }
.alert-info { background: #eff6ff; color: #2563eb; border: 1px solid #bfdbfe; }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 5px; font-size: 13px; font-weight: 600; color: #374151; }
.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="email"],
.form-group input[type="number"],
.form-group textarea,
.form-group select { width: 100%; padding: 9px 12px; border: 1px solid #d1d5db; border-radius: 5px; font-size: 14px; color: #374151; outline: none; transition: border-color 0.2s; }
.form-group input:focus, .form-group textarea:focus, .form-group select:focus { border-color: #1a73e8; box-shadow: 0 0 0 3px rgba(26,115,232,0.1); }
.form-group textarea { resize: vertical; min-height: 100px; }
.required { color: #dc2626; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.form-footer { text-align: center; margin-top: 16px; font-size: 13px; color: #6b7280; }

.breadcrumb { font-size: 13px; color: #6b7280; margin-bottom: 20px; padding: 8px 0; }
.breadcrumb a { color: #1a73e8; }
.breadcrumb span { color: #374151; }

.pagination { display: flex; justify-content: center; align-items: center; gap: 6px; margin: 28px 0; }
.pagination a,
.pagination span { padding: 6px 14px; border-radius: 4px; font-size: 13px; text-decoration: none; border: 1px solid #e5e7eb; color: #374151; transition: all 0.2s; }
.pagination a:hover { background: #f3f4f6; }
.pagination .current { background: #1a73e8; color: #fff; border-color: #1a73e8; }

.empty-state { text-align: center; padding: 48px 20px; color: #9ca3af; font-size: 15px; }

.data-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 6px; overflow: hidden; }
.data-table th { background: #f8fafc; font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; color: #64748b; padding: 12px 16px; text-align: left; border-bottom: 2px solid #e2e8f0; }
.data-table td { padding: 12px 16px; font-size: 13px; color: #334155; border-bottom: 1px solid #f1f5f9; }
.data-table tr:hover td { background: #fafbfc; }

.text-green { color: #16a34a; }
.text-orange { color: #f59e0b; }
.text-red { color: #dc2626; }
.text-blue { color: #1a73e8; }

.flex-row { display: flex; gap: 12px; align-items: center; }

/* ============================================================
   Auth Pages
   ============================================================ */
.auth-page { max-width: 400px; margin: 60px auto; }
.auth-form { background: #fff; border-radius: 8px; padding: 32px 28px; border: 1px solid #e5e7eb; }
.auth-form h2 { font-size: 20px; color: #1e293b; margin-bottom: 24px; text-align: center; }

/* ============================================================
   Section Header
   ============================================================ */
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.section-header h2 { font-size: 20px; color: #1e293b; font-weight: 700; }
.section-subtitle { font-size: 13px; color: #94a3b8; margin-top: 4px; }

/* ============================================================
   Resource Index / Filter Bar
   ============================================================ */
.resource-index-page { padding: 24px 0; }
.filter-bar { margin-bottom: 24px; }
.filter-bar-enhanced { background: #fff; padding: 20px; border-radius: 8px; border: 1px solid #e5e7eb; }
.filter-form { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.filter-row { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-end; }
.filter-group label { display: block; font-size: 12px; font-weight: 600; color: #64748b; margin-bottom: 4px; }
.filter-group select,
.filter-group input { padding: 8px 12px; border: 1px solid #d1d5db; border-radius: 5px; font-size: 13px; color: #374151; outline: none; min-width: 140px; }
.filter-group select:focus,
.filter-group input:focus { border-color: #1a73e8; }
.filter-search { flex: 1; min-width: 200px; }
.search-input-wrap { display: flex; gap: 8px; }
.search-input-wrap input { flex: 1; }

/* ============================================================
   Resource List Grid
   ============================================================ */
.resource-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin-top: 16px; }
.resource-card { background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; padding: 20px; transition: box-shadow 0.2s; }
.resource-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.06); }
.resource-card h3 { font-size: 15px; margin-bottom: 10px; }
.resource-card h3 a { color: #1e293b; text-decoration: none; }
.resource-card h3 a:hover { color: #1a73e8; }
.resource-meta { display: flex; justify-content: space-between; font-size: 12px; color: #94a3b8; }

/* ============================================================
   Resource Detail V2
   ============================================================ */
.resource-detail-page-v2 { padding: 24px 0; }
.rd-layout { display: grid; grid-template-columns: 1fr 320px; gap: 24px; }
.rd-main { min-width: 0; }
.rd-card { background: #fff; border-radius: 8px; padding: 28px; border: 1px solid #e5e7eb; margin-bottom: 20px; }
.rd-title { font-size: 22px; font-weight: 700; color: #1e293b; margin-bottom: 16px; line-height: 1.4; }
.rd-meta-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.rd-tag { display: inline-block; padding: 3px 12px; border-radius: 4px; font-size: 12px; font-weight: 600; }
.tag-subject { background: #eff6ff; color: #2563eb; }
.tag-grade { background: #f0fdf4; color: #16a34a; }
.tag-type { background: #fef3e3; color: #d97706; }
.tag-source { background: #f3e8ff; color: #7c3aed; }
.rd-stats-row { display: flex; gap: 24px; flex-wrap: wrap; margin-bottom: 24px; padding-bottom: 20px; border-bottom: 1px solid #f1f5f9; }
.rd-stat-item { display: flex; align-items: center; gap: 10px; }
.rd-stat-icon { font-size: 20px; }
.rd-stat-num { font-size: 18px; font-weight: 700; color: #1e293b; }
.rd-stat-text { font-size: 12px; color: #94a3b8; }
.rd-desc { font-size: 14px; color: #475569; line-height: 1.8; margin-bottom: 20px; }
.rd-detail-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-top: 20px; padding-top: 16px; border-top: 1px solid #f1f5f9; }
.rd-meta-item { font-size: 13px; }
.rd-meta-item .rd-meta-label { color: #94a3b8; display: block; font-size: 11px; margin-bottom: 2px; }
.rd-meta-item .rd-meta-val { color: #334155; font-weight: 500; }
.rd-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 24px; }
.rd-sidebar { position: sticky; top: 76px; }
.rd-side-card { background: #fff; border-radius: 8px; padding: 24px; border: 1px solid #e5e7eb; margin-bottom: 16px; }
.rd-side-card h4 { font-size: 14px; font-weight: 700; color: #1e293b; margin-bottom: 14px; }
.rd-author { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.rd-author-avatar { width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, #1e3a5f, #3b5998); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 700; }
.rd-author-name { font-size: 14px; font-weight: 600; color: #1e293b; }
.rd-author-school { font-size: 12px; color: #94a3b8; }
.rd-file-info { font-size: 13px; color: #475569; line-height: 1.8; }
.rd-file-info span { display: block; }

/* ============================================================
   Content Pages
   ============================================================ */
.content-detail { background: #fff; border-radius: 8px; padding: 32px 28px; border: 1px solid #e5e7eb; }
.content-detail h1 { font-size: 22px; color: #1e293b; margin-bottom: 14px; line-height: 1.5; }
.detail-meta { font-size: 12px; color: #94a3b8; margin-bottom: 24px; display: flex; gap: 16px; flex-wrap: wrap; padding-bottom: 16px; border-bottom: 1px solid #f1f5f9; }
.content-body { font-size: 15px; color: #334155; line-height: 1.9; }
.content-body p { margin-bottom: 14px; }
.content-body img { max-width: 100%; border-radius: 4px; margin: 12px 0; }

/* Content List */
.article-list-full { display: flex; flex-direction: column; gap: 12px; }
.article-item { background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; padding: 20px; transition: box-shadow 0.2s; }
.article-item:hover { box-shadow: 0 2px 10px rgba(0,0,0,0.05); }
.article-item h3 { font-size: 16px; margin-bottom: 8px; }
.article-item h3 a { color: #1e293b; text-decoration: none; }
.article-item h3 a:hover { color: #1a73e8; }
.article-meta-full { display: flex; gap: 16px; font-size: 12px; color: #94a3b8; margin-bottom: 8px; flex-wrap: wrap; }
.article-summary { font-size: 13px; color: #64748b; line-height: 1.6; }
.top-badge { display: inline-block; padding: 2px 8px; background: #dc2626; color: #fff; font-size: 11px; border-radius: 3px; margin-right: 8px; font-weight: 600; }

/* ============================================================
   Comments Full (资源详情 + 新闻详情共用)
   ============================================================ */
.cmt-section { margin-top: 28px; }
.cmt-header { margin-bottom: 16px; }
.cmt-title { font-size: 16px; color: #1e293b; font-weight: 600; }
.cmt-count { color: #94a3b8; font-weight: 400; }

/* 评论输入区 */
.cmt-post { display: flex; gap: 12px; padding: 16px; background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; margin-bottom: 16px; }
.cmt-post-avatar { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, #1e3a5f, #3b5998); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; flex-shrink: 0; }
.cmt-post-form { flex: 1; }
.cmt-post-form textarea { width: 100%; padding: 10px 12px; border: 1px solid #d1d5db; border-radius: 5px; font-size: 13px; outline: none; resize: vertical; min-height: 72px; }
.cmt-post-form textarea:focus { border-color: #1a73e8; }
.cmt-post-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
.cmt-post-hint { font-size: 11px; color: #94a3b8; }
.cmt-submit-btn { padding: 6px 18px; background: #1a73e8; color: #fff; border: none; border-radius: 4px; font-size: 13px; cursor: pointer; font-weight: 600; transition: background 0.2s; }
.cmt-submit-btn:hover { background: #1557b0; }

/* 登录提示 */
.cmt-login-hint { text-align: center; padding: 20px; background: #f8fafc; border: 1px dashed #e2e8f0; border-radius: 8px; font-size: 14px; color: #64748b; margin-bottom: 16px; }
.cmt-login-hint a { color: #1a73e8; font-weight: 600; }

/* 空状态 */
.cmt-empty { text-align: center; padding: 32px; color: #94a3b8; font-size: 14px; }

/* 评论列表 */
.cmt-list { display: flex; flex-direction: column; gap: 12px; }
.cmt-item { display: flex; gap: 12px; background: #fff; border: 1px solid #edf2f7; border-radius: 8px; padding: 16px; }
.cmt-item-avatar { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, #1e3a5f, #3b5998); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; flex-shrink: 0; }
.cmt-item-body { flex: 1; min-width: 0; }
.cmt-item-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.cmt-item-name { font-size: 13px; font-weight: 600; color: #1e293b; }
.cmt-item-role { font-size: 10px; padding: 1px 7px; border-radius: 3px; font-weight: 600; }
.cmt-role-admin { background: #fef3e3; color: #d97706; }
.cmt-role-teacher { background: #eff6ff; color: #2563eb; }
.cmt-item-rating { font-size: 11px; color: #f5a623; letter-spacing: 1px; }
.cmt-item-time { font-size: 11px; color: #94a3b8; margin-left: auto; }
.cmt-item-content { font-size: 13px; color: #475569; line-height: 1.7; word-break: break-word; }
.cmt-item-actions { margin-top: 8px; display: flex; gap: 12px; }

/* 回复评论缩进 */
.cmt-reply { margin-left: 46px; border-left: 3px solid #e2e8f0; padding-left: 16px; }

/* 点赞按钮 */
.cmt-like-btn { font-size: 12px; color: #94a3b8; cursor: pointer; background: none; border: none; padding: 2px 6px; border-radius: 4px; transition: all 0.2s; }
.cmt-like-btn:hover { color: #ef4444; background: #fef2f2; }
.cmt-like-btn.liked { color: #ef4444; font-weight: 600; }
.cmt-like-text { margin-left: 2px; }

/* 回复按钮 */
.cmt-reply-toggle { font-size: 12px; color: #1a73e8; cursor: pointer; background: none; border: none; padding: 2px 6px; border-radius: 4px; transition: background 0.2s; }
.cmt-reply-toggle:hover { background: #eff6ff; }

/* 回复框 */
.cmt-reply-box { margin-top: 10px; }
.cmt-reply-box textarea { width: 100%; padding: 8px 12px; border: 1px solid #d1d5db; border-radius: 5px; font-size: 12px; outline: none; resize: vertical; min-height: 56px; }
.cmt-reply-box textarea:focus { border-color: #1a73e8; }
.cmt-reply-box-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.cmt-reply-cancel { padding: 4px 14px; font-size: 12px; color: #64748b; background: #f1f5f9; border: 1px solid #e2e8f0; border-radius: 4px; cursor: pointer; }
.cmt-reply-cancel:hover { background: #e2e8f0; }
.cmt-reply-submit { padding: 4px 14px; font-size: 12px; color: #fff; background: #1a73e8; border: none; border-radius: 4px; cursor: pointer; font-weight: 600; }
.cmt-reply-submit:hover { background: #1557b0; }

/* ============================================================
   Star Rating V2 (资源详情评分)
   ============================================================ */
.star-rating-v2 { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.sr-label { font-size: 12px; color: #64748b; font-weight: 600; }
.sr-stars { display: flex; flex-direction: row-reverse; gap: 2px; }
.sr-stars input { display: none; }
.sr-stars label { font-size: 22px; color: #d1d5db; cursor: pointer; transition: color 0.15s; }
.sr-stars label:hover,
.sr-stars label:hover ~ label,
.sr-stars input:checked ~ label { color: #f5a623; }

/* ============================================================
   Resource Detail - Additional
   ============================================================ */
.btn-lg { padding: 12px 28px; font-size: 15px; }
.btn-secondary { background: #475569; color: #fff; border-color: #475569; }
.btn-secondary:hover { background: #334155; border-color: #334155; }
.rd-description { margin-top: 24px; }
.rd-description h3 { font-size: 15px; color: #1e293b; font-weight: 600; margin-bottom: 10px; }
.rd-desc-content { font-size: 14px; color: #475569; line-height: 1.8; }

/* 右侧边栏卡片 */
.rd-sidebar-card { margin-bottom: 16px; }
.rd-author-info { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.rd-author-name { font-size: 14px; font-weight: 600; color: #1e293b; text-decoration: none; }
.rd-author-name:hover { color: #1a73e8; }
.rd-author-time { font-size: 12px; color: #94a3b8; margin-top: 2px; }

/* 文件信息 */
.rd-file-info { list-style: none; padding: 0; margin: 0; }
.rd-file-info li { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid #f1f5f9; font-size: 13px; }
.rd-file-info li:last-child { border-bottom: none; }
.rdfi-label { color: #94a3b8; }
.rdfi-value { color: #334155; font-weight: 500; }

/* 相关推荐 */
.rd-related-list { list-style: none; padding: 0; margin: 0; }
.rd-related-list li { padding: 10px 0; border-bottom: 1px solid #f1f5f9; }
.rd-related-list li:last-child { border-bottom: none; padding-bottom: 0; }
.rd-related-list a { font-size: 13px; color: #334155; text-decoration: none; display: block; line-height: 1.4; margin-bottom: 4px; }
.rd-related-list a:hover { color: #1a73e8; }
.rd-related-meta { font-size: 11px; color: #94a3b8; display: flex; gap: 10px; }

/* ============================================================
   Admin Pages
   ============================================================ */
.admin-page { padding: 24px 0; }
.admin-header-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.admin-header-bar h2 { font-size: 20px; color: #1e293b; font-weight: 700; }
.admin-welcome { margin-bottom: 28px; }
.admin-welcome h2 { font-size: 22px; color: #1e293b; margin-bottom: 6px; }
.welcome-sub { font-size: 14px; color: #64748b; }
.admin-stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 28px; }
.admin-stat-card { display: flex; align-items: center; gap: 16px; background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; padding: 20px; text-decoration: none; color: inherit; transition: box-shadow 0.2s; position: relative; }
.admin-stat-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.06); }
.admin-stat-icon { width: 52px; height: 52px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.icon-blue { background: #eff6ff; color: #2563eb; }
.icon-green { background: #f0fdf4; color: #16a34a; }
.icon-orange { background: #fef3e3; color: #d97706; }
.icon-purple { background: #f3e8ff; color: #7c3aed; }
.admin-stat-info { flex: 1; }
.admin-stat-num { font-size: 26px; font-weight: 700; color: #1e293b; line-height: 1; }
.admin-stat-label { font-size: 12px; color: #94a3b8; margin-top: 4px; }
.admin-badge-pending { position: absolute; top: 10px; right: 14px; background: #fef3e3; color: #d97706; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 10px; }

/* Admin Layout */
.admin-layout { display: flex; min-height: calc(100vh - 56px); }
.admin-sidebar { width: 220px; background: #1e293b; color: #cbd5e1; flex-shrink: 0; display: flex; flex-direction: column; position: sticky; top: 56px; height: calc(100vh - 56px); overflow-y: auto; }
.sidebar-header { padding: 20px 16px 14px; border-bottom: 1px solid #334155; }
.admin-logo { font-size: 16px; font-weight: 700; color: #fff; text-decoration: none; }
.sidebar-nav { flex: 1; padding: 8px 0; }
.nav-group { margin-bottom: 4px; }
.nav-group-title { font-size: 11px; font-weight: 600; color: #64748b; text-transform: uppercase; letter-spacing: 0.5px; padding: 12px 16px 6px; }
.nav-item { display: block; padding: 8px 16px 8px 24px; font-size: 13px; color: #94a3b8; text-decoration: none; transition: all 0.15s; border-left: 3px solid transparent; }
.nav-item:hover { background: #1e3a5f; color: #e2e8f0; }
.nav-item.active { background: rgba(26,115,232,0.15); color: #60a5fa; border-left-color: #3b82f6; font-weight: 600; }
.sidebar-footer { padding: 12px 16px; border-top: 1px solid #334155; }
.sidebar-footer a { font-size: 12px; color: #64748b; text-decoration: none; }
.sidebar-footer a:hover { color: #94a3b8; }
.admin-main { flex: 1; padding: 24px 28px; min-width: 0; background: #f8fafc; }

/* Admin stat card variants */
.admin-stat-card.highlight-orange { border-color: #fdba74; background: #fff7ed; }
.icon-cyan { background: #ecfeff; color: #0891b2; }
.icon-red { background: #fef2f2; color: #dc2626; }
.icon-teal { background: #f0fdfa; color: #0d9488; }
.icon-gray { background: #f3f4f6; color: #6b7280; }

/* Admin modules */
.admin-modules { margin-bottom: 28px; }
.admin-modules h3 { font-size: 17px; color: #1e293b; margin-bottom: 14px; }
.module-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.module-card { display: flex; align-items: center; gap: 14px; background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; padding: 18px; text-decoration: none; color: inherit; transition: box-shadow 0.2s; position: relative; }
.module-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.06); }
.module-icon { width: 48px; height: 48px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.module-icon.blue { background: #eff6ff; color: #2563eb; }
.module-icon.green { background: #f0fdf4; color: #16a34a; }
.module-icon.purple { background: #f3e8ff; color: #7c3aed; }
.module-icon.cyan { background: #ecfeff; color: #0891b2; }
.module-icon.orange { background: #fef3e3; color: #d97706; }
.module-icon.red { background: #fef2f2; color: #dc2626; }
.module-icon.teal { background: #f0fdfa; color: #0d9488; }
.module-icon.gray { background: #f3f4f6; color: #6b7280; }
.module-info { flex: 1; min-width: 0; }
.module-info h4 { font-size: 14px; color: #1e293b; margin-bottom: 2px; }
.module-info p { font-size: 12px; color: #94a3b8; margin: 0; }
.module-badge { position: absolute; top: 12px; right: 14px; background: #fef3e3; color: #d97706; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 10px; }

/* Admin bottom panels */
.admin-bottom-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.admin-panel { background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; padding: 0; overflow: hidden; }
.panel-header { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid #f1f5f9; }
.panel-header h4 { font-size: 14px; color: #1e293b; font-weight: 600; margin: 0; }
.panel-more { font-size: 12px; color: #1a73e8; text-decoration: none; }
.panel-more:hover { text-decoration: underline; }
.admin-panel .data-table { margin: 0; border: none; }
.admin-panel .data-table th:first-child,
.admin-panel .data-table td:first-child { padding-left: 18px; }
.admin-panel .data-table th:last-child,
.admin-panel .data-table td:last-child { padding-right: 18px; }

/* Admin footer */
.admin-footer-info { text-align: center; padding: 16px 0 8px; font-size: 12px; color: #94a3b8; }

/* ============================================================
   User Pages
   ============================================================ */
.user-dashboard { display: grid; grid-template-columns: 240px 1fr; gap: 28px; padding: 28px 0; }
.user-sidebar { background: #fff; border-radius: 8px; border: 1px solid #e5e7eb; padding: 24px; text-align: center; position: sticky; top: 76px; align-self: start; }
.user-avatar-lg { margin-bottom: 12px; }
.user-avatar-lg img { border-radius: 50%; object-fit: cover; }
.user-sidebar h3 { font-size: 17px; color: #1e293b; margin-bottom: 4px; }
.user-bio { font-size: 12px; color: #94a3b8; margin-bottom: 8px; }
.dashboard-nav { display: flex; flex-direction: column; gap: 2px; margin-top: 16px; text-align: left; }
.dashboard-nav a { display: block; padding: 8px 14px; border-radius: 4px; font-size: 13px; color: #475569; text-decoration: none; transition: all 0.15s; }
.dashboard-nav a:hover { background: #f3f4f6; }
.dashboard-nav a.active { background: #eff6ff; color: #1a73e8; font-weight: 600; }
.dashboard-content { min-width: 0; }
.stats-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; margin-bottom: 24px; }
.stat-card { background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; padding: 18px; text-align: center; }
.stat-num { font-size: 24px; font-weight: 700; color: #1e293b; }
.stat-label { font-size: 12px; color: #94a3b8; margin-top: 2px; }

/* User Profile */
.user-profile-page { padding: 28px 0; }
.profile-header { display: flex; gap: 24px; background: #fff; border-radius: 8px; border: 1px solid #e5e7eb; padding: 28px; margin-bottom: 24px; align-items: center; }
.profile-avatar img { border-radius: 50%; object-fit: cover; }
.profile-info h1 { font-size: 22px; color: #1e293b; margin-bottom: 6px; }
.profile-info p { font-size: 13px; color: #64748b; margin-bottom: 4px; }
.bio { font-size: 13px; color: #475569; margin-top: 6px; }
.profile-stats { display: flex; gap: 20px; margin-top: 10px; font-size: 13px; color: #64748b; }
.profile-stats strong { color: #1e293b; }
.profile-actions { margin-top: 12px; display: flex; gap: 8px; }
.profile-tabs { display: flex; gap: 4px; margin-bottom: 16px; }
.tab { padding: 8px 18px; border-radius: 4px; font-size: 13px; cursor: pointer; color: #64748b; background: #f3f4f6; transition: all 0.15s; }
.tab:hover { background: #e5e7eb; }
.tab.active { background: #1a73e8; color: #fff; }
.tab-content { padding: 8px 0; }

/* ============================================================
   Upload Page
   ============================================================ */
.upload-form { background: #fff; border-radius: 8px; padding: 28px; border: 1px solid #e5e7eb; max-width: 680px; }
.upload-form h2 { margin-bottom: 24px; }

/* ============================================================
   Resource List Enhanced (资源列表增强)
   ============================================================ */
.resource-grid-enhanced { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; padding-top: 8px; }
.resource-card-enhanced { display: block; background: #fff; border-radius: 10px; overflow: hidden; text-decoration: none; color: inherit; border: 1px solid #e5e7eb; transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94); }
.resource-card-enhanced:hover { transform: translateY(-4px); box-shadow: 0 8px 28px rgba(0,0,0,0.09); border-color: #d1d5db; }

.rce-cover { position: relative; height: 160px; overflow: hidden; background: linear-gradient(135deg, #f8fafc, #f1f5f9); }
.rce-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s; }
.resource-card-enhanced:hover .rce-cover img { transform: scale(1.05); }
.rce-cover-placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; gap: 6px; }
.rce-cover-icon { font-size: 36px; opacity: 0.35; }
.rce-cover-ext { font-size: 12px; color: #94a3b8; font-weight: 600; letter-spacing: 1px; }
.rce-badges { position: absolute; top: 10px; left: 10px; display: flex; gap: 6px; }
.rce-badge { padding: 3px 10px; border-radius: 4px; font-size: 11px; font-weight: 600; backdrop-filter: blur(6px); }
.rce-badge.subject { background: rgba(26,115,232,0.85); color: #fff; }
.rce-badge.type { background: rgba(30,41,59,0.75); color: #fff; }

.rce-body { padding: 18px; }
.rce-title { font-size: 15px; font-weight: 600; color: #1e293b; line-height: 1.5; margin-bottom: 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rce-grade { font-size: 12px; color: #64748b; margin-bottom: 10px; }
.rce-stats { display: flex; gap: 14px; font-size: 12px; color: #94a3b8; margin-bottom: 10px; }
.rce-stat { display: flex; align-items: center; gap: 3px; }
.rce-rating { color: #f5a623; }
.rce-author { font-size: 12px; color: #94a3b8; padding-top: 10px; border-top: 1px solid #f1f5f9; }

/* Pagination Enhanced */
.pagination-enhanced { margin: 32px 0; }
.pagination-enhanced a,
.pagination-enhanced span { display: inline-block; padding: 8px 16px; border-radius: 6px; font-size: 13px; text-decoration: none; margin: 0 3px; }
.page-prev, .page-next, .page-link { background: #fff; color: #475569; border: 1px solid #e2e8f0; }
.page-prev:hover, .page-next:hover, .page-link:hover { background: #f1f5f9; }
.page-current { background: #1a73e8; color: #fff; border: 1px solid #1a73e8; }

/* Empty Icon */
.empty-icon { font-size: 48px; color: #cbd5e1; margin-bottom: 16px; }

/* ============================================================
   Misc Utility
   ============================================================ */
/* Footer */
.site-footer { background: #1e293b; color: #94a3b8; padding: 28px 0; margin-top: 40px; }
.footer-container { max-width: 1200px; margin: 0 auto; padding: 0 20px; text-align: center; font-size: 13px; }
.footer-container p { margin: 0; }

.hidden { display: none; }
.text-center { text-align: center; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }

/* Responsive: user dashboard */
@media (max-width: 768px) {
    .user-dashboard { grid-template-columns: 1fr; }
    .rd-layout { grid-template-columns: 1fr; }
    .profile-header { flex-direction: column; text-align: center; }
    .profile-stats { justify-content: center; }
    .profile-actions { justify-content: center; }
    .admin-stats-grid { grid-template-columns: 1fr 1fr; }
    .admin-layout { flex-direction: column; }
    .admin-sidebar { width: 100%; height: auto; position: static; }
    .admin-main { padding: 16px; }
    .module-grid { grid-template-columns: 1fr 1fr; }
    .admin-bottom-grid { grid-template-columns: 1fr; }
}

/* Hero Banner */
.hp-hero {
    background: linear-gradient(135deg, #0a0e27 0%, #0d1b3e 25%, #142850 50%, #0d1b3e 75%, #0a0e27 100%);
    background-size: 400% 400%;
    animation: hpHeroGradient 12s ease infinite;
    padding: 100px 0 80px;
    text-align: center;
    color: #fff;
    position: relative;
    overflow: hidden;
    isolation: isolate;
}
@keyframes hpHeroGradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
.hp-hero-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(0,180,255,0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,180,255,0.04) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
    z-index: 1;
}
/* Waves */
.hp-hero-waves {
    position: absolute;
    bottom: -2px; left: 0; right: 0;
    z-index: 2;
    pointer-events: none;
}
.hp-hero-wave {
    position: absolute;
    bottom: 0; left: 0;
    width: 200%;
    height: 120px;
}
.hp-hero-wave-1 {
    fill: rgba(10,132,255,0.15);
    animation: hpWaveDrift 7s ease-in-out infinite;
}
.hp-hero-wave-2 {
    fill: rgba(10,132,255,0.10);
    animation: hpWaveDrift 9s ease-in-out infinite reverse;
}
.hp-hero-wave-3 {
    fill: rgba(10,132,255,0.06);
    animation: hpWaveDrift 11s ease-in-out infinite;
}
@keyframes hpWaveDrift {
    0% { transform: translateX(0) translateY(0); }
    50% { transform: translateX(-25%) translateY(8px); }
    100% { transform: translateX(0) translateY(0); }
}
/* Floating Particles */
.hp-hero-particle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: 1;
    opacity: 0;
    animation: hpFloatUp 8s ease-in-out infinite;
}
.hp-particle-1 { width:6px; height:6px; background:rgba(10,180,255,0.5); left:10%; animation-delay:0s; animation-duration:7s; }
.hp-particle-2 { width:3px; height:3px; background:rgba(100,200,255,0.4); left:25%; animation-delay:2s; animation-duration:9s; }
.hp-particle-3 { width:5px; height:5px; background:rgba(10,180,255,0.35); left:45%; animation-delay:4s; animation-duration:8s; }
.hp-particle-4 { width:4px; height:4px; background:rgba(80,160,255,0.45); left:65%; animation-delay:1s; animation-duration:10s; }
.hp-particle-5 { width:3px; height:3px; background:rgba(10,200,255,0.4); left:80%; animation-delay:3s; animation-duration:7.5s; }
.hp-particle-6 { width:5px; height:5px; background:rgba(60,180,255,0.3); left:92%; animation-delay:5s; animation-duration:9.5s; }
@keyframes hpFloatUp {
    0%   { opacity:0; transform:translateY(80px) scale(0.5); }
    20%  { opacity:1; }
    80%  { opacity:0.6; }
    100% { opacity:0; transform:translateY(-400px) scale(1.2); }
}
.hp-hero-content {
    position: relative;
    z-index: 3;
}
.hp-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 22px;
    border: 1px solid rgba(10,180,255,0.3);
    border-radius: 20px;
    font-size: 12px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(180,220,255,0.85);
    margin-bottom: 28px;
    backdrop-filter: blur(6px);
    background: rgba(10,132,255,0.06);
}
.hp-hero h1 {
    font-size: 2.6rem;
    font-weight: 300;
    margin-bottom: 14px;
    letter-spacing: 2px;
    line-height: 1.4;
}
.hp-hero-dot {
    color: #0ab4ff;
    margin: 0 10px;
}
.hp-hero-sub {
    font-size: 1rem;
    opacity: 0.6;
    max-width: 520px;
    margin: 0 auto 36px;
    font-weight: 300;
    line-height: 1.7;
}
.hp-hero-search {
    max-width: 540px;
    margin: 0 auto;
    display: flex;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(10,180,255,0.18);
    border-radius: 10px;
    overflow: hidden;
    backdrop-filter: blur(12px);
    transition: border-color 0.3s, box-shadow 0.3s;
}
.hp-hero-search:focus-within {
    border-color: rgba(10,180,255,0.45);
    box-shadow: 0 0 30px rgba(10,180,255,0.12);
}
.hp-hero-search-input {
    flex: 1;
    border: none;
    padding: 15px 22px;
    font-size: 14px;
    background: transparent;
    outline: none;
    color: #fff;
}
.hp-hero-search-input::placeholder {
    color: rgba(255,255,255,0.3);
}
.hp-hero-search-btn {
    padding: 15px 28px;
    background: linear-gradient(135deg, #0ab4ff, #0077e6);
    color: #fff;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 7px;
}
.hp-hero-search-btn:hover {
    background: linear-gradient(135deg, #1ec8ff, #0a84ff);
    box-shadow: 0 0 24px rgba(10,180,255,0.3);
}
.hp-hero-stats {
    margin-top: 44px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 48px;
}
.hp-hero-stat {
    text-align: center;
}
.hp-hero-stat-num {
    display: block;
    font-size: 32px;
    font-weight: 300;
    color: #0ab4ff;
    line-height: 1;
    letter-spacing: -1px;
}
.hp-hero-stat-label {
    display: block;
    font-size: 12px;
    color: rgba(180,220,255,0.5);
    margin-top: 7px;
    letter-spacing: 2px;
}
.hp-hero-stat-divider {
    width: 1px;
    height: 38px;
    background: rgba(10,180,255,0.15);
}

/* Container */
.hp-container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 28px;
}

/* Subjects */
.hp-subjects {
    padding: 56px 0;
    background: #f7f8fb;
}
.hp-subject-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}
.hp-subject-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 14px;
    padding: 46px 28px;
    border-radius: 14px;
    text-decoration: none;
    border: 1px solid transparent;
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    overflow: hidden;
}
/* 学科背景渐变色 */
.hp-subject-geo {
    background: linear-gradient(135deg, #e8f6f3 0%, #d4e9e4 30%, #cde5df 100%);
    color: #0d5552;
}
.hp-subject-his {
    background: linear-gradient(135deg, #fef3ed 0%, #fce4d4 30%, #f8d5b8 100%);
    color: #8b3e20;
}
.hp-subject-ast {
    background: linear-gradient(135deg, #f0edf8 0%, #e1daee 30%, #d2c8e4 100%);
    color: #3b2e6e;
}
.hp-subject-card:hover {
    border-color: rgba(0,0,0,0.08);
    box-shadow:
        0 12px 40px rgba(0,0,0,0.10),
        0 4px 12px rgba(0,0,0,0.04);
    transform: perspective(600px) translateY(-4px) rotateX(2deg);
}
.hp-subject-info { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.hp-subject-info h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: 1px;
    color: inherit;
}
.hp-subject-info p {
    font-size: 13px;
    color: inherit;
    opacity: 0.7;
}
.hp-subject-arrow {
    font-size: 20px;
    font-weight: 300;
    transition: all 0.3s;
    opacity: 0.5;
}
.hp-subject-card:hover .hp-subject-arrow {
    opacity: 0.9;
    transform: translateX(4px);
}

/* Section Header */
.hp-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    padding-bottom: 14px;
    border-bottom: 2px solid #eef1f5;
}
.hp-section-title {
    font-size: 18px;
    color: #1e293b;
    font-weight: 700;
    letter-spacing: 0.5px;
    position: relative;
}
.hp-section-title::after {
    content: '';
    position: absolute;
    bottom: -16px; left: 0;
    width: 32px; height: 3px;
    border-radius: 2px;
    background: linear-gradient(90deg, #0ab4ff, #0077e6);
}
.hp-more-link {
    color: #94a3b8;
    font-size: 13px;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}
.hp-more-link:hover {
    color: #0ab4ff;
}

/* Resources */
.hp-resources {
    padding: 52px 0 32px;
}
.hp-resource-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}
.hp-resource-card {
    display: block;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    border: 1px solid #e8ecf2;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.hp-resource-card:hover {
    border-color: #c8ced8;
    box-shadow: 0 6px 24px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}
.hp-res-cover {
    position: relative;
    height: 120px;
    overflow: hidden;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
}
.hp-res-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.hp-res-cover-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 4px;
}
.hp-res-cover-icon {
    font-size: 28px;
    opacity: 0.35;
}
.hp-res-cover-ext {
    font-size: 11px;
    color: #94a3b8;
    font-weight: 600;
    letter-spacing: 1px;
}
.hp-res-badges {
    position: absolute;
    top: 8px;
    left: 8px;
    right: 8px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}
.hp-res-badges-left {
    display: flex;
    gap: 5px;
}
.hp-res-badge {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
}
.hp-res-badge-subject {
    background: rgba(26,115,232,0.85);
    color: #fff;
}
.hp-res-badge-type {
    background: rgba(30,41,59,0.75);
    color: #fff;
}
.hp-res-badge-grade {
    background: rgba(255,255,255,0.85);
    color: #475569;
}
.hp-accent-geo .hp-res-badge-subject { background: rgba(13,85,82,0.85); }
.hp-accent-his .hp-res-badge-subject { background: rgba(139,62,32,0.85); }
.hp-accent-ast .hp-res-badge-subject { background: rgba(59,46,110,0.85); }
.hp-res-body {
    padding: 16px;
}
.hp-res-title {
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.5;
    margin-bottom: 6px;
    text-align: center;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.hp-res-stats {
    display: flex;
    gap: 12px;
    font-size: 11px;
    color: #94a3b8;
    justify-content: space-between;
}
.hp-res-stat {
    display: flex;
    align-items: center;
    gap: 2px;
}
.hp-res-rating {
    color: #f5a623;
}
.hp-res-author {
    font-size: 11px;
    color: #94a3b8;
}

/* Columns Layout */
.hp-columns {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 28px;
    padding-bottom: 52px;
}

/* Articles */
.hp-articles {
    background: #fff;
    border-radius: 10px;
    padding: 28px;
    border: 1px solid #eef1f5;
}
.hp-article-list {
    list-style: none;
}
.hp-article-list li {
    padding: 15px 0;
    border-bottom: 1px solid #f5f6f9;
}
.hp-article-list li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}
.hp-article-list a {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    text-decoration: none;
    color: #334155;
    font-size: 14px;
    transition: color 0.2s;
}
.hp-article-list a:hover {
    color: #0ab4ff;
}
.hp-article-title {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-right: 14px;
}
.hp-article-meta {
    font-size: 12px;
    color: #94a3b8;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Ranking */
.hp-ranking {
    background: #fff;
    border-radius: 10px;
    padding: 28px;
    border: 1px solid #eef1f5;
}
.hp-rank-list {
    list-style: none;
    counter-reset: rank;
}
.hp-rank-item {
    display: flex;
    align-items: center;
    padding: 13px 0;
    gap: 14px;
    border-bottom: 1px solid #f5f6f9;
}
.hp-rank-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}
.hp-rank-num {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 800;
    color: #94a3b8;
    flex-shrink: 0;
}
.hp-rank-num.gold { background: linear-gradient(135deg, #f5d059, #c9a84c); color: #fff; }
.hp-rank-num.silver { background: linear-gradient(135deg, #bcc9d4, #94a3b8); color: #fff; }
.hp-rank-num.bronze { background: linear-gradient(135deg, #d9906a, #b85c38); color: #fff; }
.hp-rank-name {
    flex: 1;
    font-size: 14px;
    color: #334155;
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}
.hp-rank-name:hover {
    color: #0ab4ff;
}
.hp-rank-points {
    font-size: 13px;
    color: #64748b;
    font-weight: 600;
    flex-shrink: 0;
}

/* Announcements */
.hp-announce-head { display:flex; justify-content:space-between; align-items:center; }
.hp-announce-more { color:#3f6f9f; font-size:13px; text-decoration:none; }
.hp-announce-more:hover { text-decoration:underline; }
.hp-announcements {
    padding-bottom: 60px;
}
.hp-announce-list {
    display: grid;
    gap: 12px;
}
.hp-announce-item {
    background: #fff;
    border: 1px solid #eef1f5;
    border-radius: 10px;
    padding: 20px 24px;
    display: flex;
    align-items: flex-start;
    gap: 18px;
    transition: box-shadow 0.2s;
}
.hp-announce-item:hover {
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}
.hp-ann-date {
    flex-shrink: 0;
    background: linear-gradient(135deg, #f0f4ff, #e8f0fe);
    color: #0a84ff;
    padding: 4px 12px;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 700;
    margin-top: 2px;
}
.hp-ann-content strong {
    display: block;
    font-size: 14px;
    color: #1e293b;
    margin-bottom: 5px;
    font-weight: 600;
}
.hp-ann-content p {
    font-size: 12px;
    color: #94a3b8;
    line-height: 1.6;
}

/* Responsive */
@media (max-width: 1024px) {
    .hp-resource-grid { grid-template-columns: repeat(2, 1fr); }
    .hp-columns { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .hp-resource-grid { grid-template-columns: 1fr; }
    .hp-subject-grid { grid-template-columns: 1fr; }
    .hp-hero h1 { font-size: 1.6rem; }
    .hp-hero { padding: 72px 0 60px; }
    .hp-hero-stats { flex-wrap: wrap; gap: 28px; }
    .hp-announce-item { flex-wrap: wrap; }
    .hp-section-title { font-size: 16px; }
}

/* ==================== Friend Pages ==================== */
.friend-container {
    max-width: 860px;
    margin: 0 auto;
    padding: 32px 20px 60px;
}
.friend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid #e8ecf1;
}
.friend-header h2 {
    font-size: 22px;
    font-weight: 700;
    color: #1e3a5f;
    margin: 0;
}
.friend-count {
    font-size: 14px;
    color: #64748b;
    background: #f1f5f9;
    padding: 4px 14px;
    border-radius: 100px;
}
.friend-back-link {
    font-size: 14px;
    color: #1a73e8;
    text-decoration: none;
}
.friend-back-link:hover {
    text-decoration: underline;
}

/* Search */
.friend-search {
    margin-bottom: 28px;
}
.friend-search-form {
    display: flex;
    gap: 10px;
}
.friend-search-input {
    flex: 1;
    padding: 10px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}
.friend-search-input:focus {
    border-color: #1a73e8;
}
.friend-search-btn {
    padding: 10px 24px;
    background: #1e3a5f;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.friend-search-btn:hover {
    background: #2c5282;
}

/* Sections */
.friend-section {
    margin-bottom: 32px;
}
.friend-section-title {
    font-size: 16px;
    font-weight: 700;
    color: #334155;
    margin-bottom: 16px;
    padding-left: 12px;
    border-left: 3px solid #c9a84c;
}

/* Friend List */
.friend-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.friend-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: #fff;
    border: 1px solid #edf2f7;
    border-radius: 10px;
    transition: box-shadow 0.2s;
}
.friend-card:hover {
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.friend-card-avatar {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
}
.friend-card-avatar img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}
.friend-avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1e3a5f, #3b5998);
    color: #fff;
    font-size: 20px;
    font-weight: 700;
}
.friend-card-info {
    flex: 1;
    min-width: 0;
}
.friend-card-name {
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.friend-card-name a {
    color: #1e293b;
    text-decoration: none;
}
.friend-card-name a:hover {
    color: #1a73e8;
}
.friend-role-tag {
    display: inline-block;
    font-size: 11px;
    font-weight: 500;
    padding: 1px 8px;
    border-radius: 4px;
    background: #eff6ff;
    color: #1a73e8;
    white-space: nowrap;
}
.friend-card-meta {
    font-size: 12px;
    color: #94a3b8;
}
.friend-card-actions {
    flex-shrink: 0;
    display: flex;
    gap: 8px;
}

/* Friend Buttons */
.friend-btn {
    padding: 6px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.friend-btn-add {
    background: #1e3a5f;
    color: #fff;
}
.friend-btn-add:hover {
    background: #2c5282;
}
.friend-btn-profile {
    background: #f1f5f9;
    color: #475569;
    text-decoration: none;
}
.friend-btn-profile:hover {
    background: #e2e8f0;
}
.friend-btn-remove {
    background: #fff;
    color: #dc2626;
    border: 1px solid #fecaca;
}
.friend-btn-remove:hover {
    background: #fef2f2;
}
.friend-btn-accept {
    background: #1e3a5f;
    color: #fff;
}
.friend-btn-accept:hover {
    background: #2c5282;
}
.friend-btn-reject {
    background: #fff;
    color: #64748b;
    border: 1px solid #e2e8f0;
}
.friend-btn-reject:hover {
    background: #f8fafc;
}
.friend-badge-added {
    font-size: 13px;
    font-weight: 500;
    color: #16a34a;
    padding: 6px 12px;
    background: #f0fdf4;
    border-radius: 6px;
}
.friend-badge-pending {
    font-size: 13px;
    font-weight: 500;
    color: #f59e0b;
    padding: 6px 12px;
    background: #fffbeb;
    border-radius: 6px;
}
.friend-links {
    text-align: center;
    margin-top: 16px;
}
.friend-link-requests {
    display: inline-block;
    padding: 9px 28px;
    background: linear-gradient(135deg, #1e3a5f, #2c5282);
    color: #fff;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: opacity 0.2s;
}
.friend-link-requests:hover {
    opacity: 0.9;
}

/* Empty State */
.friend-empty {
    text-align: center;
    padding: 48px 20px;
    background: #fff;
    border: 1px dashed #e2e8f0;
    border-radius: 10px;
}
.friend-empty-icon {
    font-size: 36px;
    color: #cbd5e1;
    margin-bottom: 12px;
    letter-spacing: 4px;
}
.friend-empty p {
    font-size: 15px;
    color: #64748b;
    margin: 0 0 6px;
}
.friend-empty-sub {
    font-size: 13px !important;
    color: #94a3b8 !important;
}

/* ==================== Feed Pages ==================== */
.feed-container {
    max-width: 720px;
    margin: 0 auto;
    padding: 32px 20px 60px;
}
.feed-header {
    margin-bottom: 28px;
    padding-bottom: 16px;
    border-bottom: 2px solid #e8ecf1;
}
.feed-header h2 {
    font-size: 22px;
    font-weight: 700;
    color: #1e3a5f;
    margin: 0;
}
.feed-header-note { margin: 8px 0 0; color: #64748b; font-size: 13px; }
.feed-compose { margin-bottom: 18px; padding: 18px; border: 1px solid #dbe5f0; border-radius: 12px; background: #fff; }
.feed-compose label { display: block; margin-bottom: 8px; color: #1e3a5f; font-weight: 700; }
.feed-compose textarea { width: 100%; min-height: 88px; resize: vertical; border: 1px solid #cbd5e1; border-radius: 8px; padding: 11px 12px; color: #1e293b; background: #fff; font: inherit; }
.feed-compose-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 10px; color: #64748b; font-size: 12px; }
.feed-status-text { color: #26364a; white-space: normal; overflow-wrap: anywhere; }
.feed-status-delete { margin-top: 8px; text-align: right; }
.cmt-delete-form { display: inline; margin-left: 8px; }
.cmt-delete-btn { border: 0; background: transparent; color: #b42318; cursor: pointer; font: inherit; font-size: 12px; }
.cmt-delete-btn:hover { text-decoration: underline; }

/* Feed Card */
.feed-card {
    display: flex;
    gap: 16px;
    padding: 18px 20px;
    background: #fff;
    border: 1px solid #edf2f7;
    border-radius: 10px;
    transition: box-shadow 0.2s;
}
.feed-card:hover {
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.feed-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.feed-card-left {
    flex-shrink: 0;
}
.feed-avatar {
    width: 44px;
    height: 44px;
}
.feed-avatar img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
}
.feed-avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1e3a5f, #3b5998);
    color: #fff;
    font-size: 18px;
    font-weight: 700;
}
.feed-card-body {
    flex: 1;
    min-width: 0;
}
.feed-card-top {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}
.feed-user-name {
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
    text-decoration: none;
}
.feed-user-name:hover {
    color: #1a73e8;
}
.feed-role-tag {
    font-size: 11px;
    font-weight: 500;
    padding: 1px 8px;
    border-radius: 4px;
    background: #eff6ff;
    color: #1a73e8;
}
.feed-type-tag {
    font-size: 11px;
    font-weight: 600;
    padding: 1px 8px;
    border-radius: 4px;
    white-space: nowrap;
}
.feed-time {
    font-size: 12px;
    color: #94a3b8;
    margin-left: auto;
}
.feed-card-content {
    font-size: 14px;
    color: #475569;
    line-height: 1.6;
}
.feed-link {
    color: #1a73e8;
    text-decoration: none;
    font-weight: 500;
}
.feed-link:hover {
    text-decoration: underline;
}

/* Feed Pagination */
.feed-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 28px;
}
.feed-page-btn {
    padding: 8px 20px;
    background: #1e3a5f;
    color: #fff;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s;
}
.feed-page-btn:hover {
    background: #2c5282;
}
.feed-page-info {
    font-size: 13px;
    color: #64748b;
}

/* Feed Empty */
.feed-empty {
    text-align: center;
    padding: 60px 20px;
    background: #fff;
    border: 1px dashed #e2e8f0;
    border-radius: 10px;
}
.feed-empty-icon {
    font-size: 40px;
    color: #cbd5e1;
    margin-bottom: 16px;
    letter-spacing: 4px;
}
.feed-empty p {
    font-size: 15px;
    color: #64748b;
    margin: 0 0 6px;
}
.feed-empty-sub {
    font-size: 13px !important;
    color: #94a3b8 !important;
    margin-bottom: 20px !important;
}
.feed-empty-btn {
    display: inline-block;
    padding: 9px 28px;
    background: linear-gradient(135deg, #1e3a5f, #2c5282);
    color: #fff;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}
.feed-empty-btn:hover {
    opacity: 0.9;
}

/* Friend requests responsive */
@media (max-width: 768px) {
    .friend-card {
        flex-wrap: wrap;
        gap: 10px;
    }
    .friend-card-actions {
        width: 100%;
        justify-content: flex-end;
        margin-top: 4px;
    }
    .friend-search-form {
        flex-direction: column;
    }
    .feed-card-top {
        gap: 4px;
    }
    .feed-time {
        margin-left: 0;
        width: 100%;
    }
}

/* ==================== My List Pages (我的资源/我的文章) ==================== */
.my-list-table { margin-bottom: 0; }
.my-list-table th { white-space: nowrap; }
.my-list-table td { vertical-align: middle; }
.my-list-table .tac { text-align: center; }

.my-list-title-link {
    color: #1e3a5f;
    font-weight: 600;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}
.my-list-title-link:hover {
    color: #1a73e8;
    text-decoration: underline;
}

.my-list-actions {
    white-space: nowrap;
    display: flex;
    gap: 6px;
}

.my-list-btn {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}
.my-list-btn-edit {
    background: #eff6ff;
    color: #1a73e8;
    border: 1px solid #dbeafe;
}
.my-list-btn-edit:hover {
    background: #1a73e8;
    color: #fff;
}
.my-list-btn-delete {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}
.my-list-btn-delete:hover {
    background: #dc2626;
    color: #fff;
}

/* Share button */
.my-list-btn-share {
    background: #ecfdf5;
    color: #059669;
    border: 1px solid #d1fae5;
    cursor: pointer;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 4px;
    transition: all 0.2s;
}
.my-list-btn-share:hover {
    background: #059669;
    color: #fff;
}

.my-list-btn-reupload {
    background: #fefce8;
    color: #ca8a04;
    border: 1px solid #fef08a;
}
.my-list-btn-reupload:hover {
    background: #ca8a04;
    color: #fff;
}

/* Visibility toggle switch */
.my-list-toggle {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
}
.my-list-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}
.my-list-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #cbd5e1;
    transition: .3s;
    border-radius: 22px;
}
.my-list-toggle-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}
.my-list-toggle input:checked + .my-list-toggle-slider {
    background-color: #1e3a5f;
}
.my-list-toggle input:checked + .my-list-toggle-slider:before {
    transform: translateX(18px);
}

/* Share Modal */
.share-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}
.share-modal {
    background: #fff;
    border-radius: 6px;
    padding: 24px;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 4px 24px rgba(0,0,0,.12);
}
.share-modal-title {
    margin: 0 0 16px;
    font-size: 16px;
    color: #1e3a5f;
}
.share-modal-body {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 16px;
}
.share-modal-actions {
    text-align: right;
}
.share-modal-cancel {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
    padding: 6px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.share-modal-cancel:hover {
    background: #e2e8f0;
}

.share-friend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 4px;
    border-bottom: 1px solid #f1f5f9;
    cursor: default;
}
.share-friend-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1e3a5f, #c9a84c);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: bold;
    flex-shrink: 0;
}
.share-friend-name {
    flex: 1;
    font-size: 14px;
    color: #334155;
}
.share-friend-btn {
    background: #eff6ff;
    color: #1a73e8;
    border: 1px solid #dbeafe;
    padding: 3px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}
.share-friend-btn:hover {
    background: #1a73e8;
    color: #fff;
}

/* Pagination */
.my-list-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #edf2f7;
}
.my-list-page-btn {
    padding: 8px 20px;
    background: #1e3a5f;
    color: #fff;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s;
}
.my-list-page-btn:hover {
    background: #2c5282;
}
.my-list-page-info {
    font-size: 13px;
    color: #64748b;
}

/* Empty State */
.my-list-empty {
    text-align: center;
    padding: 60px 20px;
    background: #fff;
    border: 1px dashed #e2e8f0;
    border-radius: 10px;
}
.my-list-empty p {
    font-size: 15px;
    color: #64748b;
    margin: 0 0 16px;
}
.my-list-empty-btn {
    display: inline-block;
    padding: 9px 28px;
    background: linear-gradient(135deg, #1e3a5f, #2c5282);
    color: #fff;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: opacity 0.2s;
}
.my-list-empty-btn:hover {
    opacity: 0.9;
}

.badge-file {
    background: #f0f4f8;
    color: #475569;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 3px;
}

/* Edit form additions */
.current-file {
    padding: 8px 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: 13px;
    color: #475569;
    margin: 0;
}
.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}
.btn-cancel {
    display: inline-flex;
    align-items: center;
    padding: 12px 28px;
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s;
}
.btn-cancel:hover {
    background: #e2e8f0;
}

/* My list responsive */
@media (max-width: 768px) {
    .my-list-table { font-size: 12px; }
    .my-list-table th, .my-list-table td { padding: 8px 6px; }
    .my-list-table th:nth-child(4),
    .my-list-table td:nth-child(4),
    .my-list-table th:nth-child(5),
    .my-list-table td:nth-child(5) { display: none; }
    .my-list-actions { flex-direction: column; gap: 4px; }
    .my-list-btn { text-align: center; }
}

/* ============================================================
   Utility: Buttons, Text, Badges
   ============================================================ */
.text-muted { color: #94a3b8; }
.text-green { color: #16a34a; }
.text-orange { color: #d97706; }
.text-red { color: #dc2626; }

.btn-success { background: #16a34a; color: #fff; border: 1px solid #16a34a; border-radius: 4px; padding: 8px 16px; font-size: 13px; cursor: pointer; text-decoration: none; display: inline-block; transition: background 0.2s; }
.btn-success:hover { background: #15803d; }
.btn-warning { background: #f59e0b; color: #fff; border: 1px solid #f59e0b; border-radius: 4px; padding: 8px 16px; font-size: 13px; cursor: pointer; text-decoration: none; display: inline-block; transition: background 0.2s; }
.btn-warning:hover { background: #d97706; }
.btn-download { display: inline-block; background: #fff; color: #1a73e8; border: 1px solid #1a73e8; border-radius: 4px; padding: 8px 16px; font-size: 13px; text-decoration: none; transition: all 0.2s; }
.btn-download:hover { background: #eff6ff; }
.btn-group { display: flex; gap: 8px; align-items: center; }

.badge-approved { background: #f0fdf4; color: #16a34a; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 3px; }
.badge-pending { background: #fef3e3; color: #d97706; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 3px; }

/* ============================================================
   Home Page
   ============================================================ */
.home-page { padding: 0; }
.site-main { min-height: 60vh; padding: 20px 0; }
.hp-card { background: #fff; border-radius: 8px; border: 1px solid #e5e7eb; padding: 24px; margin-bottom: 16px; }

/* Search suggestions */
.suggestions-dropdown { position: absolute; top: 100%; left: 0; right: 0; background: #fff; border: 1px solid #e5e7eb; border-radius: 6px; box-shadow: 0 4px 16px rgba(0,0,0,0.08); z-index: 200; max-height: 240px; overflow-y: auto; }
.suggestion-item { padding: 10px 16px; font-size: 13px; color: #334155; cursor: pointer; transition: background 0.15s; }
.suggestion-item:hover { background: #f1f5f9; }

/* ============================================================
   Search Results (home/search)
   ============================================================ */
.resource-card-header { display: flex; gap: 6px; margin-bottom: 8px; }
.resource-subject { font-size: 11px; background: #eff6ff; color: #2563eb; padding: 2px 8px; border-radius: 3px; }
.resource-type { font-size: 11px; background: #f0fdf4; color: #16a34a; padding: 2px 8px; border-radius: 3px; }
.resource-desc { font-size: 13px; color: #64748b; margin-top: 8px; line-height: 1.5; }

/* ============================================================
   Messages Page (user/messages)
   ============================================================ */
.user-messages-page { display: grid; grid-template-columns: 200px 1fr; gap: 24px; padding: 24px 0; }
.msg-tabs { display: flex; gap: 4px; margin-bottom: 16px; padding: 4px; background: #f1f5f9; border-radius: 6px; }
.msg-tabs a { padding: 6px 16px; border-radius: 4px; font-size: 13px; color: #64748b; text-decoration: none; transition: all 0.15s; }
.msg-tabs a:hover { color: #334155; }
.msg-tabs a.active { background: #fff; color: #1a73e8; font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.msg-list { display: flex; flex-direction: column; gap: 8px; }
.msg-item { background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; padding: 16px; transition: box-shadow 0.2s; }
.msg-item:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.04); }
.msg-item.unread { border-left: 3px solid #1a73e8; background: #f0f7ff; }
.msg-item.unread .msg-header strong { font-weight: 700; }
.msg-item.unread p { font-weight: 500; color: #1e293b; }
.msg-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.msg-header strong { font-size: 14px; color: #1e293b; }
.msg-time { font-size: 12px; color: #94a3b8; }
.msg-item p { font-size: 13px; color: #475569; line-height: 1.6; margin: 0 0 8px 0; }
.msg-actions { display: flex; gap: 12px; margin-top: 8px; }
.msg-actions a { font-size: 12px; color: #1a73e8; text-decoration: none; }
.msg-actions a:hover { text-decoration: underline; }
.msg-reply-form { margin-top: 12px; padding-top: 12px; border-top: 1px solid #f1f5f9; }
.msg-reply-form textarea { width: 100%; padding: 10px; border: 1px solid #e2e8f0; border-radius: 6px; font-size: 13px; resize: vertical; font-family: inherit; }
.reply-actions { display: flex; gap: 8px; margin-top: 8px; }

/* ============================================================
   User Settings & Dashboard Extras
   ============================================================ */
.settings-tabs { display: flex; gap: 4px; margin-bottom: 24px; padding: 4px; background: #f1f5f9; border-radius: 6px; }
.settings-tabs a { padding: 8px 20px; border-radius: 4px; font-size: 13px; color: #64748b; text-decoration: none; transition: all 0.15s; }
.settings-tabs a:hover { color: #334155; }
.settings-tabs a.active { background: #fff; color: #1a73e8; font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.section-hint { font-size: 13px; color: #94a3b8; margin-bottom: 12px; }

.pending-section { margin-top: 24px; }
.pending-section h3 { font-size: 16px; color: #1e293b; margin-bottom: 6px; }
.pending-table { margin-top: 8px; }

/* ============================================================
   Friend Requests
   ============================================================ */
.request-card { border-left: 3px solid #f59e0b; }
.request-sent-card { border-left: 3px solid #94a3b8; }
.request-actions { display: flex; gap: 8px; }

/* ============================================================
   Admin: Charts, Forms, Controls
   ============================================================ */
.chart-section { margin-top: 24px; background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; padding: 20px; }
.chart-section h3 { font-size: 16px; color: #1e293b; margin-bottom: 16px; }
.chart-container { position: relative; min-height: 300px; }

.form-inline { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.form-inline select,
.form-inline input { padding: 8px 12px; border: 1px solid #e2e8f0; border-radius: 4px; font-size: 13px; }
.form-inline .btn { flex-shrink: 0; }

.visibility-switch { appearance: none; -webkit-appearance: none; width: 36px; height: 20px; border-radius: 10px; background: #cbd5e1; position: relative; cursor: pointer; transition: background 0.2s; vertical-align: middle; }
.visibility-switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform 0.2s; }
.visibility-switch:checked { background: #16a34a; }
.visibility-switch:checked::after { transform: translateX(16px); }

/* Share friend modal */
.share-friend-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid #f1f5f9; }
.share-friend-avatar { width: 32px; height: 32px; border-radius: 50%; background: #eff6ff; color: #1a73e8; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; flex-shrink: 0; }
.share-friend-name { flex: 1; font-size: 13px; color: #334155; }
.share-friend-status { flex-shrink: 0; }
.share-friend-btn { padding: 4px 12px; border-radius: 4px; border: 1px solid #1a73e8; background: #fff; color: #1a73e8; font-size: 12px; cursor: pointer; transition: all 0.2s; }
.share-friend-btn:hover { background: #1a73e8; color: #fff; }

/* T24.5 评论与消息中心补充样式 */
.msg-channel-tabs { display:flex; gap:6px; margin-bottom:14px; border-bottom:1px solid #dbe4ef; }
.msg-channel-tabs .tab { display:inline-block; padding:10px 18px; color:#64748b; text-decoration:none; border-bottom:2px solid transparent; }
.msg-channel-tabs .tab.active, .msg-channel-tabs .tab:hover { color:#1a73e8; border-bottom-color:#1a73e8; }
.msg-toolbar { display:flex; align-items:center; gap:14px; margin-bottom:16px; color:#64748b; }
.msg-toolbar a:not(.btn) { color:#64748b; text-decoration:none; }
.msg-toolbar a.active, .msg-toolbar a:not(.btn):hover { color:#1a73e8; font-weight:600; }
.comment-list { display:grid; gap:12px; }
.comment-card { padding:16px 18px; border:1px solid #e2e8f0; border-radius:10px; background:#fff; }
.comment-card-meta { display:flex; align-items:center; gap:10px; color:#64748b; font-size:13px; }
.comment-card-meta time { margin-left:auto; color:#94a3b8; }
.comment-source { padding:2px 7px; border-radius:999px; background:#e8f1ff; color:#2563eb; }
.comment-card p { margin:12px 0 8px; color:#1e293b; line-height:1.7; }
.comment-card-author { color:#64748b; font-size:13px; }
.form-help { display:block; margin-top:6px; color:#64748b; }
.friend-btn-message { border-color:#1a73e8; color:#1a73e8; }
.friend-btn-message:hover { background:#1a73e8; color:#fff; }

/* T25.5 批量资源操作与个人积分排行 */
.batch-result{margin:0 0 18px;padding:16px 18px;border:1px solid #28486c;border-radius:10px;background:#13243b;color:#dbeafe}.batch-result h3{margin:0 0 8px}.batch-result ul{margin:8px 0 0;padding-left:20px}.batch-success{color:#86efac}.batch-failed{color:#fca5a5}.batch-toolbar{display:flex;align-items:center;gap:10px;margin:0 0 14px}.batch-toolbar .active{background:#334155;color:#fff}.resource-card-wrap{position:relative}.resource-batch-check{position:absolute;z-index:3;top:10px;left:10px;padding:5px 8px;border-radius:6px;background:rgba(15,23,42,.9);color:#fff;font-size:12px;cursor:pointer}.resource-batch-check input{margin-right:4px}.profile-ranking-list{display:grid;gap:10px}.profile-ranking-item{display:flex;align-items:center;gap:10px;padding:10px 12px;border:1px solid #29415f;border-radius:8px;background:#13243b}.profile-ranking-item img{border-radius:50%;object-fit:cover}.profile-ranking-no{width:24px;text-align:center;font-weight:700;color:#fbbf24}.profile-ranking-item a{flex:1;color:#e2e8f0;text-decoration:none}.profile-ranking-item strong{color:#67e8f9}

/* 应用中心 */
.app-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:18px;margin-top:20px}.app-card{background:#fff;border:1px solid #e5e7eb;border-radius:10px;padding:20px;text-align:center;box-shadow:0 2px 8px rgba(0,0,0,.04)}.app-card.is-disabled{opacity:.55}.app-icon{font-size:42px;line-height:1.2;margin-bottom:10px}.app-card h3{margin:8px 0}.app-card p{min-height:40px;color:#6b7280}.app-form{display:grid;gap:10px;padding:18px;margin-bottom:20px}.app-form label{display:flex;gap:10px;align-items:center}.app-form input,.app-form select{flex:1;padding:7px;border:1px solid #d1d5db;border-radius:4px}

/* CHG-011: consistent, legible cover previews and compact content thumbnails. */
.cover-upload-field{display:grid;gap:8px;max-width:560px}
.cover-upload-field small{color:#aebbd0;font-size:13px;line-height:1.6}
.cover-upload-field img{width:min(100%,360px);max-height:220px;object-fit:cover;border:1px solid #49627e;border-radius:10px}
.article-cover-link{flex:0 0 168px;align-self:stretch;overflow:hidden;border-radius:10px}
.article-cover-thumb{width:100%;height:100%;min-height:112px;max-height:150px;object-fit:cover;display:block}
.content-detail-cover{display:block;width:min(100%,920px);max-height:460px;object-fit:cover;margin:24px auto;border-radius:14px;border:1px solid var(--line-strong)}
.hp-article-link{display:grid;grid-template-columns:76px 1fr;gap:12px;align-items:center}
.hp-article-thumb{width:76px;height:54px;object-fit:cover;border-radius:7px}
.hp-news-thumb{width:112px;height:74px;object-fit:cover;border-radius:8px;flex:0 0 auto}
.admin-content-cover{width:76px;height:50px;object-fit:cover;border-radius:6px;border:1px solid #d5e0ec}
.content-review-cover-current{display:block;width:min(100%,360px);max-height:200px;object-fit:cover;border-radius:9px;margin:8px 0}
.admin-layout .cover-upload-field small,.admin-layout .content-review-editor .admin-page-hint{color:#52657a}
.admin-layout .muted,.admin-layout .text-muted,.admin-layout small{color:#52657a}
@media(max-width:640px){.article-cover-link{flex-basis:100%;height:160px}.article-item-redesign{flex-wrap:wrap}.hp-article-link{grid-template-columns:60px 1fr}.hp-article-thumb{width:60px;height:48px}.hp-news-thumb{width:84px;height:64px}}
/* T30 外链播放器与选集 */
/* Hardware type-specific control panels */
.hardware-console{max-width:1320px}.hardware-queue-note{padding:8px 12px;border-radius:999px;background:#eaf4ff;color:#2364a8;font-size:13px}.hardware-control-card{margin:0 0 22px;border:1px solid #cfe0f2;border-radius:16px;background:linear-gradient(135deg,#f8fbff,#eef6ff);box-shadow:0 12px 28px rgba(29,76,125,.08);overflow:hidden}.hardware-control-card.is-coming{filter:saturate(.55)}.hardware-control-head{display:flex;justify-content:space-between;gap:20px;padding:22px 26px;border-bottom:1px solid #dbe9f5;background:#fff}.hardware-control-head h2{margin:4px 0 6px;color:#102d4f}.hardware-control-head p{margin:0;color:#6c829a;font-size:13px}.hardware-type-kicker{color:#2776c9;font-size:12px;font-weight:700;letter-spacing:.08em}.hardware-device-state{display:flex;align-items:center;gap:8px;color:#375a7e;font-weight:700;white-space:nowrap}.hardware-device-state small{display:block;color:#91a6bc;font-weight:400}.hardware-adapter-notice{margin:16px 24px 0;padding:10px 14px;border:1px dashed #d7a23b;border-radius:9px;background:#fff8e6;color:#8a5a00;font-size:13px}.hardware-command-groups{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:16px;padding:20px 24px 24px}.hardware-command-group{padding:16px;border-radius:12px;background:rgba(255,255,255,.78);border:1px solid #dceaf6}.hardware-command-group h3{margin:0 0 12px;color:#305a82;font-size:15px}.hardware-command-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(112px,1fr));gap:9px}.hardware-command-form{display:flex;flex-direction:column;gap:5px}.hardware-command-button{min-height:52px;border:1px solid #a6c8e8;border-radius:10px;background:#fff;color:#185a96;cursor:pointer;transition:transform .15s,box-shadow .15s,background .15s}.hardware-command-button:hover{background:#eef7ff;box-shadow:0 4px 10px rgba(28,103,168,.16);transform:translateY(-1px)}.hardware-command-button:disabled{cursor:not-allowed;opacity:.48;transform:none;box-shadow:none}.hardware-command-button span,.hardware-command-button small{display:block}.hardware-command-button span{font-weight:700}.hardware-command-button small{margin-top:3px;color:#8ca4bb;font-size:10px}.hardware-command-value{width:100%;box-sizing:border-box;border:1px solid #b9cee2;border-radius:7px;padding:7px 8px;color:#264b70;background:#fff}.hardware-empty{padding:30px;text-align:center}.hardware-receipts{overflow:auto}.hardware-receipts h2{padding:0 20px}
.external-video-panel{margin:22px 0;padding:14px;border:1px solid #d8e2f0;border-radius:14px;background:#f7faff}.external-player-shell{width:100%;aspect-ratio:16/9;display:flex;align-items:center;justify-content:center;border-radius:12px;background:#15233a;color:#fff;overflow:hidden}.external-play-button{padding:12px 22px;border:0;border-radius:999px;background:#2674d9;color:#fff;font-size:16px;cursor:pointer}.episode-selector{display:flex;gap:8px;flex-wrap:wrap;margin-top:12px}.episode-select{padding:6px 12px;border:1px solid #b8cae2;border-radius:999px;background:#fff;cursor:pointer}.episode-select.active{background:#2674d9;border-color:#2674d9;color:#fff}.external-original-link{display:inline-block;margin-top:10px;font-size:13px;color:#51708f}.episode-url-row{display:flex;gap:8px;align-items:center;margin-top:8px;flex-wrap:wrap}.episode-url-row input{flex:1;min-width:220px}.external-url-hint{display:block;color:#58708d;margin-top:5px}@media(max-width:600px){.external-video-panel{margin-left:-4px;margin-right:-4px}.episode-selector{gap:6px}.episode-select{font-size:13px}.episode-url-row input{min-width:100%}}
