/* فونت‌ها از خود سایت بارگذاری می‌شوند (بدون Google Fonts)؛ وزیرمتن متغیر، مجوز OFL در static/fonts/OFL.txt */
@font-face { font-family: "Vazirmatn"; src: url("/static/fonts/Vazirmatn.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
/* نام‌های فونتِ منوی ویرایشگر مقاله: اگر روی دستگاه کاربر نصب نبود، به معادل‌های سیستمی برمی‌گردند */
@font-face { font-family: "Noto Naskh Arabic"; src: local("Noto Naskh Arabic"), local("Traditional Arabic"), local("Times New Roman"), local("Tahoma"); font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: local("JetBrains Mono"), local("Consolas"), local("Menlo"), local("DejaVu Sans Mono"), local("Courier New"); font-display: swap; }
/* =====================================================================
   CYBERX Blog — تم اصلی
   ساختار: متغیرها → پایه → چیدمان → کامپوننت‌ها → صفحات → محتوای مقاله → ریسپانسیو
   ===================================================================== */

:root {
  --font-body: "Vazirmatn", "Tahoma", "DejaVu Sans", sans-serif;
  --font-display: "Vazirmatn", "Tahoma", sans-serif;
  --font-mono: "JetBrains Mono", "Consolas", "DejaVu Sans Mono", monospace;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 10px 30px -12px rgba(0, 0, 0, .55);
  --maxw: 1180px;
  --header-h: 66px;
}

[data-theme="dark"] {
  --bg: #070b12;
  --bg-2: #0a1019;
  --surface: #0e1623;
  --surface-2: #131e2f;
  --line: #1d2b40;
  --line-2: #2a3d58;
  --text: #dce7f4;
  --text-dim: #aebdd0;
  --muted: #7d8fa8;
  --accent: #2cffb0;
  --accent-ink: #04130d;
  --accent-2: #38bdf8;
  --accent-3: #a78bfa;
  --danger: #ff5d7a;
  --warn: #fbbf24;
  --ok: #34d399;
  --glow: 0 0 0 1px rgba(44, 255, 176, .35), 0 8px 30px -8px rgba(44, 255, 176, .35);
  --grid: rgba(56, 189, 248, .045);
  --rain-opacity: .5;
  color-scheme: dark;
}

/* ---------- پایه ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background:
    radial-gradient(900px 480px at 85% -8%, rgba(56, 189, 248, .10), transparent 65%),
    radial-gradient(700px 420px at 8% 4%, rgba(44, 255, 176, .08), transparent 60%),
    linear-gradient(var(--grid) 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(90deg, var(--grid) 1px, transparent 1px) 0 0 / 44px 44px,
    var(--bg);
  background-attachment: fixed;
  color: var(--text); font-family: var(--font-body); font-size: 16px; line-height: 1.85;
}
#bg-rain { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; opacity: var(--rain-opacity);
  -webkit-mask-image: linear-gradient(to bottom, #000 0, transparent 70%); mask-image: linear-gradient(to bottom, #000 0, transparent 70%); }
#site-header, #app, #site-footer { position: relative; z-index: 1; }
#app { flex: 1; width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 28px 20px 70px; outline: none; }
#app.fade { animation: pageIn .35s ease both; }
@keyframes pageIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

a { color: var(--accent-2); text-decoration: none; }
a:hover { color: var(--accent); }
img { max-width: 100%; }
h1, h2, h3, h4 { line-height: 1.5; margin: 0 0 .5em; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mono { font-family: var(--font-mono); direction: ltr; unicode-bidi: embed; }
.muted { color: var(--muted); }
.dim { color: var(--text-dim); }
.center { text-align: center; }
.hidden { display: none !important; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spacer { flex: 1; }
.ic { width: 1.15em; height: 1.15em; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; vertical-align: -.2em; }
.scroll-x { overflow-x: auto; }

#progress { position: fixed; top: 0; right: 0; height: 3px; width: 0; z-index: 100; background: linear-gradient(90deg, var(--accent), var(--accent-2)); box-shadow: 0 0 12px var(--accent); transition: width .1s linear; }

/* ---------- دکمه‌ها ---------- */
.btn {
  --b: var(--line-2);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 18px; border-radius: 10px; border: 1px solid var(--b); background: var(--surface-2);
  color: var(--text); cursor: pointer; font-weight: 500; font-size: .95rem; line-height: 1.6;
  transition: transform .15s, border-color .15s, background .15s, box-shadow .2s;
}
.btn:hover { border-color: var(--accent); color: var(--text); transform: translateY(-1px); }
.btn:active { transform: none; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: var(--accent-ink); border-color: transparent; font-weight: 700; }
.btn-primary:hover { color: var(--accent-ink); box-shadow: var(--glow); }
.btn-ghost { background: transparent; }
.btn-danger { --b: color-mix(in srgb, var(--danger) 50%, transparent); color: var(--danger); background: transparent; }
.btn-danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-sm { padding: 5px 12px; font-size: .85rem; border-radius: 8px; }
.btn-icon { padding: 8px; width: 40px; height: 40px; }
.btn-block { width: 100%; }

/* ---------- فرم‌ها ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field > label, .label { font-size: .88rem; color: var(--text-dim); font-weight: 500; }
.field small { color: var(--muted); font-size: .8rem; }
.input, select.input, textarea.input {
  width: 100%; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 14px;
  transition: border-color .15s, box-shadow .15s; line-height: 1.7;
}
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
textarea.input { resize: vertical; min-height: 110px; }
.input.ltr, .ltr { direction: ltr; text-align: left; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.form-error { background: color-mix(in srgb, var(--danger) 14%, transparent); border: 1px solid color-mix(in srgb, var(--danger) 45%, transparent);
  color: var(--danger); padding: 10px 14px; border-radius: 10px; margin-bottom: 14px; font-size: .92rem; }
.form-ok { background: color-mix(in srgb, var(--ok) 14%, transparent); border: 1px solid color-mix(in srgb, var(--ok) 45%, transparent); color: var(--ok); padding: 10px 14px; border-radius: 10px; margin-bottom: 14px; font-size: .92rem; }

/* ---------- کارت و چیپ ---------- */
.card { background: color-mix(in srgb, var(--surface) 92%, transparent); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; backdrop-filter: blur(6px); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 12px; border-radius: 999px; font-size: .78rem; border: 1px solid var(--line-2); color: var(--text-dim); background: var(--surface-2); line-height: 1.9; white-space: nowrap; }
a.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.on { border-color: var(--accent); color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 0 10px; border-radius: 6px; font-size: .72rem; font-weight: 700; line-height: 1.9; letter-spacing: .2px; }
.badge-admin { background: color-mix(in srgb, var(--danger) 16%, transparent); color: var(--danger); border: 1px solid color-mix(in srgb, var(--danger) 45%, transparent); }
.badge-author { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); }
.badge-user { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line-2); }
.badge-draft { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); border: 1px solid color-mix(in srgb, var(--warn) 40%, transparent); }
.badge-pub { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); border: 1px solid color-mix(in srgb, var(--ok) 40%, transparent); }
.badge-off { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); border: 1px solid color-mix(in srgb, var(--danger) 40%, transparent); }

.avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: none; display: inline-grid; place-items: center;
  font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--accent-3), var(--accent-2)); border: 2px solid var(--line-2); font-size: .95em; overflow: hidden; }
.avatar.sm { width: 30px; height: 30px; font-size: .75rem; }
.avatar.lg { width: 96px; height: 96px; font-size: 2rem; border-width: 3px; }
.avatar.xl { width: 120px; height: 120px; font-size: 2.4rem; border-width: 3px; }

/* ---------- هدر ---------- */
#site-header { position: sticky; top: 0; z-index: 50; backdrop-filter: blur(14px) saturate(1.4);
  background: color-mix(in srgb, var(--bg) 78%, transparent); border-bottom: 1px solid var(--line); }
.hdr { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; height: var(--header-h); display: flex; align-items: center; gap: 22px; }
.brand { font-weight: 800; display: flex; align-items: center; gap: 10px; color: var(--text); font-family: var(--font-display); font-size: 1.75rem; letter-spacing: .5px; line-height: 1; }
.brand:hover { color: var(--text); }
.brand .wm { width: auto; height: 46px; max-width: 100%; filter: drop-shadow(0 0 10px rgba(56, 189, 248, .35)); }
.brand b { background: linear-gradient(90deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: 400; direction: ltr; font-family: "Orbitron", var(--font-display); font-size: 1.35rem; }
.nav { display: flex; gap: 4px; }
.nav a { color: var(--text-dim); padding: 6px 12px; border-radius: 8px; font-size: .95rem; position: relative; }
.nav a:hover { color: var(--text); background: var(--surface-2); }
.nav a.active { color: var(--accent); }
.nav a.active::after { content: ""; position: absolute; inset-inline: 12px; bottom: -1px; height: 2px; background: var(--accent); border-radius: 2px; box-shadow: 0 0 10px var(--accent); }
.hdr-search { position: relative; flex: 1; max-width: 340px; margin-inline-start: auto; }
.hdr-search input { width: 100%; background: var(--surface); border: 1px solid var(--line-2); border-radius: 999px; padding: 7px 40px 7px 16px; font-size: .92rem; }
.hdr-search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.hdr-search > .ic { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.suggest { position: absolute; top: calc(100% + 8px); inset-inline: 0; min-width: 320px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; z-index: 60; }
.suggest a { display: block; padding: 8px 12px; border-radius: 8px; color: var(--text); font-size: .9rem; line-height: 1.6; }
.suggest a:hover, .suggest a.sel { background: var(--surface-2); }
.suggest small { color: var(--muted); display: block; }
.suggest .none { padding: 10px 12px; color: var(--muted); font-size: .88rem; }
mark.hl { background: color-mix(in srgb, var(--accent) 28%, transparent); color: inherit; border-radius: 3px; padding: 0 2px; }
.hdr-actions { display: flex; align-items: center; gap: 8px; }
.burger { display: none; }

.usermenu { position: relative; }
.usermenu > button { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 999px; padding: 3px 12px 3px 4px; cursor: pointer; }
.usermenu > button:hover { border-color: var(--accent); }
.usermenu .name { font-size: .88rem; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dropdown { position: absolute; top: calc(100% + 8px); inset-inline-start: 0; min-width: 220px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; z-index: 70; }
.dropdown a, .dropdown button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 12px; border-radius: 8px; color: var(--text); background: none; border: 0; cursor: pointer; text-align: start; font-size: .92rem; }
.dropdown a:hover, .dropdown button:hover { background: var(--surface-2); color: var(--accent); }
.dropdown hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
.dropdown .who { padding: 8px 12px 4px; font-size: .8rem; color: var(--muted); }

/* ---------- فوتر ---------- */
#site-footer { border-top: 1px solid var(--line); background: color-mix(in srgb, var(--bg-2) 80%, transparent); padding: 34px 20px 26px; }
.ftr { max-width: var(--maxw); margin: 0 auto; display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 30px; }
.ftr h4 { font-size: .95rem; color: var(--text); margin-bottom: 10px; }
.ftr a { display: block; color: var(--muted); font-size: .9rem; padding: 2px 0; }
.ftr a:hover { color: var(--accent); }
.ftr p { color: var(--muted); font-size: .9rem; margin: 8px 0 0; }
.ftr-bottom { max-width: var(--maxw); margin: 22px auto 0; padding-top: 16px; border-top: 1px dashed var(--line); color: var(--muted); font-size: .82rem; display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

/* ---------- Hero ---------- */
.hero { position: relative; display: grid; grid-template-columns: 1.15fr 1fr; gap: 34px; align-items: center; padding: 38px 8px 44px; }
.hero h1 { font-family: var(--font-display); font-size: clamp(2.2rem, 5vw, 3.6rem); font-weight: 800; line-height: 1.35; margin-bottom: 14px; }
.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.lead { color: var(--text-dim); font-size: 1.08rem; max-width: 560px; margin: 0 0 22px; }
.hero-search { display: flex; gap: 8px; max-width: 520px; }
.hero-search .input { border-radius: 999px; padding: 12px 20px; background: var(--surface); }
.terminal { background: #060a10; border: 1px solid var(--line-2); border-radius: 14px; box-shadow: var(--shadow), 0 0 60px -20px rgba(44, 255, 176, .35); overflow: hidden; direction: ltr; font-family: var(--font-mono); font-size: .85rem; }
.term-bar { display: flex; gap: 7px; padding: 10px 14px; background: #0c1320; border-bottom: 1px solid #1a2639; align-items: center; }
.term-bar i { width: 11px; height: 11px; border-radius: 50%; background: #ff5f57; }
.term-bar i:nth-child(2) { background: #febc2e; } .term-bar i:nth-child(3) { background: #28c840; }
.term-bar span { margin-left: 10px; color: #6b7f99; font-size: .75rem; }
.term-body { padding: 16px 18px; min-height: 230px; color: #c5d4e8; line-height: 1.9; white-space: pre-wrap; text-align: left; }
.term-body .p { color: #2cffb0; } .term-body .c { color: #38bdf8; } .term-body .w { color: #fbbf24; } .term-body .e { color: #ff5d7a; } .term-body .d { color: #6b7f99; }
.caret { display: inline-block; width: 8px; height: 1em; background: #2cffb0; vertical-align: -.15em; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.stats-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 38px; }
.stat { text-align: center; padding: 16px 10px; }
.stat b { display: block; font-family: var(--font-mono); font-size: 1.8rem; color: var(--accent); line-height: 1.3; }
.stat span { color: var(--muted); font-size: .85rem; }

/* ---------- سرتیتر بخش ---------- */
.section-title { display: flex; align-items: center; gap: 12px; margin: 38px 0 18px; font-size: 1.35rem; font-weight: 800; }
.section-title::before { content: ""; width: 5px; height: 26px; border-radius: 3px; background: linear-gradient(var(--accent), var(--accent-2)); box-shadow: 0 0 12px var(--accent); }
.section-title small { font-weight: 400; color: var(--muted); font-size: .85rem; }
.section-title .spacer + a { font-size: .9rem; font-weight: 400; }

/* ---------- کارت مقاله ---------- */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.layout-2 { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 30px; align-items: start; }
.layout-2 .grid { grid-template-columns: repeat(2, 1fr); }
.post-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: transform .22s, border-color .22s, box-shadow .22s; position: relative; }
.post-card:hover { transform: translateY(-5px); border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); box-shadow: var(--glow); }
.post-card .cover { aspect-ratio: 16 / 9; }
.post-card .body { padding: 16px 18px 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.post-card h3 { font-size: 1.08rem; margin: 0; line-height: 1.7; font-weight: 700; }
.post-card h3 a { color: var(--text); }
.post-card h3 a::after { content: ""; position: absolute; inset: 0; }
.post-card:hover h3 a { color: var(--accent); }
.post-card p { margin: 0; color: var(--muted); font-size: .88rem; line-height: 1.85; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.post-card .meta { margin-top: auto; padding-top: 10px; border-top: 1px dashed var(--line); display: flex; align-items: center; gap: 12px; font-size: .8rem; color: var(--muted); }
.post-card .meta .by { display: flex; align-items: center; gap: 8px; color: var(--text-dim); position: relative; z-index: 2; }
.post-card .meta .by:hover { color: var(--accent); }
.meta .m { display: inline-flex; align-items: center; gap: 4px; }
.meta .m.liked { color: var(--danger); }
.post-card .tag-cat { position: absolute; top: 12px; right: 12px; z-index: 2; }
.post-card .draft-flag { position: absolute; top: 12px; left: 12px; z-index: 2; }
.tag-cat { background: rgba(5, 10, 16, .75); backdrop-filter: blur(6px); color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 50%, transparent); padding: 1px 12px; border-radius: 999px; font-size: .75rem; }

.cover { background-size: cover; background-position: center; position: relative; overflow: hidden; background-color: var(--surface-2); }
.cover.ph { display: grid; place-items: center; }
.cover.ph svg { width: 56px; height: 56px; stroke: rgba(255, 255, 255, .85); stroke-width: 1.4; fill: none; filter: drop-shadow(0 0 12px rgba(255, 255, 255, .45)); position: relative; }
.cover.ph::before { content: ""; position: absolute; inset: 0; background:
  linear-gradient(rgba(255, 255, 255, .07) 1px, transparent 1px) 0 0 / 22px 22px, linear-gradient(90deg, rgba(255, 255, 255, .07) 1px, transparent 1px) 0 0 / 22px 22px; }
.ph-security { background-image: linear-gradient(135deg, #064e3b, #0e7490 60%, #164e63); }
.ph-network { background-image: linear-gradient(135deg, #1e1b4b, #3730a3 55%, #0369a1); }
.ph-news { background-image: linear-gradient(135deg, #4c0519, #9f1239 55%, #7c2d12); }
.ph-tech { background-image: linear-gradient(135deg, #312e81, #6d28d9 55%, #be185d); }

/* کارت ویژه (بزرگ) */
.featured { display: grid; grid-template-columns: 1.2fr 1fr; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; position: relative; transition: border-color .2s, box-shadow .2s; }
.featured:hover { border-color: var(--accent); box-shadow: var(--glow); }
.featured .cover { min-height: 300px; }
.featured .body { padding: 30px 30px 24px; display: flex; flex-direction: column; gap: 12px; justify-content: center; }
.featured h2 { font-size: 1.7rem; margin: 0; font-weight: 800; line-height: 1.6; }
.featured h2 a { color: var(--text); } .featured h2 a::after { content: ""; position: absolute; inset: 0; }
.featured:hover h2 a { color: var(--accent); }
.featured p { color: var(--text-dim); margin: 0; }
.featured .meta { display: flex; gap: 14px; align-items: center; color: var(--muted); font-size: .85rem; flex-wrap: wrap; }

/* دسته‌ها */
.cats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.cat-tile { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); color: var(--text); transition: .2s; }
.cat-tile:hover { border-color: var(--accent); transform: translateY(-3px); color: var(--text); box-shadow: var(--glow); }
.cat-tile .ico { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.cat-tile .ico svg { width: 24px; height: 24px; stroke: #fff; stroke-width: 1.8; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.cat-tile b { display: block; line-height: 1.5; } .cat-tile small { color: var(--muted); }

/* سایدبار */
.side-box { margin-bottom: 22px; padding: 18px; }
.side-box h4 { font-size: 1rem; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.side-box h4 .ic { color: var(--accent); }
.pop-item { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--line); align-items: flex-start; }
.pop-item:last-child { border: 0; padding-bottom: 0; }
.pop-item .n { font-family: var(--font-mono); color: var(--accent); font-size: 1.3rem; line-height: 1.3; opacity: .85; min-width: 26px; }
.pop-item a { color: var(--text); font-size: .92rem; line-height: 1.7; display: block; }
.pop-item a:hover { color: var(--accent); }
.pop-item small { color: var(--muted); }
.tagcloud { display: flex; flex-wrap: wrap; gap: 8px; }

/* فیلتر/جستجو */
.filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 22px; }
.filters .input { width: auto; min-width: 150px; }
.search-box { position: relative; flex: 1; min-width: 240px; }
.search-box .input { padding-right: 44px; border-radius: 999px; }
.search-box .ic { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.result-snippet { color: var(--muted); font-size: .88rem; line-height: 1.8; margin: 0; }
.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty svg { width: 54px; height: 54px; stroke: var(--line-2); margin-bottom: 10px; }
.pager { display: flex; gap: 6px; justify-content: center; margin-top: 28px; flex-wrap: wrap; }
.pager button { min-width: 38px; }
.pager .cur { background: var(--accent); color: var(--accent-ink); border-color: transparent; font-weight: 700; }

/* ---------- صفحه‌ی مقاله ---------- */
.article-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 36px; align-items: start; max-width: 1060px; margin: 0 auto; }
.article-wrap.no-toc { grid-template-columns: minmax(0, 780px); justify-content: center; }
.article-main { min-width: 0; }
.crumbs { font-size: .85rem; color: var(--muted); margin-bottom: 14px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.article-head h1 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); font-weight: 800; line-height: 1.6; margin-bottom: 14px; }
.article-meta { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; color: var(--muted); font-size: .88rem; padding: 14px 0; border-block: 1px dashed var(--line); margin-bottom: 22px; }
.article-meta .by { display: flex; align-items: center; gap: 10px; color: var(--text); }
.article-meta .by b { display: block; line-height: 1.4; font-size: .95rem; }
.article-cover { border-radius: 16px; aspect-ratio: 16 / 8; margin-bottom: 28px; border: 1px solid var(--line); }
.source-box { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 12px; border: 1px dashed var(--line-2); background: var(--surface); margin: 26px 0 0; font-size: .9rem; color: var(--text-dim); word-break: break-all; }
.source-box .ic { color: var(--accent-2); }
.article-tags { display: flex; gap: 8px; flex-wrap: wrap; margin: 24px 0 8px; }
.actions-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 16px 0; margin-top: 18px; border-top: 1px solid var(--line); }
.like-btn { gap: 8px; }
.like-btn.on { color: var(--danger); border-color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, transparent); }
.like-btn.on .ic { fill: var(--danger); }
.like-btn.pop .ic { animation: pop .4s; }
@keyframes pop { 30% { transform: scale(1.5); } 100% { transform: scale(1); } }
.toc { position: sticky; top: calc(var(--header-h) + 20px); font-size: .86rem; border-inline-start: 2px solid var(--line); padding-inline-start: 14px; max-height: calc(100vh - 120px); overflow: auto; }
.toc b { display: block; margin-bottom: 8px; color: var(--text); font-size: .9rem; }
.toc a { display: block; color: var(--muted); padding: 3px 0; line-height: 1.7; }
.toc a.l3 { padding-inline-start: 14px; font-size: .82rem; }
.toc a:hover, .toc a.on { color: var(--accent); }

/* باکس نویسنده */
.author-box { margin-top: 38px; padding: 26px; border-radius: 18px; border: 1px solid var(--line-2); background:
  radial-gradient(500px 200px at 0% 0%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 70%), var(--surface); position: relative; overflow: hidden; }
.author-box::before { content: "AUTHOR"; position: absolute; top: 10px; left: 16px; font-family: var(--font-mono); font-size: .7rem; letter-spacing: 3px; color: var(--muted); opacity: .7; }
.author-top { display: flex; gap: 20px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.author-top h3 { margin: 0 0 2px; font-size: 1.3rem; }
.author-top h3 a { color: var(--text); } .author-top h3 a:hover { color: var(--accent); }
.author-bio { color: var(--text-dim); margin: 0 0 16px; white-space: pre-wrap; }
.author-facts { display: flex; flex-wrap: wrap; gap: 8px 20px; color: var(--muted); font-size: .88rem; margin-bottom: 16px; }
.author-facts span { display: inline-flex; align-items: center; gap: 6px; }
.author-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.author-stats div { background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px; text-align: center; }
.author-stats b { display: block; font-family: var(--font-mono); color: var(--accent); font-size: 1.2rem; line-height: 1.5; }
.author-stats small { color: var(--muted); font-size: .76rem; }
.socials { display: flex; gap: 8px; flex-wrap: wrap; }

/* نظرات */
.comments { margin-top: 38px; }
.comment-form { display: flex; gap: 14px; margin-bottom: 26px; }
.comment-form form { flex: 1; }
.login-cta { text-align: center; padding: 22px; border: 1px dashed var(--line-2); border-radius: 14px; color: var(--text-dim); margin-bottom: 24px; background: var(--surface); }
.comment { display: flex; gap: 12px; padding: 16px 0; border-bottom: 1px dashed var(--line); animation: pageIn .3s both; }
.comment.reply { margin-inline-start: 52px; border-bottom: 0; padding: 10px 0; }
.comment .cbody { flex: 1; min-width: 0; }
.comment .chead { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: .9rem; }
.comment .chead b a { color: var(--text); } .comment .chead b a:hover { color: var(--accent); }
.comment .chead time { color: var(--muted); font-size: .78rem; }
.comment .ctext { margin: 4px 0 6px; white-space: pre-wrap; word-wrap: break-word; color: var(--text-dim); line-height: 1.9; }
.comment .cact { display: flex; gap: 14px; font-size: .82rem; }
.comment .cact button { background: none; border: 0; color: var(--muted); cursor: pointer; display: inline-flex; gap: 5px; align-items: center; padding: 0; }
.comment .cact button:hover { color: var(--accent); }
.comment .cact button.on { color: var(--danger); } .comment .cact button.on .ic { fill: var(--danger); }
.comment .cact button.del:hover { color: var(--danger); }
.reply-form { margin-top: 10px; }

/* ---------- محتوای مقاله (.prose) ---------- */
.prose { font-size: 1.06rem; line-height: 2.15; color: var(--text-dim); overflow-wrap: break-word; }
.prose > *:first-child { margin-top: 0; }
.prose p { margin: 0 0 1.15em; }
.prose h2, .prose h3, .prose h4 { color: var(--text); margin: 1.9em 0 .7em; scroll-margin-top: calc(var(--header-h) + 16px); font-weight: 800; }
.prose h2 { font-size: 1.55rem; padding-bottom: 8px; border-bottom: 1px solid var(--line); position: relative; }
.prose h2::before { content: "#"; font-family: var(--font-mono); color: var(--accent); margin-inline-end: 10px; opacity: .8; }
.prose h3 { font-size: 1.28rem; } .prose h4 { font-size: 1.1rem; color: var(--accent-2); }
.prose a { color: var(--accent-2); border-bottom: 1px dashed currentColor; } .prose a:hover { color: var(--accent); }
.prose strong, .prose b { color: var(--text); }
.prose ul, .prose ol { padding-inline-start: 1.6em; margin: 0 0 1.2em; } .prose li { margin-bottom: .35em; }
.prose li::marker { color: var(--accent); }
.prose blockquote { margin: 1.4em 0; padding: 14px 20px; border-inline-start: 4px solid var(--accent); background: color-mix(in srgb, var(--accent) 7%, var(--surface)); border-radius: 0 12px 12px 0; color: var(--text); font-style: normal; }
.prose blockquote p:last-child { margin: 0; }
.prose code { font-family: var(--font-mono); font-size: .88em; background: var(--surface-2); border: 1px solid var(--line); padding: 1px 7px; border-radius: 6px; color: var(--accent); direction: ltr; unicode-bidi: embed; }
.prose pre { position: relative; direction: ltr; text-align: left; background: #060a10; color: #cfe0f5; border: 1px solid var(--line-2); border-radius: 12px; padding: 16px 18px; overflow-x: auto; margin: 1.4em 0; line-height: 1.75; font-size: .9rem; }
.prose pre code { background: none; border: 0; padding: 0; color: inherit; font-size: inherit; }
.copy-btn { position: absolute; top: 8px; right: 8px; font-size: .72rem; padding: 2px 10px; border-radius: 6px; border: 1px solid #2a3d58; background: #0e1623; color: #9bb0cc; cursor: pointer; font-family: var(--font-body); }
.copy-btn:hover { color: #2cffb0; border-color: #2cffb0; }
.prose img { border-radius: 12px; border: 1px solid var(--line); height: auto; display: block; margin: 1.4em auto; }
.prose figure { margin: 1.6em 0; text-align: center; }
.prose figure img { margin: 0 auto; }
.prose figcaption { color: var(--muted); font-size: .85rem; margin-top: 8px; }
.prose img.img-right { float: right; margin: .3em 0 1em 1.4em; } .prose img.img-left { float: left; margin: .3em 1.4em 1em 0; }
.prose hr { border: 0; height: 1px; margin: 2.2em 0; background: linear-gradient(90deg, transparent, var(--accent), transparent); }
.prose table { width: 100%; border-collapse: collapse; margin: 1.4em 0; font-size: .95rem; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--line-2); padding: 8px 12px; } .prose th { background: var(--surface-2); color: var(--text); }
.prose mark { background: color-mix(in srgb, var(--warn) 35%, transparent); color: inherit; padding: 0 4px; border-radius: 4px; }
.prose::after { content: ""; display: block; clear: both; }
.callout { margin: 1.4em 0; padding: 14px 18px; border-radius: 12px; border: 1px solid; border-inline-start-width: 5px; color: var(--text); }
.callout > *:last-child { margin-bottom: 0; }
.callout-info { background: color-mix(in srgb, var(--accent-2) 10%, var(--surface)); border-color: var(--accent-2); }
.callout-warn { background: color-mix(in srgb, var(--warn) 10%, var(--surface)); border-color: var(--warn); }
.callout-danger { background: color-mix(in srgb, var(--danger) 10%, var(--surface)); border-color: var(--danger); }
.callout-ok { background: color-mix(in srgb, var(--ok) 10%, var(--surface)); border-color: var(--ok); }
.prose .lead { font-size: 1.2rem; color: var(--text); }

/* ---------- ادیتور ---------- */
.editor-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.title-input { font-size: 1.6rem; font-weight: 800; border: 0; border-bottom: 2px solid var(--line-2); border-radius: 0; background: transparent; padding: 8px 2px; width: 100%; margin-bottom: 14px; }
.title-input:focus { outline: none; border-color: var(--accent); }
.toolbar { display: flex; flex-wrap: wrap; gap: 4px 6px; padding: 8px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 12px 12px 0 0; position: sticky; top: var(--header-h); z-index: 20; align-items: center; }
.tb-group { display: flex; gap: 3px; padding-inline-end: 8px; margin-inline-end: 2px; border-inline-end: 1px solid var(--line); align-items: center; }
.tb-group:last-child { border: 0; }
.tb { min-width: 34px; height: 34px; padding: 0 8px; border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--text-dim); cursor: pointer; display: inline-grid; place-items: center; font-size: .85rem; position: relative; }
.tb:hover { background: var(--surface-2); color: var(--accent); border-color: var(--line-2); }
.tb.on { background: color-mix(in srgb, var(--accent) 15%, transparent); color: var(--accent); }
.tb-select { height: 34px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--bg-2); padding: 0 8px; font-size: .84rem; max-width: 130px; cursor: pointer; }
.tb-color { position: relative; }
.tb-color input[type=color] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.tb-color .bar { position: absolute; bottom: 4px; inset-inline: 8px; height: 3px; border-radius: 2px; background: var(--c, var(--accent)); }
.swatches { display: flex; gap: 4px; align-items: center; }
.sw { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-2); cursor: pointer; padding: 0; }
.sw:hover { transform: scale(1.2); border-color: var(--text); }
.editor-area { min-height: 480px; padding: 24px 26px; border: 1px solid var(--line-2); border-top: 0; border-radius: 0 0 12px 12px; background: var(--surface); outline: none; }
.editor-area:focus { border-color: var(--accent); }
.editor-area:empty::before { content: attr(data-placeholder); color: var(--muted); }
.editor-area img { cursor: pointer; } .editor-area img.sel { outline: 3px solid var(--accent-2); }
.editor-area .callout, .editor-area pre { outline: 1px dashed var(--line-2); outline-offset: 3px; }
.img-tools { position: absolute; z-index: 40; display: flex; gap: 4px; padding: 5px; background: var(--surface); border: 1px solid var(--accent-2); border-radius: 10px; box-shadow: var(--shadow); }
.editor-foot { display: flex; justify-content: space-between; color: var(--muted); font-size: .8rem; margin-top: 8px; }
.side-panel { position: sticky; top: calc(var(--header-h) + 16px); display: flex; flex-direction: column; gap: 16px; }
.cover-drop { border: 2px dashed var(--line-2); border-radius: 12px; aspect-ratio: 16 / 9; display: grid; place-items: center; color: var(--muted); cursor: pointer; background-size: cover; background-position: center; text-align: center; font-size: .88rem; transition: .2s; overflow: hidden; }
.cover-drop:hover, .cover-drop.drag { border-color: var(--accent); color: var(--accent); }
.tags-input { display: flex; flex-wrap: wrap; gap: 6px; padding: 7px 10px; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 10px; }
.tags-input:focus-within { border-color: var(--accent); }
.tags-input input { flex: 1; min-width: 90px; background: none; border: 0; outline: none; padding: 3px; }
.tags-input .chip button { background: none; border: 0; cursor: pointer; color: var(--muted); padding: 0; line-height: 1; }
.tags-input .chip button:hover { color: var(--danger); }
.seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 3px; }
.seg label { text-align: center; padding: 6px; border-radius: 8px; cursor: pointer; font-size: .9rem; color: var(--muted); }
.seg input { display: none; } .seg input:checked + span { color: var(--accent-ink); }
.seg label:has(input:checked) { background: var(--accent); color: var(--accent-ink); font-weight: 700; }
@supports not selector(:has(*)) { .seg input:checked + span { display: block; margin: -6px; padding: 6px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); font-weight: 700; } }
.draft-banner { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; border: 1px solid var(--warn); border-radius: 10px; background: color-mix(in srgb, var(--warn) 10%, transparent); margin-bottom: 16px; font-size: .9rem; }

/* ---------- پروفایل ---------- */
.profile-hero { display: flex; gap: 26px; align-items: center; padding: 30px; border-radius: 20px; border: 1px solid var(--line-2); margin-bottom: 26px; flex-wrap: wrap;
  background: radial-gradient(600px 240px at 100% 0%, color-mix(in srgb, var(--accent-2) 14%, transparent), transparent 70%), radial-gradient(500px 240px at 0% 100%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 70%), var(--surface); }
.profile-hero h1 { margin: 0; font-size: 1.8rem; }
.profile-hero .username { font-family: var(--font-mono); color: var(--muted); direction: ltr; display: inline-block; }
.tabs { display: flex; flex-wrap: wrap; gap: 2px 4px; border-bottom: 1px solid var(--line); margin-bottom: 24px; overflow: visible; }
.tabs a { padding: 10px 18px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; gap: 8px; align-items: center; }
.tabs a:hover { color: var(--text); } .tabs a.on { color: var(--accent); border-color: var(--accent); }
.avatar-edit { display: flex; align-items: center; gap: 18px; margin-bottom: 20px; }

/* ---------- ورود / ثبت‌نام ---------- */
.auth-wrap { max-width: 460px; margin: 30px auto; }
.auth-wrap h1 { font-family: var(--font-display); font-weight: 800; font-size: 2.1rem; text-align: center; }
.auth-wrap .sub { text-align: center; color: var(--muted); margin: -4px 0 22px; }
.auth-card { padding: 30px; box-shadow: var(--shadow); }
.pw-meter { height: 5px; border-radius: 3px; background: var(--line); overflow: hidden; } .pw-meter i { display: block; height: 100%; width: 0; transition: .25s; background: var(--danger); }

/* ---------- جدول ---------- */
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: start; color: var(--muted); font-weight: 500; padding: 10px 12px; border-bottom: 1px solid var(--line-2); white-space: nowrap; background: color-mix(in srgb, var(--surface-2) 70%, transparent); }
.table td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:hover td { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.table .who { display: flex; align-items: center; gap: 10px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }

/* ---------- پنل مدیر ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
.kpi { padding: 18px; position: relative; overflow: hidden; }
.kpi b { font-family: var(--font-mono); font-size: 2rem; display: block; line-height: 1.3; }
.kpi span { color: var(--muted); font-size: .88rem; }
.kpi::after { content: ""; position: absolute; inset-inline-end: -20px; top: -20px; width: 80px; height: 80px; border-radius: 50%; background: var(--k, var(--accent)); opacity: .12; filter: blur(4px); }
.chart { display: flex; align-items: flex-end; gap: 6px; height: 176px; padding-top: 36px; }   /* فضای بالا برای نمایش عدد روی بالاترین نوار */
.chart .col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 6px; font-size: .68rem; color: var(--muted); }
.chart .bar { width: 100%; max-width: 34px; border-radius: 6px 6px 2px 2px; background: linear-gradient(var(--accent), var(--accent-2)); min-height: 3px; position: relative; transition: height .5s; }
.chart .col:hover .bar::after, .chart .col:focus .bar::after, .chart .bar:hover::after { content: attr(data-v); position: absolute; z-index: 5; top: -30px; line-height: 24px; left: 50%; transform: translateX(-50%); background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 6px; padding: 0 8px; font-size: .75rem; color: var(--text); white-space: nowrap; }
.hbar { display: grid; grid-template-columns: 110px 1fr 40px; gap: 10px; align-items: center; margin: 9px 0; font-size: .88rem; }
.hbar .trk { height: 9px; background: var(--bg-2); border-radius: 5px; overflow: hidden; border: 1px solid var(--line); } .hbar .trk i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent-3), var(--accent-2)); border-radius: 5px; }
.hbar b { font-family: var(--font-mono); text-align: end; }
.cols-2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; margin-bottom: 18px; }
.author-row { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); margin-bottom: 12px; overflow: hidden; }
.author-row > summary { list-style: none; cursor: pointer; padding: 16px 18px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.author-row > summary::-webkit-details-marker { display: none; }
.author-row[open] > summary { border-bottom: 1px solid var(--line); background: var(--surface-2); }
.author-row .nums { display: flex; gap: 8px; flex-wrap: wrap; margin-inline-start: auto; }
.num-pill { text-align: center; padding: 3px 12px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line); min-width: 74px; }
.num-pill b { display: block; font-family: var(--font-mono); font-size: 1.1rem; color: var(--accent); line-height: 1.4; } .num-pill small { color: var(--muted); font-size: .7rem; }
.author-row .inner { padding: 6px 18px 16px; }
.action-tag { font-family: var(--font-mono); font-size: .72rem; direction: ltr; display: inline-block; padding: 0 8px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line-2); color: var(--text-dim); }
.act-publish { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 50%, transparent); }
.act-delete, .act-ban, .act-failed, .act-demote { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 50%, transparent); }
.act-promote { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 50%, transparent); }
.meta-json { font-family: var(--font-mono); font-size: .72rem; color: var(--muted); direction: ltr; text-align: left; }

/* ---------- مودال / toast ---------- */
.modal-back { position: fixed; inset: 0; z-index: 200; background: rgba(2, 6, 12, .72); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 20px; animation: fadeIn .15s; }
@keyframes fadeIn { from { opacity: 0; } }
.modal { background: var(--surface); border: 1px solid var(--line-2); border-radius: 16px; padding: 24px; max-width: 440px; width: 100%; box-shadow: var(--shadow); animation: pageIn .2s; }
.modal h3 { margin-bottom: 8px; } .modal p { color: var(--text-dim); margin: 0 0 20px; }
.modal .row { justify-content: flex-end; }
#toasts { position: fixed; bottom: 22px; left: 22px; z-index: 300; display: flex; flex-direction: column; gap: 10px; }
.toast { background: var(--surface); border: 1px solid var(--line-2); border-inline-start: 4px solid var(--accent); padding: 11px 18px; border-radius: 10px; box-shadow: var(--shadow); animation: toastIn .3s; max-width: 340px; font-size: .92rem; }
.toast.err { border-inline-start-color: var(--danger); } .toast.out { opacity: 0; transform: translateX(-20px); transition: .3s; }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px); } }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--line-2); border-top-color: var(--accent); animation: spin .8s linear infinite; margin: 70px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 50%, var(--surface) 75%); background-size: 200% 100%; animation: shimmer 1.3s infinite; border-radius: var(--radius); height: 280px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- ریسپانسیو ---------- */
@media (max-width: 1020px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .layout-2, .editor-layout { grid-template-columns: 1fr; }
  .layout-2 .grid { grid-template-columns: repeat(2, 1fr); }
  .side-panel { position: static; }
  .article-wrap { grid-template-columns: 1fr; } .toc { display: none; }
  .kpis { grid-template-columns: repeat(2, 1fr); } .cols-2 { grid-template-columns: 1fr; }
  .cats { grid-template-columns: repeat(2, 1fr); }
  .hero { grid-template-columns: 1fr; } .terminal { order: -1; }
}
@media (max-width: 760px) {
  .nav { position: fixed; top: var(--header-h); inset-inline: 0; flex-direction: column; background: var(--bg); border-bottom: 1px solid var(--line); padding: 10px 20px 16px; display: none; }
  .nav.open { display: flex; } .burger { display: inline-flex; }
  .hdr { gap: 10px; } .hdr-search { max-width: none; } .usermenu .name { display: none; }
  .grid, .layout-2 .grid, .featured, .ftr, .form-grid { grid-template-columns: 1fr; }
  .featured .cover { min-height: 200px; } .featured .body { padding: 20px; }
  .author-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .stats-strip { grid-template-columns: repeat(3, 1fr); }
  .toolbar { position: static; } .comment.reply { margin-inline-start: 22px; }
  .hbar { grid-template-columns: 80px 1fr 34px; } .cats { grid-template-columns: 1fr; }
  .brand span.t { display: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } #bg-rain { display: none; } }
@media print { #site-header, #site-footer, .actions-bar, .comments, #bg-rain, .toc { display: none !important; } body { background: #fff; color: #000; } .prose { color: #000; } }

@media (max-width: 760px) { .hide-sm { display: none; } }

/* ---------- فیلد رمز با آیکن چشم ---------- */
.pw-wrap { position: relative; }
.pw-wrap .input { padding-left: 46px; }
.pw-eye { position: absolute; left: 6px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; display: grid; place-items: center; border: 0; background: transparent; color: var(--muted); border-radius: 8px; cursor: pointer; }
.pw-eye:hover, .pw-eye[aria-pressed="true"] { color: var(--accent); background: var(--bg-2); }
.pw-eye svg { width: 19px; height: 19px; }

/* ---------- صفحه‌ی تأیید کد ---------- */
.vbox { border: 1px solid var(--line); background: var(--bg-2); border-radius: var(--radius-sm); padding: 14px; margin-bottom: 14px; }
.vbox.done { border-color: color-mix(in srgb, var(--ok) 50%, var(--line)); }
.vhead { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.vhead > svg { width: 22px; height: 22px; color: var(--accent); flex: none; }
.vhead > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.vhead .ltr-i { direction: ltr; unicode-bidi: isolate; font-size: .82rem; color: var(--muted); text-align: right; }
.vok { margin-inline-start: auto; color: var(--ok); font-size: .85rem; display: inline-flex; gap: 4px; align-items: center; } .vok svg { width: 16px; height: 16px; }
.code-input { text-align: center; letter-spacing: .5em; font-size: 1.4rem; font-family: var(--font-mono); padding-inline-start: .5em; }
.verr { color: var(--danger); font-size: .85rem; min-height: 1.2em; margin-top: 4px; }
.vfoot { display: flex; align-items: center; gap: 10px; font-size: .85rem; }
.linkbtn { background: none; border: 0; color: var(--accent); cursor: pointer; padding: 0; font: inherit; } .linkbtn:disabled { color: var(--muted); cursor: default; }
.devcode { margin-top: 8px; padding: 8px 10px; border: 1px dashed var(--warn); border-radius: 8px; color: var(--warn); font-size: .82rem; }

/* ---------- نظرات در انتظار تأیید ---------- */
.badge-pending { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); border: 1px solid color-mix(in srgb, var(--warn) 40%, transparent); font-size: .72rem; padding: 1px 8px; border-radius: 99px; }
.comment.is-pending .ctext { opacity: .75; }
.comment.is-pending > .cbody { border-inline-start: 2px dashed var(--warn); padding-inline-start: 10px; }
.cact button.ok { color: var(--ok); }
.chead time, time.ago { color: var(--muted); font-size: .8rem; }
.by-t { display: flex; flex-direction: column; line-height: 1.3; } .by-t small { color: var(--muted); font-size: .75rem; }

/* ---------- ردیف مدیریت نظر / تب‌ها / نشان عددی ---------- */
.nbadge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; margin-inline-start: 6px; border-radius: 99px; background: var(--danger); color: #fff; font-size: .72rem; font-weight: 700; } .nbadge:empty { display: none; } .nbadge.nb-dim { background: var(--line-2); color: var(--text-dim); }
.tabseg { display: inline-flex; gap: 4px; padding: 4px; margin-bottom: 16px; }
.tabseg button { border: 0; background: transparent; color: var(--text-dim); padding: 7px 16px; border-radius: 8px; cursor: pointer; font: inherit; font-size: .9rem; }
.tabseg button.on { background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.mod-row { margin-bottom: 12px; } .mod-head, .mod-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; } .mod-body { margin: 10px 0; white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---------- تیکت‌ها (مشترک بین کشو و پنل مدیر) ---------- */
.tk { display: flex; flex-direction: column; gap: 3px; width: 100%; text-align: right; padding: 10px 12px; margin-bottom: 8px; border: 1px solid var(--line); background: var(--bg-2); color: var(--text); border-radius: var(--radius-sm); cursor: pointer; font: inherit; }
.tk:hover, .tk.sel { border-color: var(--accent); } .tk.unread { border-inline-start: 3px solid var(--accent); } .tk span { font-size: .8rem; }
.res { font-style: normal; } .res-answered { color: var(--ok); } .res-rejected { color: var(--danger); } .res-wait { color: var(--warn); }
.msgs { display: flex; flex-direction: column; gap: 10px; margin: 14px 0; max-height: 46vh; overflow-y: auto; padding: 2px; }
.msg { background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 9px 12px; max-width: 92%; align-self: flex-start; }
.msg.from-admin { align-self: flex-end; border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.msg .mh { display: flex; gap: 10px; justify-content: space-between; font-size: .78rem; margin-bottom: 4px; } .msg .mb { white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.kind-reject { border-color: var(--danger); } .closed-note { margin-top: 10px; padding: 8px 12px; border-radius: 8px; background: var(--bg-2); font-size: .88rem; }
.support-admin { display: grid; grid-template-columns: minmax(260px, 340px) 1fr; gap: 18px; align-items: start; } .tv-head { display: flex; gap: 10px; justify-content: space-between; }
@media (max-width: 860px) { .support-admin { grid-template-columns: 1fr; } }

/* ---------- دکمه‌ی شناور پشتیبانی + کشو ---------- */
.support-fab { position: fixed; left: 18px; bottom: 18px; z-index: 90; display: inline-flex; align-items: center; gap: 8px; height: 52px; padding: 0 18px 0 16px; border-radius: 99px; border: 1px solid color-mix(in srgb, var(--accent) 55%, transparent); background: var(--surface); color: var(--accent); box-shadow: var(--shadow), 0 0 18px var(--glow); cursor: pointer; font: inherit; font-weight: 700; }
.support-fab:hover { background: var(--accent); color: var(--accent-ink); } .support-fab svg { width: 22px; height: 22px; }
.fab-badge { position: absolute; top: -5px; right: -5px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 99px; background: var(--danger); color: #fff; font-size: .72rem; display: grid; place-items: center; }
.support-drawer { position: fixed; left: 18px; bottom: 80px; z-index: 95; width: min(390px, calc(100vw - 24px)); max-height: min(640px, calc(100vh - 110px)); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line-2); border-radius: 16px; box-shadow: var(--shadow); animation: pageIn .2s; overflow: hidden; }
.sd-head { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line); } .sd-head > svg { width: 20px; color: var(--accent); }
.sd-body { padding: 14px; overflow-y: auto; flex: 1; } .sd-foot { padding: 12px 14px; border-top: 1px solid var(--line); }
@media (max-width: 560px) { .fab-label { display: none; } .support-fab { width: 52px; padding: 0; justify-content: center; } .support-drawer { left: 12px; bottom: 76px; } }

/* ---------- زنگوله و اعلامیه ---------- */
.tg-link { display: inline-flex; color: var(--muted); } .tg-link:hover { color: var(--accent-2); } .tg-link .ic { width: 22px; height: 22px; }
.bellwrap { position: relative; }
.bell-btn { position: relative; }
.bell-count { position: absolute; top: -4px; inset-inline-start: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger); color: #fff; font-size: .68rem; line-height: 18px; text-align: center; font-weight: 700; }
.bell-pop { width: min(360px, 92vw); inset-inline-start: auto; inset-inline-end: 0; padding: 0; overflow: hidden; }
.bell-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.bell-list { max-height: 60vh; overflow-y: auto; }
.bn { display: flex; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); color: var(--text); text-decoration: none; cursor: pointer; font-size: .86rem; }
.bn:hover { background: var(--surface-2); } .bn.unread { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.bn-ic { color: var(--accent); flex: none; } .bn-ic .ic { width: 18px; height: 18px; }
.bn-tx { display: flex; flex-direction: column; gap: 2px; min-width: 0; } .bn-tx small { color: var(--muted); }
.bn-body { color: var(--text-dim); overflow-wrap: anywhere; }
.ann-bar { display: flex; align-items: center; gap: 10px; justify-content: center; padding: 8px 16px; background: color-mix(in srgb, var(--accent-2) 14%, var(--surface)); border-bottom: 1px solid var(--accent-2); font-size: .9rem; }
.ann-bar button { background: none; border: 0; color: var(--muted); font-size: 1.2rem; cursor: pointer; }
.prose .c-normal, .editor-area .c-normal { color: var(--text); }
.prose table, .editor-area table { border-collapse: collapse; width: 100%; table-layout: fixed; margin: 1.2em 0; }
.prose th, .prose td, .editor-area th, .editor-area td { border: 1px solid var(--line-2); padding: 8px 10px; vertical-align: top; overflow-wrap: anywhere; min-width: 60px; }
.prose th, .editor-area th { background: var(--surface-2); }
.tbl-wrap { overflow-x: auto; }
.form-warn{margin:10px 0;padding:8px 12px;border:1px solid var(--warn);border-radius:8px;color:var(--warn);font-size:.85rem}
.hist-list{display:flex;flex-direction:column;gap:2px;padding:6px}.hist-item{display:flex;justify-content:space-between;gap:12px;padding:10px 12px;border-radius:8px;color:var(--text);text-decoration:none}.hist-item:hover{background:var(--surface-2)}.hist-item small{color:var(--muted);white-space:nowrap}
.tb-normal { width: auto; padding: 0 8px; font-size: .74rem; }
.req { color: var(--danger); }
.prose, .editor-area { overflow-wrap: anywhere; } .prose table, .editor-area table { display: block; overflow-x: auto; max-width: 100%; }
.editor-area td, .editor-area th { min-height: 1.6em; }
/* ---------- پنل مدیریت: کادرهای مستقل با اسکرول داخلی ---------- */
.scroll-card { max-height: 360px; }
#panel .card { min-width: 0; }
#panel .table-wrap { max-height: 70vh; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; }
#panel .table { width: 100%; table-layout: auto; }
#panel .table th, #panel .table td { white-space: normal; overflow-wrap: anywhere; word-break: break-word; padding: 8px 8px; }
#panel .table .nw { white-space: nowrap; }
@media (max-width: 720px) { .tabs a { padding: 8px 10px; } }
.cols-2 > .card { max-height: 420px; }
.scroll-card, .cols-2 > .card { display: flex; flex-direction: column; overflow: hidden; }
.scroll-card > h3, .cols-2 > .card > h3 { flex: none; }
.card-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding-inline-end: 4px; }
#panel .table thead th { position: sticky; top: 0; z-index: 2; background: var(--surface-2); }
.rc-code { font-size: 1.5rem; letter-spacing: .12em; text-align: center; padding: 14px; margin: 12px 0; border: 1px dashed var(--accent); border-radius: 10px; user-select: all; direction: ltr; }
.hp { position: absolute !important; inset-inline-start: -9999px; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.captcha-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; } .captcha-img { background: #111; border: 1px solid var(--line-2); border-radius: 8px; max-width: 100%; height: auto; }
.privacy, .recover-note { margin: 0 0 14px; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 10px; font-size: .85rem; color: var(--muted); }
.recover-note { margin: 16px 0 0; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.ann-bar.acct { display: flex; align-items: center; gap: 10px; }
.countdown { font-family: var(--mono, monospace); font-size: 1.3rem; color: var(--warn); }
.detail-grid { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 12px 0; }
.ann-row { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
@media (max-width: 720px) { .cols-2 { grid-template-columns: 1fr; } .scroll-card { max-height: 300px; } }
.msg-img{display:block;max-width:100%;max-height:260px;border-radius:8px;margin-top:6px;border:1px solid var(--line-2)}.attach{margin:8px 0;display:flex;gap:8px;align-items:center;flex-wrap:wrap}

/* ---- چت کارکنان (پایین سمت راست) ---- */
.chat-fab { position: fixed; right: 18px; bottom: 18px; z-index: 90; display: inline-flex; align-items: center; gap: 8px; height: 52px; padding: 0 16px; border-radius: 99px; border: 1px solid color-mix(in srgb, var(--accent-2) 55%, transparent); background: var(--surface); color: var(--accent-2); box-shadow: var(--shadow); cursor: pointer; font: inherit; font-weight: 700; }
.chat-fab:hover { background: var(--accent-2); color: var(--accent-ink); } .chat-fab svg { width: 22px; height: 22px; position: relative; }
.chat-panel { position: fixed; right: 18px; bottom: 80px; z-index: 91; width: min(380px, calc(100vw - 24px)); height: min(520px, calc(100vh - 110px)); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line-2); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; }
.chat-panel.hidden { display: none; } .chat-note { margin: 0; padding: 6px 14px; font-size: .75rem; color: var(--muted); border-bottom: 1px solid var(--line); }
.cm { max-width: 88%; margin: 0 0 10px; padding: 8px 10px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); } .cm.mine { margin-inline-start: auto; border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.cm-h { display: flex; align-items: center; gap: 6px; font-size: .78rem; } .cm-h small { color: var(--muted); margin-inline-start: auto; } .cm-del { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 1.1rem; line-height: 1; }
.cm p { margin: 4px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: .9rem; } .cm .msg-img { max-width: 100%; max-height: 220px; border-radius: 8px; margin-top: 6px; }
.cm-row { display: flex; gap: 6px; align-items: flex-end; } .cm-row textarea { flex: 1; min-height: 38px; max-height: 100px; resize: none; }
@media (max-width: 560px) { .chat-fab .fab-label { display: none; } .chat-fab { width: 52px; padding: 0; justify-content: center; } .chat-panel { right: 12px; bottom: 76px; } }

.callout .callout { margin: .8em 0; }
.callout > .callout:first-child { margin-top: 0; }

.cols-2 > .card.no-clip { max-height: none; overflow: visible; display: block; }

.hdr-clock { display: flex; gap: 8px; align-items: center; font-size: .78rem; color: var(--text-dim); white-space: nowrap; letter-spacing: .3px; padding: 0 4px; font-variant-numeric: tabular-nums; }
.hdr-clock .t { color: var(--accent); min-width: 5.2em; text-align: left; }
@media (max-width: 1100px) { .hdr-clock .d { display: none; } }
@media (max-width: 860px) { .hdr-clock { display: none; } }
.hdr > * { min-width: 0; } .hdr-search { flex-shrink: 1; }

.profile-hero > *, .profile-hero .info { min-width: 0; }
@media (max-width: 420px) { .profile-hero { padding: 18px; gap: 16px; } .profile-hero h1 { font-size: 1.4rem; } .author-stats div { padding: 8px 4px; } }
.tg-link { min-width: 32px; min-height: 32px; align-items: center; justify-content: center; }
.soc { display: inline-flex; gap: 14px; align-items: center; }
.tg-link.rb { color: var(--accent); } .tg-link.rb:hover { filter: brightness(1.2); }

/* مانیتورینگ */
.mchart{display:flex;align-items:flex-end;gap:2px;height:140px;width:100%;overflow:hidden;padding-top:8px}
.mcol{flex:1 1 0;min-width:0;height:100%;display:flex;flex-direction:column;justify-content:flex-end;align-items:center;font-size:10px;color:var(--muted)}
.mcol>div{width:100%;flex:0 0 auto;min-height:2px}
.mbar{background:var(--accent);border-radius:2px 2px 0 0;opacity:.85}
.mcol span{height:14px;line-height:14px;white-space:nowrap;direction:ltr}
.kpi.kpi-sm b{font-size:1.25rem;word-break:break-word}

/* متن سئوی سمت‌سرور فقط برای ربات‌ها/بدون‌JS دیده می‌شود؛ برای کاربر عادی تا آماده شدن SPA نامرئی (بدون پرش چیدمان) */
html.js #app > .ssr { visibility: hidden; height: 70vh; overflow: hidden; }
.stat b { font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }

@media (max-width: 720px) { .brand .wm { height: 38px; } }

/* موبایل: جستجوی هدر به یک دکمه‌ی آیکونی جمع می‌شود (با فوکوس تمام‌عرض باز می‌شود) تا با «ورود/ثبت‌نام» و لوگو همپوشانی نکند */
.hdr-actions { flex-shrink: 0; } .hdr-actions .btn { white-space: nowrap; }
@media (max-width: 640px) {
  .hdr { position: relative; gap: 8px; padding: 0 12px; }
  .brand .wm { height: 34px; }
  .hdr-search { flex: 0 0 40px; width: 40px; max-width: 40px; margin-inline-start: auto; }
  .hdr-search input { width: 40px; height: 40px; padding: 0; border-radius: 50%; color: transparent; caret-color: transparent; cursor: pointer; }
  .hdr-search input::placeholder { color: transparent; }
  .hdr-search > .ic { right: 50%; transform: translate(50%, -50%); }
  .hdr-search:focus-within { position: absolute; inset-inline: 12px; top: 50%; transform: translateY(-50%); width: auto; max-width: none; z-index: 6; }
  .hdr-search:focus-within input { width: 100%; height: auto; padding: 9px 42px 9px 16px; border-radius: 999px; color: var(--text); caret-color: auto; cursor: text; background: var(--surface); }
  .hdr-search:focus-within input::placeholder { color: var(--muted); }
  .hdr-search:focus-within > .ic { right: 14px; transform: translateY(-50%); }
}

/* پنل مدیریت: نوار تب‌ها هنگام اسکرول زیر هدر سایت ثابت می‌ماند */
#app > .tabs { position: sticky; top: var(--header-h); z-index: 20; margin-inline: -20px; padding: 6px 20px 0; background: color-mix(in srgb, var(--bg) 88%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
@media (max-width: 720px) { #app > .tabs { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; margin-bottom: 16px; } #app > .tabs::-webkit-scrollbar { display: none; } }
