/* ============================================
   宏文出版社 - Hongwen Publishing
   現代文創風 · Modern Cultural Style
   ============================================ */

:root {
  /* 色彩系統 */
  --ink: #1A1A1A;
  --ink-soft: #2C2C2C;
  --ink-muted: #6B6B6B;
  --ink-faint: #A8A8A8;

  --paper: #F5F1EA;
  --paper-alt: #FAF7F1;
  --paper-warm: #EDE7DA;

  --accent: #E86A3C;
  --accent-hover: #C9541E;
  --accent-soft: #FCE9DF;

  --line: #DDD6C6;
  --line-soft: #E8E2D3;

  --white: #FFFFFF;

  /* 字體 */
  --font-serif: 'Noto Serif TC', 'Songti TC', 'PingFang TC', serif;
  --font-sans: 'Noto Sans TC', 'PingFang TC', 'Microsoft JhengHei', sans-serif;

  /* 尺寸 */
  --container: 1200px;
  --container-narrow: 960px;

  /* 陰影 */
  --shadow-sm: 0 2px 8px rgba(26, 26, 26, 0.04);
  --shadow-md: 0 8px 24px rgba(26, 26, 26, 0.08);
  --shadow-lg: 0 20px 60px rgba(26, 26, 26, 0.12);

  /* 動畫 */
  --transition: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   基礎重置
   ============================================ */

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.75;
  color: var(--ink);
  background: var(--paper);
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition);
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

img {
  max-width: 100%;
  display: block;
}

/* ============================================
   通用元件
   ============================================ */

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 32px;
}

.container-narrow {
  max-width: var(--container-narrow);
  margin: 0 auto;
  padding: 0 32px;
}

.section {
  padding: 120px 0;
}

.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  letter-spacing: 3px;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 24px;
  text-transform: uppercase;
}

.section-tag::before {
  content: '';
  width: 32px;
  height: 1px;
  background: var(--accent);
}

.section-title {
  font-family: var(--font-serif);
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 500;
  line-height: 1.2;
  color: var(--ink);
  margin-bottom: 24px;
  letter-spacing: -0.02em;
}

.section-subtitle {
  font-size: 17px;
  color: var(--ink-muted);
  max-width: 620px;
  line-height: 1.8;
}

.section-header {
  margin-bottom: 72px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 32px;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.5px;
  border-radius: 2px;
  transition: all var(--transition);
  cursor: pointer;
}

.btn-primary {
  background: var(--ink);
  color: var(--paper);
}

.btn-primary:hover {
  background: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-outline {
  border: 1px solid var(--ink);
  color: var(--ink);
}

.btn-outline:hover {
  background: var(--ink);
  color: var(--paper);
}

.btn-accent {
  background: var(--accent);
  color: var(--white);
}

.btn-accent:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
}

.btn-arrow {
  transition: transform var(--transition);
}

.btn:hover .btn-arrow {
  transform: translateX(4px);
}

/* ============================================
   導覽列
   ============================================ */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(245, 241, 234, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid transparent;
  transition: all var(--transition);
}

.nav.scrolled {
  border-bottom-color: var(--line);
  background: rgba(245, 241, 234, 0.95);
}

.nav-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 20px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.05em;
}

.nav-logo svg {
  width: 36px;
  height: 36px;
}

.nav-menu {
  display: flex;
  gap: 40px;
  list-style: none;
}

.nav-menu a {
  font-size: 15px;
  color: var(--ink-soft);
  font-weight: 500;
  position: relative;
  padding: 4px 0;
}

.nav-menu a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width var(--transition);
}

.nav-menu a:hover {
  color: var(--accent);
}

.nav-menu a:hover::after {
  width: 100%;
}

.nav-cta {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-toggle {
  display: none;
  width: 32px;
  height: 32px;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 1.5px;
  background: var(--ink);
  transition: all var(--transition);
}

/* ============================================
   Hero 主視覺
   ============================================ */

.hero {
  min-height: 100vh;
  padding: 160px 0 80px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 20%;
  right: -10%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--accent-soft) 0%, transparent 70%);
  opacity: 0.6;
  z-index: 0;
}

.hero-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 32px;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 80px;
  align-items: center;
  position: relative;
  z-index: 1;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  letter-spacing: 4px;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 32px;
}

.hero-eyebrow::before {
  content: '';
  width: 40px;
  height: 1px;
  background: var(--accent);
}

.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(48px, 7vw, 88px);
  font-weight: 500;
  line-height: 1.1;
  color: var(--ink);
  letter-spacing: -0.02em;
  margin-bottom: 32px;
}

.hero-title .accent {
  color: var(--accent);
  font-style: italic;
}

.hero-desc {
  font-size: 18px;
  line-height: 1.8;
  color: var(--ink-muted);
  margin-bottom: 40px;
  max-width: 480px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.hero-visual {
  position: relative;
  height: 520px;
}

.hero-book {
  position: absolute;
  border-radius: 4px;
  box-shadow: var(--shadow-lg);
  transition: transform 600ms cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.hero-book:hover {
  transform: translateY(-8px) rotate(0deg) !important;
}

.hero-book-1 {
  width: 240px;
  height: 340px;
  top: 40px;
  left: 20px;
  transform: rotate(-6deg);
  background: linear-gradient(135deg, #2C4A5E 0%, #1A2E3F 100%);
  z-index: 3;
}

.hero-book-2 {
  width: 220px;
  height: 320px;
  top: 20px;
  right: 40px;
  transform: rotate(4deg);
  background: linear-gradient(135deg, #E86A3C 0%, #B8462B 100%);
  z-index: 2;
}

.hero-book-3 {
  width: 200px;
  height: 300px;
  bottom: 40px;
  left: 100px;
  transform: rotate(-2deg);
  background: linear-gradient(135deg, #4A3D2F 0%, #2C231A 100%);
  z-index: 1;
}

.book-cover-content {
  padding: 40px 28px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: rgba(255, 255, 255, 0.95);
}

.book-cover-title {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: 0.05em;
}

.book-cover-author {
  font-size: 12px;
  letter-spacing: 3px;
  opacity: 0.7;
  text-transform: uppercase;
}

.book-cover-line {
  width: 32px;
  height: 1px;
  background: rgba(255, 255, 255, 0.4);
  margin: 16px 0;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 60px;
  margin: 100px auto 0;
  padding: 48px 32px 0;
  border-top: 1px solid var(--line);
  max-width: var(--container);
  position: relative;
  z-index: 2;
}

.stat {
  text-align: left;
}

.stat-num {
  font-family: var(--font-serif);
  font-size: 56px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1;
  margin-bottom: 12px;
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.stat-num sup {
  font-size: 20px;
  color: var(--accent);
  font-weight: 400;
  margin-left: -2px;
  vertical-align: baseline;
  top: 0;
}

.stat-label {
  font-size: 13px;
  letter-spacing: 2px;
  color: var(--ink-muted);
}

/* ============================================
   新書上架
   ============================================ */

.new-books {
  background: var(--paper-alt);
}

.books-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
}

.book-card {
  background: transparent;
  transition: transform var(--transition);
}

.book-card:hover {
  transform: translateY(-8px);
}

.book-cover {
  width: 100%;
  aspect-ratio: 3/4;
  border-radius: 3px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  margin-bottom: 20px;
  position: relative;
  transition: box-shadow var(--transition);
}

.book-card:hover .book-cover {
  box-shadow: var(--shadow-lg);
}

.book-cover-inner {
  width: 100%;
  height: 100%;
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: rgba(255, 255, 255, 0.95);
}

.book-info {
  padding: 0 4px;
}

.book-category {
  font-size: 12px;
  letter-spacing: 2px;
  color: var(--accent);
  margin-bottom: 10px;
  font-weight: 500;
}

.book-title {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 8px;
  line-height: 1.4;
}

.book-author {
  font-size: 14px;
  color: var(--ink-muted);
  margin-bottom: 14px;
}

.book-price {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.book-price-num {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 500;
  color: var(--ink);
}

.book-price-num::before {
  content: 'NT$ ';
  font-size: 13px;
  color: var(--ink-muted);
  margin-right: 2px;
}

.book-buy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--accent);
  font-weight: 500;
  transition: gap var(--transition);
}

.book-buy:hover {
  gap: 10px;
}

/* ============================================
   書籍分類
   ============================================ */

.categories {
  background: var(--paper);
}

.category-tabs {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 64px;
  flex-wrap: wrap;
}

.category-tab {
  padding: 12px 24px;
  font-size: 15px;
  color: var(--ink-muted);
  font-weight: 500;
  border-radius: 100px;
  transition: all var(--transition);
  border: 1px solid var(--line);
}

.category-tab.active,
.category-tab:hover {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.category-content {
  display: none;
}

.category-content.active {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  animation: fadeIn 500ms ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   關於宏文
   ============================================ */

.about {
  background: var(--ink);
  color: var(--paper);
  position: relative;
  overflow: hidden;
}

.about::before {
  content: '文';
  position: absolute;
  top: 50%;
  right: -100px;
  transform: translateY(-50%);
  font-family: var(--font-serif);
  font-size: 600px;
  color: rgba(232, 106, 60, 0.06);
  line-height: 1;
  pointer-events: none;
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: start;
  position: relative;
}

.about-content .section-tag {
  color: var(--accent);
}

.about-content .section-title {
  color: var(--paper);
}

.about-desc {
  font-size: 17px;
  line-height: 1.9;
  color: rgba(245, 241, 234, 0.75);
  margin-bottom: 24px;
}

.about-desc:last-of-type {
  margin-bottom: 40px;
}

.about-values {
  display: grid;
  gap: 24px;
}

.value-card {
  padding: 32px;
  background: rgba(245, 241, 234, 0.04);
  border: 1px solid rgba(245, 241, 234, 0.1);
  border-radius: 4px;
  transition: all var(--transition);
}

.value-card:hover {
  background: rgba(232, 106, 60, 0.08);
  border-color: var(--accent);
  transform: translateX(8px);
}

.value-num {
  font-family: var(--font-serif);
  font-size: 32px;
  color: var(--accent);
  margin-bottom: 12px;
  font-weight: 500;
}

.value-title {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 500;
  color: var(--paper);
  margin-bottom: 12px;
}

.value-desc {
  font-size: 15px;
  color: rgba(245, 241, 234, 0.7);
  line-height: 1.8;
}

/* ============================================
   出版動態
   ============================================ */

.news {
  background: var(--paper-alt);
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.news-card {
  background: var(--white);
  border-radius: 4px;
  overflow: hidden;
  transition: all var(--transition);
  border: 1px solid var(--line-soft);
}

.news-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}

.news-image {
  aspect-ratio: 16/10;
  background: linear-gradient(135deg, var(--paper-warm) 0%, var(--line-soft) 100%);
  position: relative;
  overflow: hidden;
}

.news-image-content {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-size: 80px;
  color: var(--ink);
  opacity: 0.12;
}

.news-card:nth-child(1) .news-image {
  background: linear-gradient(135deg, #2C4A5E 0%, #1A2E3F 100%);
}
.news-card:nth-child(1) .news-image-content {
  color: var(--paper);
  opacity: 0.2;
}

.news-card:nth-child(2) .news-image {
  background: linear-gradient(135deg, #E86A3C 0%, #C9541E 100%);
}
.news-card:nth-child(2) .news-image-content {
  color: var(--white);
  opacity: 0.2;
}

.news-card:nth-child(3) .news-image {
  background: linear-gradient(135deg, #4A3D2F 0%, #2C231A 100%);
}
.news-card:nth-child(3) .news-image-content {
  color: var(--paper);
  opacity: 0.2;
}

.news-body {
  padding: 32px 28px;
}

.news-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  color: var(--ink-muted);
  margin-bottom: 16px;
}

.news-tag {
  color: var(--accent);
  font-weight: 500;
  letter-spacing: 1px;
}

.news-dot {
  width: 3px;
  height: 3px;
  background: var(--ink-faint);
  border-radius: 50%;
}

.news-title {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 14px;
  line-height: 1.4;
}

.news-excerpt {
  font-size: 15px;
  color: var(--ink-muted);
  line-height: 1.75;
  margin-bottom: 20px;
}

.news-read {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--accent);
  font-weight: 500;
  transition: gap var(--transition);
}

.news-read:hover {
  gap: 12px;
}

/* ============================================
   電子報訂閱
   ============================================ */

.newsletter {
  background: var(--paper);
  padding: 120px 0;
  position: relative;
}

.newsletter-inner {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
  padding: 0 32px;
}

.newsletter-title {
  font-family: var(--font-serif);
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 20px;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.newsletter-desc {
  font-size: 17px;
  color: var(--ink-muted);
  margin-bottom: 40px;
  line-height: 1.8;
}

.newsletter-form {
  display: flex;
  gap: 12px;
  max-width: 520px;
  margin: 0 auto;
}

.newsletter-input {
  flex: 1;
  padding: 16px 24px;
  font-size: 15px;
  font-family: inherit;
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: 2px;
  color: var(--ink);
  transition: border-color var(--transition);
}

.newsletter-input:focus {
  outline: none;
  border-color: var(--accent);
}

.newsletter-input::placeholder {
  color: var(--ink-faint);
}

.newsletter-note {
  margin-top: 16px;
  font-size: 13px;
  color: var(--ink-faint);
}

/* ============================================
   頁尾
   ============================================ */

.footer {
  background: var(--ink);
  color: rgba(245, 241, 234, 0.7);
  padding: 80px 0 32px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 60px;
  margin-bottom: 60px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-serif);
  font-size: 24px;
  color: var(--paper);
  margin-bottom: 20px;
  font-weight: 600;
}

.footer-brand svg {
  width: 40px;
  height: 40px;
}

.footer-desc {
  font-size: 14px;
  line-height: 1.8;
  color: rgba(245, 241, 234, 0.6);
  max-width: 320px;
}

.footer-title {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 500;
  color: var(--paper);
  margin-bottom: 20px;
  letter-spacing: 0.05em;
}

.footer-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-list a {
  font-size: 14px;
  color: rgba(245, 241, 234, 0.6);
  transition: color var(--transition);
}

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

.footer-social {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.social-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(245, 241, 234, 0.15);
  border-radius: 50%;
  transition: all var(--transition);
  color: rgba(245, 241, 234, 0.7);
}

.social-icon:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--white);
  transform: translateY(-2px);
}

.social-icon svg {
  width: 18px;
  height: 18px;
}

.footer-bottom {
  padding-top: 32px;
  border-top: 1px solid rgba(245, 241, 234, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 13px;
  color: rgba(245, 241, 234, 0.4);
}

.footer-legal {
  display: flex;
  gap: 24px;
}

/* ============================================
   響應式
   ============================================ */

@media (max-width: 1024px) {
  .section { padding: 80px 0; }
  .hero-inner { grid-template-columns: 1fr; gap: 60px; }
  .hero-visual { height: 480px; max-width: 500px; margin: 0 auto; }
  .books-grid,
  .category-content.active { grid-template-columns: repeat(3, 1fr); }
  .news-grid { grid-template-columns: repeat(2, 1fr); }
  .about-grid { grid-template-columns: 1fr; gap: 48px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 40px; }
}

@media (max-width: 768px) {
  .container { padding: 0 24px; }
  .section { padding: 72px 0; }
  .section-header { margin-bottom: 48px; }

  .nav-menu { display: none; }
  .nav-toggle { display: flex; }
  .nav-inner { padding: 16px 24px; }
  .nav-cta .btn { display: none; }

  .hero { padding: 120px 0 60px; }
  .hero-inner { padding: 0 24px; }
  .hero-visual { height: 420px; }
  .hero-book-1 { width: 200px; height: 280px; }
  .hero-book-2 { width: 180px; height: 260px; }
  .hero-book-3 { width: 160px; height: 240px; }

  .hero-stats { grid-template-columns: 1fr; gap: 24px; margin-top: 60px; }
  .stat-num { font-size: 40px; }

  .books-grid,
  .category-content.active { grid-template-columns: repeat(2, 1fr); gap: 24px; }
  .news-grid { grid-template-columns: 1fr; }

  .newsletter-form { flex-direction: column; }

  .footer-grid { grid-template-columns: 1fr; gap: 40px; }
  .footer-bottom { flex-direction: column; text-align: center; }
}

@media (max-width: 480px) {
  .books-grid,
  .category-content.active { grid-template-columns: 1fr; }
  .book-cover { max-width: 280px; margin-left: auto; margin-right: auto; }
  .hero-title { font-size: 44px; }
}
