:root{
  --bg:#f2f4f7;
  --card:#ffffff;
  --muted:#6b7280;
  --accent:#1e90ff;
  --accent-2:#1667b8;
  --shadow: 0 6px 18px rgba(20,25,32,0.08);
  --max-width:980px;
  --radius:12px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  background:linear-gradient(180deg,var(--bg), #eef2f7);
  color:#111827;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  line-height:1.5;
}

.site-header{position:sticky; top:0; z-index:30; backdrop-filter: blur(6px); background: rgba(255,255,255,0.6); border-bottom:1px solid rgba(16,24,40,0.04);}

.topbar{
  max-width:var(--max-width);
  margin:0 auto;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:10px 16px;
}

.nav-left, .nav-right { display:flex; align-items:center; gap:12px; }
.brand { text-align:center; flex:1; }
.brand-link{
  font-weight:700;
  font-size:1.1rem;
  color:var(--accent-2);
  text-decoration:none;
  letter-spacing:0.6px;
  display:inline-block;
  padding:6px 8px;
}

.sub-menu{list-style:none; margin:0; padding:0; display:flex; gap:8px; align-items:center;}
.sub-menu a{ text-decoration:none; color:var(--muted); padding:6px 8px; border-radius:8px; font-size:0.95rem;}
.sub-menu a:hover, .sub-menu a:focus{ color:var(--accent); background:rgba(30,144,255,0.06); outline:none; }

.search input{
  border:1px solid rgba(16,24,40,0.06);
  padding:8px 10px;
  border-radius:10px;
  min-width:180px;
  background:transparent;
}

.container{
  max-width:var(--max-width);
  margin:28px auto;
  padding:0 16px 48px;
}

.grid{
  display:grid;
  grid-template-columns: repeat(auto-fit,minmax(260px,1fr));
  gap:18px;
}

.card{
  background:var(--card);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:16px;
  display:flex;
  flex-direction:column;
  gap:10px;
  transition:transform .18s ease, box-shadow .18s ease;
}
.card:hover{ transform:translateY(-6px); box-shadow:0 12px 28px rgba(16,24,40,0.08); }

.post-meta{ font-size:0.85rem; color:var(--muted); }
.post-title{ font-size:1.05rem; font-weight:700; color:#0f1724; margin:0; }
.excerpt{ color:#334155; font-size:0.95rem; margin:0; }

.btn{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:8px 12px;
  border-radius:10px;
  text-decoration:none;
  background:linear-gradient(180deg,var(--accent),var(--accent-2));
  color:white;
  border:none;
  cursor:pointer;
  font-weight:600;
}

.post-article{
  background:var(--card);
  padding:22px;
  border-radius:var(--radius);
  box-shadow:var(--shadow);
}
.post-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}
.post-title-big{ font-size:1.5rem; margin:0; color:#05203a; }
.post-date{ color:var(--muted); font-size:0.9rem; }

.controls{ display:flex; gap:8px; align-items:center; }

.site-footer{ text-align:center; padding:28px 16px; color:var(--muted); font-size:0.9rem; }

@media (max-width:720px){
  .brand-link{ font-size:1rem; }
  .nav-left{ gap:6px }
  .sub-menu{ display:none }
  #menuToggle{ display:inline-block; }
}
.hamburger{ background:transparent; border:none; font-size:18px; cursor:pointer; padding:6px; color:var(--muted) }


.emoji-pop {
  position: fixed;
  pointer-events: none;
  font-size: 22px;
  z-index: 9999;
  transform: translate(-50%, -50%);
  animation: emoji-pop 900ms cubic-bezier(.2,.9,.2,1) forwards;
  will-change: transform, opacity;
}

@keyframes emoji-pop {
  0% { transform: translate(-50%, -50%) translateY(0) rotate(var(--rot, 0deg)); opacity: 1; }
  100% { transform: translate(-50%, -50%) translateY(-48px) rotate(var(--rot, 0deg)) scale(1.15); opacity: 0; }
}

.theme-icon {
    font-size: 1.2rem;
    margin: 0 5px;
    cursor: pointer;
}

.policy-container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.back-button {
    display: inline-block;
    padding: 0.5rem 1rem;
    margin-bottom: 2rem;
    text-decoration: none;
    color: #333;
    border: 1px solid #333;
    border-radius: 4px;
}

.back-button:hover {
    background: #eee;
}

.policy-content {
    line-height: 1.6;
}

body.dark-theme {
  --bg: #121212;
  --card: #1e1e1e;
  --muted: #9ca3af;
  --accent: #3b82f6;
  --accent-2: #2563eb;
  --shadow: 0 6px 18px rgba(0,0,0,0.5);
  color: #e5e7eb;
  background: linear-gradient(180deg, var(--bg), #1f2937);
}

body.dark-theme .post-title,
body.dark-theme .post-title-big {
  color: #f3f4f6;
}

body.dark-theme .excerpt,
body.dark-theme .post-content {
  color: #d1d5db;
}

body.dark-theme .post-meta,
body.dark-theme .post-date {
  color: #9ca3af;
}

body.dark-theme .site-header {
  background: rgba(31,41,55,0.6);
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

body.dark-theme .brand-link {
  color: #60a5fa;
}

body.dark-theme .sub-menu a {
  color: #9ca3af;
}

body.dark-theme .sub-menu a:hover,
body.dark-theme .sub-menu a:focus {
  color: #bfdbfe;
  background: rgba(59,130,246,0.1);
}

body.dark-theme .search input {
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(31,41,55,0.4);
  color: #e5e7eb;
}

body.dark-theme .btn {
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  color: #ffffff;
}

body.dark-theme .site-footer {
  color: #9ca3af;
}

body.dark-theme .hamburger {
  color: #9ca3af;
}

body.dark-theme .comment {
  color: #d1d5db;
}

body.dark-theme .comment small {
  color: #9ca3af;
}

body.dark-theme textarea,
body.dark-theme input {
  background: #2a2a2a;
  color: #e5e7eb;
  border: 1px solid #4b5563;
}

.theme-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
}

.theme-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .4s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: #2196F3;
}

input:checked + .slider:before {
  transform: translateX(26px);
}

.theme-switch-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
}