:root {
  --bg: #f7f8fb;
  --surface: #ffffff;
  --surface-2: #eef1f6;
  --text: #1c2333;
  --muted: #5b6472;
  --accent: #6c5ce7;
  --accent-2: #0e9f7e;
  --border: #e3e7ee;
  --radius: 14px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { font-size: 1.4rem; font-weight: 800; letter-spacing: -0.5px; }
.logo span { color: var(--accent-2); }
.nav { display: flex; gap: 22px; font-size: 0.95rem; }
.nav a { color: var(--muted); transition: color 0.2s; }
.nav a:hover { color: var(--text); }

/* Hero */
.hero {
  position: relative; overflow: hidden; padding: 90px 0 70px;
  background:
    radial-gradient(800px 400px at 20% 0%, rgba(108, 92, 231, 0.12), transparent),
    radial-gradient(700px 350px at 90% 20%, rgba(14, 159, 126, 0.1), transparent);
}
.hero .container { max-width: 780px; text-align: center; }
.hero-badge {
  display: inline-block; background: var(--surface); color: var(--accent-2);
  border: 1px solid var(--border); border-radius: 999px;
  padding: 6px 16px; font-size: 0.85rem; margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(28, 35, 51, 0.06);
}
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); line-height: 1.15; font-weight: 800; letter-spacing: -1px; }
.hero h1 em { font-style: normal; background: linear-gradient(90deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { color: var(--muted); margin: 20px auto 30px; max-width: 560px; font-size: 1.1rem; }
.btn { display: inline-block; padding: 12px 26px; border-radius: 10px; font-weight: 600; transition: transform 0.15s; }
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: linear-gradient(90deg, var(--accent), #8f7bff); color: #fff; }
.btn-ghost { border: 1px solid var(--border); background: var(--surface); color: var(--text); margin-left: 12px; }

/* Gallery */
.gallery-section { padding: 40px 0 20px; }
.gallery-scroll { display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; padding-bottom: 12px; }
.gallery-scroll::-webkit-scrollbar { height: 6px; }
.gallery-scroll::-webkit-scrollbar-track { background: var(--surface-2); border-radius: 3px; }
.gallery-scroll::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 3px; }
.gallery-card { flex: 0 0 280px; scroll-snap-align: start; position: relative; border-radius: var(--radius); overflow: hidden; height: 200px; border: 1px solid var(--border); box-shadow: 0 2px 8px rgba(28, 35, 51, 0.08); transition: transform 0.25s, box-shadow 0.25s; }
.gallery-card:hover { transform: translateY(-4px); box-shadow: 0 10px 24px rgba(28, 35, 51, 0.15); }
.gallery-card img { width: 100%; height: 100%; object-fit: cover; }
.gallery-overlay { position: absolute; bottom: 0; left: 0; right: 0; padding: 16px; background: linear-gradient(transparent, rgba(0, 0, 0, 0.8)); display: flex; flex-direction: column; gap: 4px; }
.gallery-overlay h3 { color: #fff; font-size: 0.95rem; line-height: 1.3; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.gallery-date { color: var(--accent-2); font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; }

/* Sections */
.section { padding: 60px 0; }
.section-title { font-size: 1.7rem; font-weight: 700; margin-bottom: 26px; letter-spacing: -0.5px; }
.section-title small { color: var(--accent-2); display: block; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 2px; margin-bottom: 6px; }

/* Trending chips */
.trend-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.trend-card { position: relative; border-radius: var(--radius); overflow: hidden; height: 150px; display: flex; align-items: flex-end; border: 1px solid var(--border); box-shadow: 0 2px 8px rgba(28, 35, 51, 0.08); }
.trend-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.85; transition: opacity 0.3s, transform 0.3s; }
.trend-card:hover img { opacity: 1; transform: scale(1.05); }
.trend-card span { position: relative; padding: 14px 16px; font-weight: 700; font-size: 1.05rem; color: #fff; background: linear-gradient(transparent, rgba(0, 0, 0, 0.75)); width: 100%; }

/* Article cards */
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 24px; }
.post-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; transition: transform 0.2s, box-shadow 0.2s; display: flex; flex-direction: column; box-shadow: 0 2px 8px rgba(28, 35, 51, 0.06); }
.post-card:hover { transform: translateY(-4px); box-shadow: 0 10px 24px rgba(28, 35, 51, 0.12); }
.post-card img { height: 190px; width: 100%; object-fit: cover; }
.post-card-body { padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.post-meta { font-size: 0.8rem; color: var(--muted); }
.tag { display: inline-block; background: var(--surface-2); color: var(--accent); font-size: 0.72rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; margin-right: 6px; }
.post-card h3 { font-size: 1.15rem; line-height: 1.35; }
.post-card h3 a:hover { color: var(--accent); }
.post-card p.desc { color: var(--muted); font-size: 0.92rem; flex: 1; }
.read-more { color: var(--accent-2); font-weight: 600; font-size: 0.9rem; }

/* Post page */
.post-hero {
  max-width: 800px; margin: 40px auto 30px; padding: 0 20px;
  display: flex; flex-direction: column; align-items: center; text-align: center;
}
.post-hero h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin: 24px 0 12px; letter-spacing: -0.5px; line-height: 1.2; }
.article-content { max-width: 800px; margin: 0 auto 40px; padding: 30px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 2px 10px rgba(28, 35, 51, 0.05); }
.article-content h2 { margin: 34px 0 12px; font-size: 1.5rem; border-left: 4px solid var(--accent); padding-left: 12px; }
.article-content h3 { margin: 26px 0 10px; font-size: 1.2rem; color: var(--accent); }
.article-content p { margin: 14px 0; color: #3a4252; }
.article-content ul, .article-content ol { margin: 14px 0 14px 24px; color: #3a4252; }
.article-content li { margin: 6px 0; }
.article-content blockquote { border-left: 4px solid var(--accent-2); background: var(--surface-2); padding: 14px 18px; margin: 18px 0; border-radius: 0 10px 10px 0; color: var(--muted); }
.article-content code { background: var(--surface-2); padding: 2px 6px; border-radius: 5px; font-size: 0.9em; }
.article-content pre { background: #1e2430; border: 1px solid var(--border); color: #e8eaf0; padding: 16px; border-radius: 10px; overflow-x: auto; margin: 18px 0; }
.article-content pre code { background: none; padding: 0; }
.article-content a { color: var(--accent); text-decoration: underline; }
.article-content hr { border: none; border-top: 1px solid var(--border); margin: 30px 0; }
.article-content strong { color: var(--text); }

/* Admin */
.admin-body { background: var(--bg); }
.admin-wrap { max-width: 480px; margin: 80px auto; padding: 0 20px; }
.admin-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 34px; box-shadow: 0 4px 16px rgba(28, 35, 51, 0.08); }
.admin-card h1 { font-size: 1.5rem; margin-bottom: 8px; }
.admin-card .sub { color: var(--muted); font-size: 0.9rem; margin-bottom: 24px; }
.error-msg { background: #fdecec; color: #c0392b; padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; font-size: 0.9rem; }
.success-msg { background: #e6f7f0; color: #0b7a5e; padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; font-size: 0.9rem; }
.admin-panel { max-width: 860px; margin: 50px auto; padding: 0 20px; }
.admin-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 28px; }
.admin-top h1 { font-size: 1.6rem; }
.form-grid { display: grid; gap: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 30px; box-shadow: 0 4px 16px rgba(28, 35, 51, 0.08); }
.form-group { margin-bottom: 4px; }
.form-group label { font-size: 0.85rem; color: var(--muted); display: block; margin-bottom: 6px; font-weight: 600; }
.form-group input, .form-group textarea { width: 100%; background: var(--bg); border: 1px solid var(--border); color: var(--text); padding: 11px 14px; border-radius: 8px; font-size: 0.95rem; font-family: inherit; }
.form-group input:focus, .form-group textarea:focus { outline: none; border-color: var(--accent); }
.form-group textarea { min-height: 320px; font-family: Consolas, monospace; line-height: 1.6; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.check-row { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 0.95rem; }
.check-row input { width: auto; }
.post-row { display: flex; justify-content: space-between; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 14px 18px; margin-bottom: 10px; }
.post-row .danger { color: #c0392b; background: none; border: none; cursor: pointer; font-size: 0.9rem; }
.empty-state { text-align: center; color: var(--muted); padding: 60px 0; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); margin-top: 60px; padding: 26px 0; color: var(--muted); font-size: 0.9rem; background: var(--surface); }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.footer-nav { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-nav a { color: var(--muted); }
.footer-nav a:hover { color: var(--text); }
.site-footer a { text-decoration: underline; }

/* Responsive */
@media (max-width: 720px) {
  .header-inner { flex-direction: column; height: auto; padding: 12px 0; gap: 8px; }
  .nav { flex-wrap: wrap; justify-content: center; }
  .footer-inner { flex-direction: column; text-align: center; }
  .gallery-card { flex: 0 0 80vw; }
  .two-col { grid-template-columns: 1fr; }
  .post-grid { grid-template-columns: 1fr; }
  .admin-top { flex-direction: column; gap: 12px; align-items: flex-start; }
  .post-row { flex-direction: column; gap: 10px; align-items: flex-start; }
}
