/* ============================================
   漫评小屋 - 共用样式表
   纯静态多页HTML，无任何构建工具
   ============================================ */

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

html { overflow-y: scroll; }

:root {
  --primary: #667eea;
  --primary-dark: #5a6fd6;
  --secondary: #764ba2;
  --bg: #f5f6fa;
  --card-bg: #ffffff;
  --text: #2d3436;
  --text-light: #636e72;
  --border: #e0e0e0;
  --danger: #e74c3c;
  --success: #27ae60;
  --warning: #f39c12;
  --radius: 10px;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
}

body {
  font-family: 'Microsoft YaHei', 'PingFang SC', 'Helvetica Neue', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

/* ====== 导航栏 ====== */
header {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 16px rgba(0,0,0,0.15);
}
.header-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center; gap: 8px;
  padding: 0 20px;
}
.logo {
  font-size: 22px; font-weight: bold; color: #fff;
  text-decoration: none; padding: 14px 0;
  display: flex; align-items: center; gap: 8px;
  flex-shrink: 0;
}
.logo i { font-size: 26px; font-style: normal; }
nav { display: flex; gap: 4px; margin-left: 300px; margin-right: 120px; }
nav a {
  color: rgba(255,255,255,0.85); text-decoration: none;
  padding: 14px 18px; font-size: 15px; transition: all 0.25s;
  border-radius: 6px; white-space: nowrap;
}
nav a:hover, nav a.active {
  color: #fff; background: rgba(255,255,255,0.18);
}
nav a.active { font-weight: bold; }
.nav-right-link {
  color: rgba(255,255,255,0.75); text-decoration: none;
  padding: 14px 18px; font-size: 15px; transition: all 0.25s; border-radius: 6px;
  flex-shrink: 0; margin-left: 40px; white-space: nowrap;
}
.nav-right-link:hover { color: #fff; background: rgba(255,255,255,0.18); }

/* ====== 主容器 ====== */
main { flex: 1; min-height: 60vh; }
.container { max-width: 1200px; margin: 0 auto; padding: 30px 20px; }

/* ====== 页脚 ====== */
footer {
  background: #2d2d3f; color: rgba(255,255,255,0.55);
  text-align: center; padding: 20px; font-size: 13px;
  margin-top: auto;
}

/* ====== 页面标题 ====== */
.page-title { text-align: center; margin-bottom: 36px; }
.page-title h1 { font-size: 30px; color: var(--text); margin-bottom: 8px; }
.page-title p { font-size: 15px; color: var(--text-light); }
.page-title::after {
  content: ''; display: block; width: 50px; height: 3px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  margin: 14px auto 0; border-radius: 2px;
}

/* ====== 卡片 ====== */
.card {
  background: var(--card-bg); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}

/* ====== 按钮 ====== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 22px; border: none; border-radius: 8px;
  font-size: 14px; font-family: inherit; cursor: pointer;
  text-decoration: none; transition: all 0.2s;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #c0392b; }
.btn-outline {
  background: transparent; color: var(--primary);
  border: 1px solid var(--primary);
}
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ====== 表单 ====== */
.form-group { margin-bottom: 18px; }
.form-group label {
  display: block; font-size: 14px; color: #555;
  margin-bottom: 6px; font-weight: 500;
}
.form-group label .required { color: var(--danger); }
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 11px 14px; border: 1px solid var(--border);
  border-radius: 8px; font-size: 14px; font-family: inherit;
  outline: none; transition: border-color 0.2s; background: #fff;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--primary);
}
.form-textarea { resize: vertical; min-height: 100px; }
.form-error {
  color: var(--danger); font-size: 12px; margin-top: 4px; display: none;
}
.form-input.error, .form-textarea.error { border-color: var(--danger); }

/* ====== 表格 ====== */
.table-wrapper { overflow-x: auto; }
table {
  width: 100%; border-collapse: collapse;
  font-size: 14px;
}
table th, table td {
  padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border);
}
table th {
  background: #f8f9fa; font-weight: 600; color: #555;
  cursor: pointer; white-space: nowrap;
  user-select: none;
}
table th:hover { background: #eef0f5; }
table th .sort-icon { font-size: 11px; margin-left: 4px; opacity: 0.4; }
table th .sort-icon.active { opacity: 1; }
table tr:hover { background: #fafbfc; }
table tr.deleted { opacity: 0.5; background: #fef5f5; }

/* ====== 评分星级 ====== */
.stars { display: inline-flex; gap: 2px; }
.stars .star { font-size: 20px; color: #ddd; cursor: pointer; transition: transform 0.15s; }
.stars .star:hover { transform: scale(1.2); }
.stars .star.filled { color: #f1c40f; }
.stars.interactive .star { font-size: 28px; }

.score-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 20px; font-size: 13px; font-weight: bold;
}
.score-badge.high { background: #e8f8f5; color: var(--success); }
.score-badge.mid { background: #fef9e7; color: var(--warning); }
.score-badge.low { background: #fdedec; color: var(--danger); }

/* ====== 动画卡片网格 ====== */
.anime-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 20px; margin-bottom: 30px; min-height: 400px;
  align-items: stretch;
}
.anime-card { padding: 20px; transition: transform 0.2s, box-shadow 0.2s; display: flex; flex-direction: column; height: 100%; }
.anime-card h3 { font-size: 17px; margin-bottom: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.anime-card .tag { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; background: #f0efff; color: var(--primary); margin-bottom: 10px; }
.anime-card .desc { font-size: 13px; color: var(--text-light); margin-bottom: 10px; line-height: 1.5; flex: 1; }

/* ====== 评论列表 ====== */
.comment-item { padding: 18px; }

/* ====== 搜索栏 ====== */
.search-bar { display: flex; gap: 10px; margin-bottom: 24px; }
.search-bar .form-input { flex: 1; }

/* ====== 分页 ====== */
.pagination {
  display: flex; justify-content: center; align-items: center; gap: 8px;
  padding: 20px 0;
}
.pagination .page-info { font-size: 14px; color: var(--text-light); margin: 0 10px; }

/* ====== 统计卡片 ====== */
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card { padding: 20px; text-align: center; }
.stat-card .num { font-size: 28px; font-weight: bold; margin-bottom: 4px; }
.stat-card .label { font-size: 13px; color: var(--text-light); }

/* ====== 模态弹窗 ====== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  z-index: 200; display: none; align-items: center; justify-content: center;
}
.modal-overlay.show { display: flex; }
.modal {
  background: #fff; border-radius: var(--radius); padding: 28px;
  width: 90%; max-width: 460px; box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}
.modal h3 { margin-bottom: 8px; font-size: 18px; }
.modal p { color: var(--text-light); font-size: 14px; margin-bottom: 16px; }
.modal .modal-actions { display: flex; justify-content: flex-end; gap: 10px; }

/* ====== 空状态 ====== */
.empty-state { text-align: center; padding: 50px 20px; color: var(--text-light); }
.empty-state .icon { font-size: 48px; margin-bottom: 12px; }
.empty-state p { font-size: 15px; }

/* ====== Toast ====== */
.toast-wrap {
  position: fixed; top: 16px; right: 16px; z-index: 300;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  padding: 14px 20px; border-radius: 8px; font-size: 14px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  animation: toastIn 0.3s ease;
  min-width: 280px;
}
.toast.success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.toast.error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
@keyframes toastIn { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: translateX(0); } }

/* ====== 首页两栏布局 ====== */
.home-layout { display: flex; gap: 24px; align-items: flex-start; }
.home-main { flex: 1; min-width: 0; }
.home-sidebar { width: 300px; flex-shrink: 0; }

/* ====== 评鉴列表（左图右文字） ====== */
.review-item { display: flex; gap: 24px; }
.review-item-img { width: 200px; min-height: 160px; flex-shrink: 0; }

/* ====== 响应式 ====== */
@media (max-width: 1024px) {
  .home-layout { flex-direction: column; }
  .home-sidebar { width: 100%; }
  .anime-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .container { padding: 20px 12px; }
  .header-inner { flex-wrap: wrap; padding: 8px 12px; gap: 4px; }
  .logo { font-size: 18px; padding: 10px 0; }
  .logo-icon { width: 28px !important; height: 28px !important; font-size: 14px !important; }
  nav { margin-left: 0; flex-wrap: wrap; gap: 2px; margin-right: 0; }
  nav a { padding: 8px 10px; font-size: 12px; }
  .nav-right-link { margin-left: auto; font-size: 13px; padding: 10px 12px; }
  .anime-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .anime-card { padding: 14px; }
  .anime-card h3 { font-size: 15px; }
  .anime-card .desc { font-size: 12px; }
  .stats-row { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat-card { padding: 14px; }
  .stat-card .num { font-size: 22px; }
  .review-item { flex-direction: column; gap: 0; }
  .review-item-img { width: 100% !important; min-height: 140px !important; }
  .review-item h3 { font-size: 17px; }
  .review-item p { font-size: 13px; }
  .community-layout { flex-direction: column; }
  .community-sidebar { width: 100%; }
  .page-title h1 { font-size: 24px; }
  .page-title p { font-size: 13px; }
  table { font-size: 12px; }
  table th, table td { padding: 8px 6px; }
  .table-wrapper { overflow-x: auto; }
  .btn { font-size: 13px; padding: 8px 16px; }
  .pagination { flex-wrap: wrap; gap: 6px; }
  .pagination button { font-size: 12px; padding: 6px 12px; }
  .pagination .page-info { font-size: 12px; }
  .detail-layout { flex-direction: column; }
  .detail-img { width: 100% !important; max-width: 300px; margin: 0 auto; }
  .detail-info h1 { font-size: 22px; }
  .detail-table td { font-size: 13px; }
  .voice-grid { gap: 10px; }
  .voice-card { width: 100px; }
  .voice-card-img { width: 60px; height: 60px; }
  .modal { width: 95%; max-width: 400px; padding: 20px; }
  .login-card { padding: 24px; width: 95%; }
  .search-bar { flex-direction: column; }
  .sort-tabs { flex-wrap: wrap; }
  .sort-tabs button { padding: 6px 14px; font-size: 13px; }
  .profile-header { flex-direction: column; text-align: center; }
  .profile-tabs { flex-wrap: wrap; }
  .profile-tabs button { font-size: 13px; padding: 6px 14px; }
}

@media (max-width: 480px) {
  .anime-grid { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: 1fr; }
  nav { justify-content: center; }
  nav a { padding: 6px 8px; font-size: 11px; }
  .container { padding: 14px 8px; }
  .page-title h1 { font-size: 20px; }
  .card { padding: 14px; }
  .btn { width: 100%; text-align: center; }
  .pagination { justify-content: center; }
  .voice-card { width: 80px; }
  .voice-card-img { width: 50px; height: 50px; }
  .detail-img { max-width: 100% !important; }
  .post-card { padding: 14px; }
  .post-card h3 { font-size: 15px; }
  .comment-item { padding: 10px; }
  .toast { min-width: auto; width: 90%; right: 5%; font-size: 13px; }
  .form-input, .form-select, .form-textarea { font-size: 16px; }
}