/* ============================================
   花大錢之前 | 生活決策平台 - Custom CSS
   ============================================ */

/* --- Global Styles --- */
:root {
  --primary: #2563EB;
  --primary-dark: #1D4ED8;
  --accent: #F59E0B;
  --accent-dark: #D97706;
  --success: #10B981;
  --danger: #EF4444;
  --text: #1F2937;
  --text-light: #6B7280;
  --bg: #F9FAFB;
  --card-bg: #FFFFFF;
  --border: #E5E7EB;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
}

body {
  font-family: 'Noto Sans TC', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.8;
}

/* --- Header --- */
.site-header {
  background: #FFFFFF;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.site-title a {
  font-weight: 900 !important;
  font-size: 1.5rem !important;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.main-navigation a {
  font-weight: 500;
  font-size: 0.95rem;
  padding: 10px 16px !important;
  border-radius: 8px;
  transition: all 0.2s;
}

.main-navigation a:hover {
  background: var(--bg);
  color: var(--primary) !important;
}

/* --- Hero Section (Homepage) --- */
.hero-section {
  background: linear-gradient(135deg, #1E3A5F 0%, #2563EB 50%, #7C3AED 100%);
  color: white;
  padding: 60px 20px;
  text-align: center;
  border-radius: 0 0 24px 24px;
  margin-bottom: 40px;
}

.hero-section h1 {
  font-size: 2.5rem;
  font-weight: 900;
  margin-bottom: 16px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.hero-section p {
  font-size: 1.2rem;
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto 30px;
}

.hero-search {
  max-width: 500px;
  margin: 0 auto;
  position: relative;
}

.hero-search input {
  width: 100%;
  padding: 16px 50px 16px 20px;
  border: none;
  border-radius: 50px;
  font-size: 1rem;
  box-shadow: var(--shadow-lg);
}

.hero-search button {
  position: absolute;
  right: 5px;
  top: 5px;
  background: var(--accent);
  border: none;
  border-radius: 50px;
  padding: 11px 24px;
  color: white;
  font-weight: 700;
  cursor: pointer;
}

/* --- Category Cards Grid --- */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  max-width: 1200px;
  margin: 0 auto 50px;
  padding: 0 20px;
}

.category-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 24px 16px;
  text-align: center;
  box-shadow: var(--shadow);
  transition: all 0.3s;
  text-decoration: none;
  color: var(--text);
  border: 2px solid transparent;
}

.category-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
  color: var(--primary);
}

.category-card .icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
  display: block;
}

.category-card .name {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 4px;
}

.category-card .desc {
  font-size: 0.8rem;
  color: var(--text-light);
}

/* --- Article Cards --- */
.post-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: all 0.3s;
  margin-bottom: 24px;
}

.post-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.post-card .thumbnail {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.post-card .content {
  padding: 20px;
}

.post-card .category-tag {
  display: inline-block;
  background: #EEF2FF;
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  margin-bottom: 8px;
}

.post-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.5;
  margin-bottom: 8px;
}

.post-card h3 a {
  color: var(--text);
  text-decoration: none;
}

.post-card h3 a:hover {
  color: var(--primary);
}

.post-card .excerpt {
  color: var(--text-light);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* --- Loan CTA Banner --- */
.loan-cta {
  background: linear-gradient(135deg, #F59E0B 0%, #EF4444 100%);
  color: white;
  padding: 30px;
  border-radius: var(--radius);
  text-align: center;
  margin: 40px 0;
}

.loan-cta h3 {
  font-size: 1.5rem;
  font-weight: 900;
  margin-bottom: 10px;
}

.loan-cta p {
  font-size: 1rem;
  opacity: 0.95;
  margin-bottom: 20px;
}

.loan-cta .cta-button {
  display: inline-block;
  background: white;
  color: var(--danger);
  padding: 14px 36px;
  border-radius: 50px;
  font-weight: 700;
  font-size: 1.1rem;
  text-decoration: none;
  transition: all 0.3s;
  box-shadow: 0 4px 14px rgba(0,0,0,0.15);
}

.loan-cta .cta-button:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

/* --- Sidebar Loan Widget --- */
.loan-cta-widget {
  background: linear-gradient(180deg, #1E40AF, #2563EB);
  color: white;
  padding: 24px;
  border-radius: var(--radius);
  text-align: center;
  position: sticky;
  top: 80px;
}

.loan-cta-widget h4 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.loan-cta-widget .btn {
  display: block;
  background: var(--accent);
  color: white;
  padding: 12px;
  border-radius: 8px;
  font-weight: 700;
  text-decoration: none;
  margin-top: 16px;
  transition: all 0.2s;
}

.loan-cta-widget .btn:hover {
  background: var(--accent-dark);
}

/* --- Tool Cards --- */
.tool-card {
  background: linear-gradient(135deg, #EEF2FF, #E0E7FF);
  border: 2px solid var(--primary);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  transition: all 0.3s;
}

.tool-card:hover {
  background: linear-gradient(135deg, #C7D2FE, #A5B4FC);
}

.tool-card .tool-icon {
  font-size: 3rem;
  margin-bottom: 12px;
}

.tool-card h4 {
  font-weight: 700;
  margin-bottom: 8px;
}

.tool-card .tool-btn {
  display: inline-block;
  background: var(--primary);
  color: white;
  padding: 10px 24px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  margin-top: 12px;
}

/* --- In-Article Styles --- */
.entry-content h2 {
  font-weight: 800;
  font-size: 1.5rem;
  color: var(--text);
  border-left: 4px solid var(--primary);
  padding-left: 16px;
  margin: 40px 0 20px;
}

.entry-content h3 {
  font-weight: 700;
  font-size: 1.2rem;
  margin: 30px 0 15px;
}

.entry-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.entry-content table thead th {
  background: var(--primary);
  color: white;
  padding: 12px 16px;
  font-weight: 600;
  text-align: left;
}

.entry-content table tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.entry-content table tbody tr:nth-child(even) {
  background: #F9FAFB;
}

.entry-content table tbody tr:hover {
  background: #EEF2FF;
}

/* --- FAQ Section (GEO optimized) --- */
.faq-section {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 30px;
  margin: 30px 0;
  box-shadow: var(--shadow);
}

.faq-section h3 {
  font-weight: 800;
  margin-bottom: 20px;
  color: var(--primary);
}

.faq-item {
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
}

.faq-item:last-child {
  border-bottom: none;
}

.faq-item .question {
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.faq-item .answer {
  color: var(--text-light);
  line-height: 1.8;
}

/* --- Footer --- */
.site-footer {
  background: #111827;
  color: #D1D5DB;
  padding: 50px 20px 30px;
}

.footer-widgets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 30px;
  max-width: 1200px;
  margin: 0 auto 30px;
}

.footer-widget h4 {
  color: white;
  font-weight: 700;
  margin-bottom: 16px;
}

.footer-widget a {
  color: #9CA3AF;
  text-decoration: none;
  display: block;
  padding: 4px 0;
  transition: color 0.2s;
}

.footer-widget a:hover {
  color: var(--accent);
}

.footer-bottom {
  text-align: center;
  border-top: 1px solid #374151;
  padding-top: 20px;
  font-size: 0.85rem;
  color: #6B7280;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .hero-section h1 { font-size: 1.8rem; }
  .hero-section p { font-size: 1rem; }
  .category-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .category-card { padding: 16px 10px; }
  .category-card .icon { font-size: 1.8rem; }
  .category-card .name { font-size: 0.85rem; }
  .category-card .desc { display: none; }
  .loan-cta h3 { font-size: 1.2rem; }
}

@media (max-width: 480px) {
  .category-grid { grid-template-columns: repeat(2, 1fr); }
}

/* --- Breadcrumb --- */
.breadcrumb {
  font-size: 0.85rem;
  color: var(--text-light);
  padding: 12px 0;
  margin-bottom: 20px;
}

.breadcrumb a {
  color: var(--primary);
  text-decoration: none;
}

/* --- Reading Progress Bar --- */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  z-index: 9999;
  transition: width 0.1s;
}

/* --- Back to Top --- */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: var(--primary);
  color: white;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transition: all 0.3s;
  z-index: 999;
}

.back-to-top.visible {
  opacity: 1;
}

.back-to-top:hover {
  background: var(--primary-dark);
  transform: translateY(-3px);
}
