@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --primary: #34317D;
  --primary-light: #6D40C4;
  --accent: #6D40C4;
  --accent-hover: #5a35a3;
  --accent-soft: #9778D2;
  --highlight: #FFD572;
  --text: #292929;
  --text-light: #444553;
  --text-muted: #6b7280;
  --bg: #ffffff;
  --bg-alt: #F5F1FB;
  --bg-card: #ffffff;
  --border: #e2ddf0;
  --shadow: 0 1px 3px rgba(52,49,125,0.06);
  --shadow-lg: 0 4px 16px rgba(52,49,125,0.10);
  --radius: 8px;
  --max-width: 1200px;
  --font-display: 'Montserrat', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
}

a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent-hover); text-decoration: underline; }

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

header {
  background: linear-gradient(135deg, #1a1a4e 0%, var(--primary) 50%, var(--primary-light) 100%);
  color: #fff;
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(52,49,125,0.25);
}

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

.logo {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
  color: #fff;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.02em;
}

.logo:hover { color: #fff; text-decoration: none; }
.logo .accent { color: var(--highlight); }

nav { display: flex; gap: 4px; flex-wrap: wrap; }

nav a {
  color: rgba(255,255,255,0.85);
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
}

nav a:hover, nav a.active {
  background: rgba(255,255,255,0.15);
  color: #fff;
  text-decoration: none;
}

.breadcrumbs {
  padding: 12px 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}

.breadcrumbs a { color: var(--text-light); }
.breadcrumbs span { margin: 0 6px; }

.hero {
  background: linear-gradient(135deg, #1a1a4e 0%, var(--primary) 40%, var(--primary-light) 100%);
  color: #fff;
  padding: 48px 0;
  margin-bottom: 32px;
}

.hero h1 { font-family: var(--font-display); font-size: 2.2rem; font-weight: 800; margin-bottom: 12px; letter-spacing: -0.01em; }
.hero p { font-size: 1.1rem; opacity: 0.9; max-width: 600px; }

.section { margin-bottom: 40px; }
.section-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 3px solid var(--accent);
  display: inline-block;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s, transform 0.2s;
}

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

.card h3 { font-family: var(--font-display); font-size: 1.1rem; font-weight: 700; margin-bottom: 8px; }
.card h3 a { color: var(--text); }
.card h3 a:hover { color: var(--accent); text-decoration: none; }
.card p { color: var(--text-light); font-size: 0.95rem; }

.card .meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--accent);
  color: #fff;
}

.badge-outline {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
}

.tag-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.tag {
  display: inline-block;
  padding: 4px 12px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 16px;
  font-size: 0.8rem;
  color: var(--text-light);
  transition: all 0.2s;
}
.tag:hover { background: var(--accent); color: #fff; border-color: var(--accent); text-decoration: none; }

.topic-page { max-width: 900px; margin: 0 auto; }

.topic-page h1 {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.topic-page .summary {
  font-size: 1.1rem;
  color: var(--text-light);
  margin-bottom: 24px;
  padding: 16px;
  background: var(--bg-alt);
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.content-block {
  margin-bottom: 32px;
  padding: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.content-block h2 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--primary);
}

.content-block ol, .content-block ul {
  padding-left: 20px;
}

.content-block li {
  margin-bottom: 8px;
  line-height: 1.6;
}

.prompt-box {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  position: relative;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 0.88rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 4px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 600;
  transition: background 0.2s;
}

.copy-btn:hover { background: var(--accent-hover); }

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

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

.faq-item h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--primary);
}

.faq-item p { color: var(--text-light); font-size: 0.95rem; }

.hashtag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hashtag {
  display: inline-block;
  padding: 6px 16px;
  background: var(--primary);
  color: #fff;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
}

.tweet-card {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  position: relative;
}

.tweet-card .copy-btn { top: 8px; right: 8px; }

.sidebar {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

.sidebar-widget {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.sidebar-widget h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--primary);
}

.sidebar-widget ul { list-style: none; padding: 0; }
.sidebar-widget li { margin-bottom: 8px; }
.sidebar-widget li a { color: var(--text); font-size: 0.9rem; }
.sidebar-widget li a:hover { color: var(--accent); }

.two-col {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 32px;
}

@media (max-width: 900px) {
  .two-col { grid-template-columns: 1fr; }
  .grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 1.6rem; }
  .header-inner { flex-direction: column; gap: 10px; }
}

footer {
  background: linear-gradient(135deg, #1a1a4e 0%, var(--primary) 100%);
  color: rgba(255,255,255,0.7);
  padding: 40px 0;
  margin-top: 60px;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 32px;
}

.footer-inner h4 { font-family: var(--font-display); color: #fff; margin-bottom: 12px; font-size: 1rem; }
.footer-inner ul { list-style: none; padding: 0; }
.footer-inner li { margin-bottom: 6px; }
.footer-inner a { color: rgba(255,255,255,0.7); font-size: 0.9rem; }
.footer-inner a:hover { color: var(--highlight); }

.footer-bottom {
  max-width: var(--max-width);
  margin: 24px auto 0;
  padding: 16px 20px 0;
  border-top: 1px solid rgba(255,255,255,0.15);
  text-align: center;
  font-size: 0.85rem;
}

.admin-page { max-width: 1000px; margin: 0 auto; padding: 24px 20px; }

.admin-page h1 { font-family: var(--font-display); font-size: 1.6rem; margin-bottom: 24px; }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 4px; font-size: 0.9rem; }
.form-group input, .form-group textarea, .form-group select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-family: inherit;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(109,64,196,0.12);
}
.form-group textarea { min-height: 120px; resize: vertical; }

.btn {
  display: inline-block;
  padding: 10px 24px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn:hover { background: var(--accent-hover); color: #fff; text-decoration: none; box-shadow: 0 2px 8px rgba(109,64,196,0.25); }

.btn-secondary { background: var(--primary); }
.btn-secondary:hover { background: #2a2866; }

.btn-success { background: #10b981; }
.btn-success:hover { background: #059669; }

.btn-sm { padding: 6px 14px; font-size: 0.85rem; }

.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-size: 0.9rem;
}

.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-error { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.alert-info { background: var(--bg-alt); color: var(--primary); border: 1px solid var(--border); }

table { width: 100%; border-collapse: collapse; }
table th, table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); }
table th { font-family: var(--font-display); font-weight: 600; background: var(--bg-alt); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--primary); }
table td { font-size: 0.9rem; }
table tr:hover { background: var(--bg-alt); }

.status-draft { color: var(--text-muted); }
.status-published { color: #10b981; font-weight: 600; }

.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }
