/* === NovelCraft · Main Styles === */
@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;600;700;900&family=Noto+Sans+SC:wght@300;400;500;700&display=swap');

:root {
  --bg-primary: #0f1923;
  --bg-secondary: #151f2b;
  --bg-card: #1a2633;
  --bg-elevated: #1e2c3a;
  --gold: #c9a84c;
  --gold-dark: #a8883a;
  --gold-light: #e8d48b;
  --text-primary: #e8e0d4;
  --text-secondary: #a09888;
  --text-muted: #6a6258;
  --border: #2a3645;
  --shadow: 0 4px 20px rgba(0,0,0,0.3);
  --radius: 12px;
  --radius-sm: 8px;
  --transition: all 0.3s ease;
}

/* === Typography === */
h1, h2, h3, h4, h5 { font-family: 'Noto Serif SC', 'Songti SC', serif; font-weight: 700; line-height: 1.3; }
h1 { font-size: 2.8rem; font-weight: 900; }
h2 { font-size: 2rem; letter-spacing: 0.02em; }
h3 { font-size: 1.4rem; }
h4 { font-size: 1.15rem; }

/* === Layout === */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* === Header === */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  background: rgba(15,25,35,0.92); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 24px; height: 64px;
  display: flex; align-items: center; justify-content: space-between;
}
.site-header .logo { font-family: 'Noto Serif SC', serif; font-size: 1.4rem; color: var(--gold); font-weight: 900; letter-spacing: 2px; }
.site-header .logo span { color: var(--text-primary); }
.site-header nav { display: flex; gap: 8px; }
.site-header nav a { padding: 6px 14px; border-radius: 20px; font-size: 0.85rem; color: var(--text-secondary); transition: var(--transition); }
.site-header nav a:hover, .site-header nav a.active { color: var(--gold); background: rgba(201,168,76,0.1); }
.menu-toggle { display: none; flex-direction: column; gap: 5px; cursor: pointer; padding: 4px; background: none; border: none; }
.menu-toggle span { display: block; width: 24px; height: 2px; background: var(--text-primary); border-radius: 2px; transition: var(--transition); }

/* === Hero === */
.hero {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 100px 24px 60px;
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, #0f1923 0%, #1a2633 50%, #0f1923 100%);
}
.hero::before {
  content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%;
  background: radial-gradient(circle at 30% 40%, rgba(201,168,76,0.04) 0%, transparent 50%),
              radial-gradient(circle at 70% 60%, rgba(201,168,76,0.03) 0%, transparent 50%);
  animation: heroGlow 15s ease-in-out infinite alternate;
}
@keyframes heroGlow { 0% { transform: translate(0,0); } 100% { transform: translate(-5%,-5%) rotate(5deg); } }
.hero-content { position: relative; z-index: 1; max-width: 800px; }
.hero-badge {
  display: inline-block; padding: 6px 18px; border-radius: 20px;
  background: rgba(201,168,76,0.1); border: 1px solid rgba(201,168,76,0.2);
  color: var(--gold-light); font-size: 0.85rem; margin-bottom: 24px;
  font-family: 'Noto Serif SC', serif;
}
.hero h1 { margin-bottom: 20px; font-size: 3.2rem; }
.hero h1 span { color: var(--gold); }
.hero p { font-size: 1.1rem; color: var(--text-secondary); max-width: 600px; margin: 0 auto 40px; line-height: 1.8; }
.hero-cta {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 40px; border-radius: 40px;
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  color: #0f1923; font-weight: 700; font-size: 1.05rem;
  border: none; cursor: pointer; transition: var(--transition);
}
.hero-cta:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(201,168,76,0.3); color: #0f1923; }

/* === Modules Grid === */
.modules-section { padding: 80px 0; background: var(--bg-secondary); }
.section-header { text-align: center; margin-bottom: 60px; }
.section-header h2 { margin-bottom: 12px; }
.section-header h2::after {
  content: ''; display: block; width: 60px; height: 3px; background: var(--gold);
  margin: 16px auto 0; border-radius: 2px;
}
.section-header p { color: var(--text-secondary); font-size: 1rem; }
.modules-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.module-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 32px 28px; cursor: pointer; transition: var(--transition);
  position: relative; overflow: hidden;
}
.module-card:hover { transform: translateY(-4px); border-color: var(--gold-dark); box-shadow: var(--shadow); }
.module-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold), var(--gold-dark));
  opacity: 0; transition: var(--transition);
}
.module-card:hover::before { opacity: 1; }
.module-icon { width: 48px; height: 48px; border-radius: var(--radius-sm); background: rgba(201,168,76,0.1); display: flex; align-items: center; justify-content: center; margin-bottom: 18px; font-size: 1.5rem; }
.module-card h3 { margin-bottom: 10px; color: var(--text-primary); }
.module-card p { color: var(--text-secondary); font-size: 0.9rem; line-height: 1.6; }
.module-tag {
  display: inline-block; padding: 3px 10px; border-radius: 12px;
  background: rgba(201,168,76,0.08); color: var(--gold-light);
  font-size: 0.75rem; margin-top: 14px;
}

/* === Module Detail Panel === */
.module-panel {
  display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  z-index: 2000; background: rgba(15,25,35,0.95); backdrop-filter: blur(8px);
  overflow-y: auto; padding: 80px 24px 60px;
  animation: panelIn 0.4s ease;
}
.module-panel.active { display: block; }
@keyframes panelIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.panel-header {
  max-width: 900px; margin: 0 auto 40px;
  display: flex; align-items: center; justify-content: space-between;
}
.panel-header h2 { font-size: 1.8rem; }
.panel-header h2 small { display: block; font-size: 0.9rem; color: var(--text-secondary); font-family: 'Noto Sans SC', sans-serif; font-weight: 400; margin-top: 4px; }
.panel-close {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border);
  background: transparent; color: var(--text-secondary); font-size: 1.4rem;
  cursor: pointer; transition: var(--transition); display: flex; align-items: center; justify-content: center;
}
.panel-close:hover { background: var(--bg-elevated); color: var(--gold); border-color: var(--gold-dark); }
.panel-content { max-width: 900px; margin: 0 auto; }

/* === Module Inner Components === */
.module-intro { margin-bottom: 40px; padding: 24px; background: var(--bg-card); border-radius: var(--radius); border-left: 3px solid var(--gold); }
.module-intro p { color: var(--text-secondary); line-height: 1.8; }

.tool-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 40px; }
.tool-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 24px; transition: var(--transition);
}
.tool-card:hover { border-color: var(--gold-dark); }
.tool-card h4 { margin-bottom: 8px; font-size: 1.05rem; }
.tool-card h4 .emoji { margin-right: 8px; }
.tool-card p { color: var(--text-secondary); font-size: 0.88rem; line-height: 1.6; }

.tool-list { margin-bottom: 40px; }
.tool-list-item {
  display: flex; gap: 16px; padding: 16px 20px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm);
  margin-bottom: 12px; transition: var(--transition); cursor: pointer;
}
.tool-list-item:hover { border-color: var(--gold-dark); }
.tool-list-item .num { width: 32px; height: 32px; border-radius: 50%; background: rgba(201,168,76,0.15); color: var(--gold); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.85rem; flex-shrink: 0; }
.tool-list-item .content { flex: 1; }
.tool-list-item .content h4 { font-size: 1rem; margin-bottom: 4px; }
.tool-list-item .content p { color: var(--text-secondary); font-size: 0.85rem; line-height: 1.5; }

.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 6px; color: var(--text-secondary); font-size: 0.9rem; }
.form-group input, .form-group textarea, .form-group select {
  width: 100%; padding: 12px 16px; border-radius: var(--radius-sm);
  background: var(--bg-card); border: 1px solid var(--border); color: var(--text-primary);
  font-size: 0.95rem; font-family: inherit; transition: var(--transition);
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,168,76,0.1); }
.form-group textarea { min-height: 100px; resize: vertical; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 24px; border-radius: 20px; border: none;
  font-size: 0.9rem; font-weight: 500; cursor: pointer; transition: var(--transition); font-family: inherit;
}
.btn-gold { background: linear-gradient(135deg, var(--gold-dark), var(--gold)); color: #0f1923; }
.btn-gold:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(201,168,76,0.25); }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text-primary); }
.btn-outline:hover { border-color: var(--gold-dark); color: var(--gold); }
.btn-sm { padding: 6px 16px; font-size: 0.82rem; }

.result-box {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 20px; margin-top: 16px; min-height: 60px;
  color: var(--text-primary); line-height: 1.7; white-space: pre-wrap;
}
.result-box .placeholder { color: var(--text-muted); font-style: italic; }

/* === Footer === */
.site-footer {
  padding: 40px 24px; text-align: center;
  border-top: 1px solid var(--border); background: var(--bg-primary);
}
.site-footer p { color: var(--text-muted); font-size: 0.85rem; }
.site-footer .footer-brand { color: var(--gold); font-family: 'Noto Serif SC', serif; font-weight: 700; }

/* === Responsive === */
@media (max-width: 1024px) {
  .modules-grid { grid-template-columns: repeat(2, 1fr); }
  h1 { font-size: 2.2rem; }
  .hero h1 { font-size: 2.6rem; }
}

@media (max-width: 768px) {
  .site-header nav { display: none; }
  .site-header nav.open { display: flex; flex-direction: column; position: absolute; top: 64px; left: 0; right: 0; background: var(--bg-primary); border-bottom: 1px solid var(--border); padding: 16px; gap: 4px; }
  .menu-toggle { display: flex; }
  .hero { padding: 80px 20px 40px; }
  .hero h1 { font-size: 2rem; }
  .hero p { font-size: 0.95rem; }
  .modules-grid { grid-template-columns: 1fr; gap: 16px; }
  .tool-grid { grid-template-columns: 1fr; }
  .panel-header { flex-direction: column; align-items: flex-start; gap: 12px; }
  .panel-header h2 { font-size: 1.4rem; }
  h2 { font-size: 1.6rem; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 1.7rem; }
  .module-card { padding: 24px 20px; }
  .tool-card { padding: 18px; }
}

/* === Ink Splatter Decor === */
.ink-deco {
  position: absolute; pointer-events: none; opacity: 0.03;
  font-family: 'Noto Serif SC', serif; font-size: 12rem; color: var(--gold);
  line-height: 1; user-select: none;
}
.ink-deco-1 { top: 10%; right: -5%; transform: rotate(15deg); }
.ink-deco-2 { bottom: 5%; left: -8%; transform: rotate(-10deg); font-size: 8rem; }

/* === Scrollbar for panel === */
.module-panel::-webkit-scrollbar { width: 4px; }
.module-panel::-webkit-scrollbar-thumb { background: var(--gold-dark); border-radius: 2px; }

/* === utility === */
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }
.text-gold { color: var(--gold); }
.text-center { text-align: center; }
.flex-between { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
