/* ===== CSS 變數定義 ===== */
:root {
  --primary-color: #dc3545;
  --primary-dark: #c82333;
  --primary-light: #e74c3c;
  --secondary-color: #6c757d;
  --success-color: #28a745;
  --info-color: #17a2b8;
  --warning-color: #ffc107;
  --danger-color: #dc3545;
  --light-bg: #f8f9fa;
  --dark-bg: #212529;
  --border-color: #dee2e6;
  --text-primary: #212529;
  --text-secondary: #6c757d;
  --gradient-primary: linear-gradient(135deg, #dc3545 0%, #e74c3c 100%);
  --gradient-light: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  --gradient-dark: linear-gradient(135deg, #212529 0%, #343a40 100%);
  --shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  --shadow-md: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
  --transition-base: all 0.3s ease-in-out;
}

/* ===== 全局樣式 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; color: var(--text-primary); background-color: #fff; }
a { color: var(--primary-color); text-decoration: none; transition: var(--transition-base); }
a:hover { color: var(--primary-dark); }
.container-fluid { max-width: 1400px; margin: 0 auto; }

/* ===== 導航欄 ===== */
.navbar { box-shadow: var(--shadow-sm); }
.navbar-brand { font-size: 1.5rem; color: var(--primary-color) !important; }
.navbar-brand i { margin-right: 0.5rem; }
.navbar-light .navbar-nav .nav-link { color: var(--text-primary) !important; font-weight: 500; transition: var(--transition-base); }
.navbar-light .navbar-nav .nav-link:hover, .navbar-light .navbar-nav .nav-link.active { color: var(--primary-color) !important; }

/* ===== 英雄區域 ===== */
.hero-section { background-size: cover; background-position: center; background-attachment: fixed; position: relative; overflow: hidden; }
.hero-overlay { background: rgba(0, 0, 0, 0.4); min-height: 100vh; display: flex; align-items: center; }
.hero-title { font-size: 3.5rem; font-weight: 900; color: #fff; text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5); margin-bottom: 1rem; }
.hero-subtitle { font-size: 1.5rem; color: rgba(255, 255, 255, 0.95); text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3); margin-bottom: 2rem; }
.hero-search { position: relative; }
.hero-search input { border: none; border-radius: 50px; padding: 1rem 1.5rem; box-shadow: var(--shadow-md); }
.hero-search input:focus { outline: none; box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.25); }

/* ===== 特色卡片 ===== */
.features-section { padding: 5rem 0; }
.section-title { font-size: 2.5rem; font-weight: 800; color: var(--text-primary); margin-bottom: 0.5rem; }
.section-subtitle { font-size: 1.1rem; color: var(--text-secondary); margin-bottom: 2rem; }
.feature-card { background: #fff; border: 1px solid var(--border-color); border-radius: 12px; padding: 2rem; text-align: center; transition: var(--transition-base); box-shadow: var(--shadow-sm); }
.feature-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-lg); border-color: var(--primary-color); }
.feature-icon { font-size: 3rem; color: var(--primary-color); margin-bottom: 1rem; }
.feature-card h5 { font-weight: 700; color: var(--text-primary); margin-bottom: 0.5rem; }
.feature-card p { color: var(--text-secondary); font-size: 0.95rem; }

/* ===== 精選工具區域 ===== */
.featured-section { padding: 5rem 0; background: #fff; }
.featured-section .section-title { text-align: center; }
.featured-section .section-subtitle { text-align: center; }

/* ===== 工具卡片 ===== */
.tool-card { background: #fff; border: 1px solid var(--border-color); border-radius: 12px; overflow: hidden; transition: var(--transition-base); box-shadow: var(--shadow-sm); cursor: pointer; }
.tool-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: var(--primary-color); }
.tool-card-image { width: 100%; height: 180px; background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%); display: flex; align-items: center; justify-content: center; font-size: 3rem; color: var(--primary-color); overflow: hidden; }
.tool-card-image img { width: 100%; height: 100%; object-fit: cover; }
.tool-card-body { padding: 1.5rem; }
.tool-card-title { font-size: 1.1rem; font-weight: 700; color: var(--text-primary); margin-bottom: 0.5rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tool-card-category { display: inline-block; font-size: 0.75rem; font-weight: 600; background: var(--light-bg); color: var(--primary-color); padding: 0.25rem 0.75rem; border-radius: 20px; margin-bottom: 0.5rem; }
.tool-card-desc { font-size: 0.9rem; color: var(--text-secondary); margin-bottom: 1rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tool-card-footer { display: flex; justify-content: space-between; align-items: center; padding-top: 1rem; border-top: 1px solid var(--border-color); }
.tool-downloads { font-size: 0.9rem; color: var(--text-secondary); }
.tool-downloads strong { color: var(--primary-color); font-weight: 700; }
.tool-rating { color: var(--warning-color); font-size: 0.9rem; }

/* ===== 分類卡片 ===== */
.categories-section { padding: 5rem 0; }
.category-card { background: #fff; border: 2px solid var(--border-color); border-radius: 12px; padding: 2rem; text-align: center; transition: var(--transition-base); cursor: pointer; }
.category-card:hover { border-color: var(--primary-color); background: var(--light-bg); transform: translateY(-4px); }
.category-icon { font-size: 2.5rem; color: var(--primary-color); margin-bottom: 1rem; }
.category-card h5 { font-weight: 700; color: var(--text-primary); margin-bottom: 0.5rem; }
.category-card p { color: var(--text-secondary); font-size: 0.95rem; margin-bottom: 0.5rem; }
.category-card small { color: var(--text-secondary); }

/* ===== 評論區域 ===== */
.reviews-section { padding: 5rem 0; background: #fff; }
.review-card { background: #fff; border: 1px solid var(--border-color); border-radius: 12px; padding: 1.5rem; box-shadow: var(--shadow-sm); transition: var(--transition-base); }
.review-card:hover { box-shadow: var(--shadow-md); }
.review-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.review-author { font-weight: 700; color: var(--text-primary); }
.review-date { font-size: 0.85rem; color: var(--text-secondary); }
.review-rating { color: var(--warning-color); font-size: 0.95rem; }
.review-text { color: var(--text-primary); line-height: 1.6; margin-bottom: 1rem; }
.review-helpful { display: flex; gap: 1rem; font-size: 0.9rem; }
.review-helpful button { background: none; border: none; color: var(--text-secondary); cursor: pointer; transition: var(--transition-base); }
.review-helpful button:hover { color: var(--primary-color); }

/* ===== 排行榜 ===== */
.ranking-list { }
.ranking-item { background: #fff; border: 1px solid var(--border-color); border-radius: 12px; padding: 1.5rem; margin-bottom: 1.5rem; display: flex; align-items: center; gap: 1.5rem; transition: var(--transition-base); cursor: pointer; }
.ranking-item:hover { box-shadow: var(--shadow-md); border-color: var(--primary-color); }
.ranking-badge { width: 50px; height: 50px; background: var(--gradient-primary); color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 1.5rem; flex-shrink: 0; }
.ranking-badge.top1 { background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%); color: #333; }
.ranking-badge.top2 { background: linear-gradient(135deg, #c0c0c0 0%, #e8e8e8 100%); color: #333; }
.ranking-badge.top3 { background: linear-gradient(135deg, #cd7f32 0%, #e6b87d 100%); color: #fff; }
.ranking-content { flex: 1; }
.ranking-title { font-size: 1.1rem; font-weight: 700; color: var(--text-primary); margin-bottom: 0.25rem; }
.ranking-meta { display: flex; gap: 1.5rem; font-size: 0.9rem; color: var(--text-secondary); margin-bottom: 0.5rem; }
.ranking-desc { font-size: 0.9rem; color: var(--text-secondary); }
.ranking-stats { display: flex; gap: 1.5rem; align-items: center; }
.stat-item { text-align: center; }
.stat-value { font-size: 1.3rem; font-weight: 700; color: var(--primary-color); }
.stat-label { font-size: 0.8rem; color: var(--text-secondary); }

/* ===== 頁面標題 ===== */
.page-header { background: var(--gradient-primary); padding: 3rem 0; }
.page-header h1 { font-size: 2.5rem; font-weight: 800; }
.page-header p { font-size: 1.1rem; opacity: 0.95; }

/* ===== 篩選區域 ===== */
.filter-section { background: var(--light-bg); padding: 1.5rem 0; }
.filter-section input, .filter-section select { border: 1px solid var(--border-color); border-radius: 8px; padding: 0.75rem; font-size: 0.95rem; }
.filter-section input:focus, .filter-section select:focus { outline: none; border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1); }

/* ===== 工具詳情頁面 ===== */
.tool-detail-section { padding: 3rem 0; }
.tool-header { border-bottom: 2px solid var(--border-color); padding-bottom: 2rem; }
.tool-header h1 { font-size: 2rem; font-weight: 800; color: var(--text-primary); margin-bottom: 1rem; }
.tool-meta { display: flex; gap: 2rem; flex-wrap: wrap; margin-bottom: 1rem; }
.tool-meta-item { display: flex; align-items: center; gap: 0.5rem; }
.tool-meta-item i { color: var(--primary-color); font-size: 1.1rem; }
.tool-video { background: #000; border-radius: 12px; overflow: hidden; aspect-ratio: 16 / 9; }
.tool-video iframe { width: 100%; height: 100%; border: none; }
.tool-description h4 { font-size: 1.3rem; font-weight: 700; color: var(--text-primary); margin-bottom: 1rem; }
.tool-description p { color: var(--text-secondary); line-height: 1.8; margin-bottom: 1rem; }

/* ===== 下載卡片 ===== */
.download-card { background: var(--gradient-primary); color: #fff; border-radius: 12px; padding: 2rem; text-align: center; box-shadow: var(--shadow-md); }
.download-card h5 { font-size: 1.5rem; font-weight: 700; margin-bottom: 1rem; }
.download-card p { font-size: 0.95rem; margin-bottom: 1.5rem; opacity: 0.95; }
.download-card .btn { background: #fff; color: var(--primary-color); font-weight: 700; border: none; padding: 0.75rem 2rem; border-radius: 8px; transition: var(--transition-base); }
.download-card .btn:hover { background: var(--light-bg); transform: scale(1.05); }

/* ===== 統計卡片 ===== */
.stats-card { background: #fff; border: 1px solid var(--border-color); border-radius: 12px; padding: 1.5rem; box-shadow: var(--shadow-sm); }
.stats-card h6 { font-size: 0.9rem; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 1rem; }
.stats-card .stat-row { display: flex; justify-content: space-between; align-items: center; padding: 0.75rem 0; border-bottom: 1px solid var(--border-color); }
.stats-card .stat-row:last-child { border-bottom: none; }
.stats-card .stat-label { color: var(--text-secondary); font-size: 0.9rem; }
.stats-card .stat-value { color: var(--primary-color); font-weight: 700; font-size: 1.1rem; }

/* ===== 資訊卡片 ===== */
.info-card { background: #fff; border: 1px solid var(--border-color); border-radius: 12px; padding: 1.5rem; box-shadow: var(--shadow-sm); }
.info-card h6 { font-size: 0.9rem; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 1rem; }
.info-row { display: flex; justify-content: space-between; align-items: center; padding: 0.75rem 0; border-bottom: 1px solid var(--border-color); }
.info-row:last-child { border-bottom: none; }
.info-label { color: var(--text-secondary); font-size: 0.9rem; }
.info-value { color: var(--text-primary); font-weight: 600; }

/* ===== 評論表單 ===== */
.review-form { background: var(--light-bg); border-radius: 12px; padding: 2rem; }
.review-form h5 { font-weight: 700; color: var(--text-primary); margin-bottom: 1.5rem; }
.review-form .form-label { font-weight: 600; color: var(--text-primary); margin-bottom: 0.5rem; }
.review-form input, .review-form textarea, .review-form select { border: 1px solid var(--border-color); border-radius: 8px; padding: 0.75rem; font-size: 0.95rem; }
.review-form input:focus, .review-form textarea:focus, .review-form select:focus { outline: none; border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1); }
.review-form .btn { background: var(--primary-color); color: #fff; font-weight: 700; border: none; padding: 0.75rem 2rem; border-radius: 8px; cursor: pointer; transition: var(--transition-base); }
.review-form .btn:hover { background: var(--primary-dark); }

/* ===== 儀表板 ===== */
.stats-overview { padding: 3rem 0; background: #fff; }
.stat-card { background: #fff; border: 1px solid var(--border-color); border-radius: 12px; padding: 1.5rem; display: flex; align-items: center; gap: 1.5rem; box-shadow: var(--shadow-sm); transition: var(--transition-base); }
.stat-card:hover { box-shadow: var(--shadow-md); }
.stat-icon { width: 60px; height: 60px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; color: #fff; flex-shrink: 0; }
.stat-icon.bg-danger { background: var(--primary-color); }
.stat-icon.bg-primary { background: var(--info-color); }
.stat-icon.bg-success { background: var(--success-color); }
.stat-icon.bg-info { background: var(--info-color); }
.stat-content { flex: 1; }
.stat-label { font-size: 0.85rem; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 0.25rem; }
.stat-value { font-size: 1.8rem; font-weight: 800; color: var(--text-primary); }
.stat-change { font-size: 0.85rem; }
.stat-change.text-success { color: var(--success-color); }
.stat-change.text-info { color: var(--info-color); }
.stat-change.text-warning { color: var(--warning-color); }
.stat-change.text-secondary { color: var(--text-secondary); }

/* ===== 圖表卡片 ===== */
.charts-section { padding: 3rem 0; }
.chart-card { background: #fff; border: 1px solid var(--border-color); border-radius: 12px; padding: 2rem; box-shadow: var(--shadow-sm); }
.chart-card h5 { font-weight: 700; color: var(--text-primary); margin-bottom: 1.5rem; }

/* ===== 表格 ===== */
.table { font-size: 0.95rem; }
.table thead th { background: var(--light-bg); font-weight: 700; color: var(--text-primary); border: none; padding: 1rem; }
.table tbody td { padding: 1rem; border-color: var(--border-color); vertical-align: middle; }
.table tbody tr:hover { background: var(--light-bg); }

/* ===== 頁尾 ===== */
.footer { background: var(--dark-bg); color: #fff; padding: 3rem 0 1rem; }
.footer h5 { font-weight: 700; margin-bottom: 1rem; }
.footer a { color: rgba(255, 255, 255, 0.8); }
.footer a:hover { color: #fff; }
.footer hr { border-color: rgba(255, 255, 255, 0.1); }
.footer p { margin-bottom: 0.5rem; }

/* ===== 關於我們頁面 ===== */
.about-content { padding: 3rem 0; }
.value-card { background: #fff; border: 1px solid var(--border-color); border-radius: 12px; padding: 2rem; text-align: center; transition: var(--transition-base); box-shadow: var(--shadow-sm); }
.value-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); border-color: var(--primary-color); }
.value-icon { font-size: 2.5rem; color: var(--primary-color); margin-bottom: 1rem; }
.value-card h5 { font-weight: 700; color: var(--text-primary); margin-bottom: 0.5rem; }
.value-card p { color: var(--text-secondary); font-size: 0.95rem; }
.category-detail { background: #fff; border: 1px solid var(--border-color); border-radius: 12px; padding: 1.5rem; }
.category-detail h5 { font-weight: 700; color: var(--text-primary); margin-bottom: 1rem; }
.category-detail p { color: var(--text-secondary); margin-bottom: 1rem; }
.category-detail ul { list-style: none; }
.category-detail li { color: var(--text-secondary); padding: 0.25rem 0; }
.category-detail li:before { content: '✓ '; color: var(--primary-color); font-weight: 700; margin-right: 0.5rem; }
.safety-pledge { background: var(--light-bg); border-left: 4px solid var(--primary-color); }
.safety-pledge h3 { font-weight: 700; color: var(--text-primary); }
.safety-pledge strong { color: var(--text-primary); }
.contact-section { padding: 3rem 0; }
.contact-item { background: #fff; border-radius: 12px; padding: 2rem; text-align: center; transition: var(--transition-base); }
.contact-item:hover { transform: translateY(-4px); }
.contact-icon { font-size: 2.5rem; color: var(--primary-color); margin-bottom: 1rem; }
.contact-item h6 { font-weight: 700; color: var(--text-primary); margin-bottom: 0.5rem; }
.contact-item p { color: var(--text-secondary); margin-bottom: 0; }

/* ===== 按鈕 ===== */
.btn-danger { background: var(--primary-color); border: none; font-weight: 700; transition: var(--transition-base); }
.btn-danger:hover { background: var(--primary-dark); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn-outline-danger { color: var(--primary-color); border: 2px solid var(--primary-color); font-weight: 700; transition: var(--transition-base); }
.btn-outline-danger:hover { background: var(--primary-color); color: #fff; }
.btn-lg { padding: 0.75rem 2rem; font-size: 1.1rem; border-radius: 8px; }

/* ===== 響應式設計 ===== */
@media (max-width: 768px) {
  .hero-title { font-size: 2rem; }
  .hero-subtitle { font-size: 1.1rem; }
  .section-title { font-size: 1.8rem; }
  .ranking-item { flex-direction: column; text-align: center; }
  .ranking-stats { flex-direction: column; width: 100%; }
  .tool-header h1 { font-size: 1.5rem; }
  .tool-meta { flex-direction: column; gap: 1rem; }
  .tool-detail-section .row { flex-direction: column-reverse; }
  .tool-sidebar { margin-top: 2rem; }
  .stat-card { flex-direction: column; text-align: center; }
  .page-header h1 { font-size: 1.8rem; }
  .page-header p { font-size: 1rem; }
  .table { font-size: 0.85rem; }
  .table thead th, .table tbody td { padding: 0.75rem 0.5rem; }
}

@media (max-width: 576px) {
  .hero-title { font-size: 1.5rem; }
  .hero-subtitle { font-size: 0.95rem; }
  .section-title { font-size: 1.5rem; }
  .feature-card { padding: 1.5rem; }
  .feature-icon { font-size: 2rem; }
  .ranking-badge { width: 40px; height: 40px; font-size: 1.2rem; }
  .ranking-title { font-size: 1rem; }
  .ranking-meta { flex-direction: column; gap: 0.5rem; }
  .tool-card-title { font-size: 1rem; }
  .tool-card-body { padding: 1rem; }
  .download-card { padding: 1.5rem; }
  .download-card h5 { font-size: 1.2rem; }
  .stat-value { font-size: 1.5rem; }
  .stat-label { font-size: 0.8rem; }
  .navbar-brand { font-size: 1.2rem; }
  .page-header h1 { font-size: 1.5rem; }
  .page-header p { font-size: 0.9rem; }
}
