/* Modern Clean Styling for 露水晨曦 (lscx.org) */
:root {
  --primary: #10b981;
  --primary-hover: #059669;
  --primary-light: #ecfdf5;
  --text-main: #1f2937;
  --text-muted: #6b7280;
  --text-light: #9ca3af;
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-hover: #ffffff;
  --bg-input: #ffffff;
  --bg-subtle: #f1f5f9;
  --border-color: #e5e7eb;
  --border-subtle: #f1f5f9;
  --link-color: #2563eb;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  color-scheme: light;
}

/* System Dark Mode (Automatic for mobile & desktop) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --primary: #10b981;
    --primary-hover: #34d399;
    --primary-light: rgba(16, 185, 129, 0.15);
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --text-light: #64748b;
    --bg-page: #0b0f19;
    --bg-card: #151d2f;
    --bg-card-hover: #1c263c;
    --bg-input: #0b0f19;
    --bg-subtle: #1e293b;
    --border-color: #27354f;
    --border-subtle: #1e293b;
    --link-color: #60a5fa;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 10px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.6);
    color-scheme: dark;
  }
}

/* Explicit Dark Mode (Manual toggle) */
[data-theme="dark"] {
  --primary: #10b981;
  --primary-hover: #34d399;
  --primary-light: rgba(16, 185, 129, 0.15);
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-light: #64748b;
  --bg-page: #0b0f19;
  --bg-card: #151d2f;
  --bg-card-hover: #1c263c;
  --bg-input: #0b0f19;
  --bg-subtle: #1e293b;
  --border-color: #27354f;
  --border-subtle: #1e293b;
  --link-color: #60a5fa;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 10px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}

html {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: hidden;
  max-width: 100%;
}

*, *::before, *::after {
  box-sizing: inherit;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.65;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: hidden;
  max-width: 100%;
  position: relative;
  transition: background-color 0.25s ease, color 0.25s ease;
}

h1, h2, h3, h4, h5, h6 {
  margin-top: 0;
}

img, video, audio {
  max-width: 100%;
  height: auto;
}

embed, object {
  max-width: 100%;
}

a {
  color: var(--link-color);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--primary);
}

/* ================= Header ================= */
#header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
  width: 100%;
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

.header-inner {
  width: 100%;
  margin: 0;
  padding: 0 24px 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  box-sizing: border-box;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.brand-logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.logo-img {
  height: 64px;
  width: auto;
  display: block;
}

.logo-img.logo-light {
  display: block;
}
.logo-img.logo-dark {
  display: none;
}

[data-theme="dark"] .logo-img.logo-light {
  display: none;
}
[data-theme="dark"] .logo-img.logo-dark {
  display: block;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-img.logo-light {
    display: none;
  }
  :root:not([data-theme="light"]) .logo-img.logo-dark {
    display: block;
  }
}

.brand-logo:hover {
  opacity: 0.85;
}

.brand-slogan {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12.5px;
  color: var(--text-muted);
  font-style: normal;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 3px 12px;
  min-height: 24px;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  user-select: none;
}

.brand-slogan:hover {
  background: var(--border-color);
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.brand-slogan .slogan-text {
  display: inline-block;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1), transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.brand-slogan:hover .slogan-text {
  opacity: 0;
  transform: translateY(-4px) scale(0.9);
}

.brand-slogan .slogan-home-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.5);
  opacity: 0;
  transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1), transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  color: var(--primary);
}

.brand-slogan:hover .slogan-home-icon {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.1);
}

.header-nav-wrap {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 20px;
  flex: 1;
}

.nav-links {
  display: flex;
  align-items: center;
  list-style: none;
  gap: 14px;
  flex-wrap: wrap;
}

.nav-links a {
  color: var(--text-main);
  font-weight: 500;
  font-size: 14.5px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  white-space: nowrap;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--primary);
  background: var(--primary-light);
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.search-form {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input {
  border: 1px solid var(--border-color);
  background: var(--bg-input);
  color: var(--text-main);
  border-radius: 20px;
  padding: 6px 14px 6px 32px;
  font-size: 13px;
  width: 160px;
  transition: all 0.25s ease;
  outline: none;
}

.search-input:focus {
  width: 200px;
  border-color: var(--primary);
  background: var(--bg-card);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.search-icon {
  position: absolute;
  left: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  pointer-events: none;
}

.rss-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: #f59e0b;
  color: white !important;
  border-radius: 50%;
  font-size: 13px;
  font-weight: bold;
  flex-shrink: 0;
}

.rss-btn:hover {
  background: #d97706;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  cursor: pointer;
  padding: 0;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.theme-toggle-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

.theme-toggle-btn svg {
  transition: transform 0.25s ease;
}

.theme-toggle-btn:hover svg {
  transform: rotate(20deg);
}

/* Light mode defaults: show moon, hide sun */
.theme-icon-moon {
  display: block;
}
.theme-icon-sun {
  display: none;
}

/* Dark mode: show sun, hide moon */
[data-theme="dark"] .theme-icon-moon {
  display: none;
}
[data-theme="dark"] .theme-icon-sun {
  display: block;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-icon-moon {
    display: none;
  }
  :root:not([data-theme="light"]) .theme-icon-sun {
    display: block;
  }
}

.mobile-menu-btn {
  display: none;
}

/* ================= Layout ================= */
.main-wrapper {
  max-width: 1180px;
  margin: 25px auto;
  padding: 0 20px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 25px;
  width: 100%;
  box-sizing: border-box;
}

#main {
  min-width: 0;
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
}

#sidebar {
  min-width: 0;
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
  position: relative;
}

/* ================= Articles ================= */
.post-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  padding: 18px 24px 20px 24px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

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

.post-title {
  font-size: 19.5px;
  font-weight: 700;
  margin: 0 0 10px 0;
  padding: 0;
  line-height: 1.4;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.post-title a {
  color: var(--text-main);
}

.post-title a:hover {
  color: var(--primary);
}

.post-lock-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.82em;
  font-weight: 600;
  color: var(--text-muted);
  vertical-align: 1px;
  margin-right: 6px;
  line-height: 1;
}

.post-lock-badge svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  stroke-width: 2.2;
}

.post-detail-title .post-lock-badge {
  font-size: 0.72em;
  vertical-align: 2px;
}

.post-detail-title .post-lock-badge svg {
  width: 20px;
  height: 20px;
}

.post-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.post-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.post-meta a {
  color: var(--primary);
}

.admin-edit-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: #fef2f2;
  color: #dc2626 !important;
  border: 1px solid #fecaca;
  padding: 1px 8px;
  border-radius: 4px;
  font-size: 11.5px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease;
  line-height: 1.5;
  margin-left: 2px;
}

[data-theme="dark"] .admin-edit-btn {
  background: rgba(220, 38, 38, 0.15);
  color: #f87171 !important;
  border-color: rgba(220, 38, 38, 0.3);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .admin-edit-btn {
    background: rgba(220, 38, 38, 0.15);
    color: #f87171 !important;
    border-color: rgba(220, 38, 38, 0.3);
  }
}

.admin-edit-btn:hover {
  background: #dc2626 !important;
  color: #ffffff !important;
  border-color: #dc2626 !important;
  box-shadow: 0 1px 4px rgba(220, 38, 38, 0.25);
}

.post-excerpt {
  color: var(--text-muted);
  font-size: 14.5px;
  line-height: 1.7;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.post-card-footer {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px;
  margin-top: 8px;
  padding-top: 0;
  border-top: none !important;
  flex-wrap: nowrap !important;
}

.post-card-tags {
  display: flex !important;
  align-items: center !important;
  flex-wrap: nowrap !important;
  gap: 6px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}

.post-card-tags .tag-badge {
  display: inline-block;
  background: var(--bg-subtle);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 12px;
  text-decoration: none;
  transition: all 0.2s ease;
  line-height: 1.4;
  white-space: nowrap;
  flex-shrink: 0;
}

.post-card-tags .tag-badge:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.read-more-link {
  display: inline-flex !important;
  align-items: center;
  font-size: 13.5px;
  color: var(--primary);
  text-decoration: none;
  transition: all 0.2s ease;
  white-space: nowrap !important;
  margin-left: auto;
  flex-shrink: 0 !important;
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  box-shadow: none !important;
}

.read-more-link:hover {
  color: var(--primary-hover);
  text-decoration: underline !important;
}

/* ================= Single Post Detail ================= */
.post-detail {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  padding: 28px 36px 35px 36px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 25px;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.post-detail-header {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 18px;
  margin-bottom: 25px;
}

.post-detail-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.35;
  margin: 0 0 14px 0;
  padding: 0;
}

.entry-content {
  font-size: 16px;
  line-height: 1.8;
  color: var(--text-main);
  word-break: break-word;
  overflow-wrap: break-word;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.entry-content * {
  max-width: 100%;
  box-sizing: border-box;
}

.entry-content p {
  margin-bottom: 1.25em;
  text-align: left;
}

.entry-content a:has(> img) {
  display: block;
  text-align: center;
  margin: 12px auto;
}

.entry-content a:has(> img[src*="aizhan.com"]),
.entry-content a:has(> img[src*="face/"]),
.entry-content a:has(> img[src*="br20t"]) {
  display: inline-block;
  margin: 0;
  text-align: inherit;
}

.entry-content h1,
.entry-content h2,
.entry-content h3,
.entry-content h4 {
  color: var(--text-main);
  margin-top: 1.8em;
  margin-bottom: 0.6em;
  font-weight: 700;
  line-height: 1.35;
}

.entry-content h2 {
  font-size: 21px;
  border-left: 4px solid var(--primary);
  padding-left: 10px;
}

.entry-content h3 {
  font-size: 18px;
}

.entry-content ul,
.entry-content ol {
  margin-bottom: 1.25em;
  padding-left: 28px;
}

.entry-content li {
  margin-bottom: 6px;
}

.entry-content blockquote {
  border-left: 4px solid var(--primary);
  background: var(--bg-subtle);
  padding: 12px 18px;
  margin: 1.5em 0;
  color: var(--text-muted);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.entry-content hr {
  border: 0;
  height: 1px;
  background: var(--border-color);
  margin: 2em 0;
}

.entry-content table {
  width: 100% !important;
  max-width: 100% !important;
  display: block !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch !important;
  border-collapse: collapse;
  margin: 1.5em 0;
}

.entry-content th,
.entry-content td {
  border: 1px solid var(--border-color);
  padding: 8px 12px;
  text-align: left;
}

.entry-content th {
  background: var(--bg-subtle);
  color: var(--text-main);
  font-weight: 600;
}

.entry-content img,
.blog-img {
  display: block !important;
  max-width: 100% !important;
  width: auto !important;
  height: auto !important;
  margin: 14px auto !important;
  border-radius: var(--radius-sm);
  object-fit: contain;
}

/* Inline badges / icons / smilies inside text */
.entry-content img[src*="aizhan.com"],
.entry-content img[src*="face/"],
.entry-content img[src*="br20t"] {
  display: inline-block !important;
  width: auto !important;
  height: auto !important;
  min-height: unset !important;
  max-height: 24px !important;
  margin: 0 4px !important;
  vertical-align: middle !important;
}

img.img-fallback {
  display: none !important;
}

.entry-content img[src*="aizhan.com"].img-fallback,
.entry-content img[src*="face/"].img-fallback,
.entry-content img[src*="br20t.gif"].img-fallback {
  display: none !important;
}

.img-fallback {
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 100px;
  max-height: 160px;
  margin: 1.5em 0;
  background: var(--bg-card, #f8fafc);
  color: var(--text-muted, #94a3b8);
  font-size: 13.5px;
  font-weight: 500;
  border: 1px dashed var(--border-color, #cbd5e1);
  border-radius: var(--radius-sm, 8px);
  text-align: center;
  padding: 18px 24px;
  box-sizing: border-box;
  user-select: none;
  transition: all var(--transition-fast);
}

.img-fallback:empty::before {
  content: "[原始图片已归档或失效] 图片已归档";
  display: block;
}

.img-fallback-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--text-muted, #94a3b8);
  line-height: 1.5;
}

/* ================= Code Highlighting & Mac-style Window ================= */
.code-block-wrapper {
  margin: 1.5em 0;
  border-radius: 8px;
  overflow: hidden;
  background: #282c34;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.12);
  border: 1px solid #3e4451;
}

.code-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: #21252b;
  border-bottom: 1px solid #333842;
  user-select: none;
}

.code-block-header .code-dots {
  display: flex;
  align-items: center;
  gap: 6px;
}

.code-block-header .code-dots .dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  display: inline-block;
}

.code-block-header .code-dots .dot.red { background: #ff5f56; }
.code-block-header .code-dots .dot.yellow { background: #ffbd2e; }
.code-block-header .code-dots .dot.green { background: #27c93f; }

.code-block-header .code-lang {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  color: #abb2bf;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.code-block-header .copy-code-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #abb2bf;
  padding: 2px 10px;
  font-size: 11px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  line-height: 1.5;
}

.code-block-header .copy-code-btn:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.code-block-header .copy-code-btn.copied {
  background: #10b981;
  border-color: #10b981;
  color: #fff;
}

.code-block-wrapper pre {
  margin: 0 !important;
  border-radius: 0 !important;
  background: #282c34 !important;
  padding: 16px 18px !important;
  border: none !important;
  box-shadow: none !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch !important;
}

.code-block-wrapper pre code {
  font-family: var(--font-mono) !important;
  font-size: 13.5px !important;
  line-height: 1.65 !important;
  background: transparent !important;
  padding: 0 !important;
  border-radius: 0 !important;
  display: block;
}

pre {
  background: #282c34;
  color: #abb2bf;
  border-radius: var(--radius-sm);
  padding: 16px;
  overflow-x: auto;
  margin: 1.5em 0;
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.55;
  position: relative;
}

code {
  font-family: var(--font-mono);
  background: var(--bg-subtle);
  color: var(--primary);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13.5px;
}

/* ================= Multimedia Container ================= */
.media-container {
  margin: 1.5em 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #000;
}

.media-container video,
.media-container audio {
  width: 100%;
  display: block;
}

.media-container audio {
  background: var(--bg-subtle);
}

.iframe-wrap iframe {
  border: none;
  width: 100%;
}

/* ================= Post Tags & Footer ================= */
.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 25px;
  padding-top: 15px;
  border-top: 1px solid var(--border-color);
}

.tag-badge {
  display: inline-block;
  background: var(--bg-subtle);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  transition: all 0.2s ease;
}

.tag-badge:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.post-nav-links {
  display: flex;
  justify-content: space-between;
  margin: 20px 0;
  gap: 15px;
}

.post-nav-item {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
}

.post-nav-item .nav-label {
  font-size: 12px;
  color: var(--text-light);
  display: block;
  margin-bottom: 4px;
}

/* ================= Comments ================= */
.comments-section {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  padding: 30px;
  margin-top: 25px;
  box-shadow: var(--shadow-sm);
}

.comments-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border-subtle);
}

.comment-list {
  list-style: none;
  padding: 0;
  margin: 0 0 30px 0;
}

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

.comment-main {
  display: flex;
  gap: 14px;
}

.comment-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-subtle);
  flex-shrink: 0;
  overflow: hidden;
  transition: transform 0.5s ease-in-out;
  transform-origin: center;
  will-change: transform;
  cursor: pointer;
}

.comment-avatar:hover {
  transform: rotate(180deg);
}

.comment-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.comment-body {
  flex: 1;
}

.comment-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.comment-author {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-main);
}

.admin-badge {
  background: var(--primary);
  color: white;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 600;
}

.comment-time {
  font-size: 12px;
  color: var(--text-light);
}

.comment-reply-btn {
  font-size: 12px;
  color: var(--primary);
  cursor: pointer;
  margin-left: auto;
}

.comment-text {
  font-size: 14.5px;
  color: var(--text-main);
  line-height: 1.6;
}

.comment-children {
  list-style: none;
  padding: 0 0 0 15px;
  margin-left: 50px;
  margin-top: 12px;
  border-left: 2px solid var(--border-color);
}

/* ================= Comment Form ================= */
.comment-form {
  margin-top: 25px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}

.form-input {
  width: 100%;
  border: 1px solid var(--border-color);
  background: var(--bg-input);
  color: var(--text-main);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.2s ease;
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.15);
}

.comment-textarea {
  min-height: 100px;
  resize: vertical;
  line-height: 1.6;
}

.comment-form-wrapper {
  margin-top: 25px;
}

.comment-item .comment-form {
  margin-top: 15px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.reply-notice {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fef3c7;
  color: #92400e;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  border: 1px solid #fde68a;
}

[data-theme="dark"] .reply-notice {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.3);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .reply-notice {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border-color: rgba(245, 158, 11, 0.3);
  }
}

.admin-reply-indicator {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
  font-size: 13.5px;
  color: #065f46;
}

[data-theme="dark"] .admin-reply-indicator {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.25);
  color: #a7f3d0;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .admin-reply-indicator {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.25);
    color: #a7f3d0;
  }
}

.admin-reply-user {
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-profile-link {
  font-size: 12.5px;
  color: var(--primary);
  text-decoration: none;
  transition: opacity 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.admin-profile-link:hover {
  text-decoration: underline;
  opacity: 0.85;
}

.cancel-reply-btn {
  background: transparent;
  border: none;
  color: #ef4444;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 6px;
  font-size: 12px;
  text-decoration: underline;
}

.cancel-reply-btn:hover {
  color: #dc2626;
}

/* ================= Slider Verification ================= */
.slider-submit-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.slider-submit-row .submit-btn {
  margin-left: auto;
  flex-shrink: 0;
}

.slider-verify-box {
  flex: 1;
  min-width: 240px;
  max-width: 380px;
  user-select: none;
  -webkit-user-select: none;
}

.slider-track {
  position: relative;
  width: 100%;
  height: 42px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: 21px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

.slider-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: linear-gradient(90deg, #d1fae5, #a7f3d0);
  border-radius: 21px 0 0 21px;
  pointer-events: none;
}

.slider-text {
  position: relative;
  z-index: 2;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  pointer-events: none;
  transition: color 0.2s ease;
  letter-spacing: 0.5px;
}

.slider-thumb {
  position: absolute;
  left: 0;
  top: 1px;
  width: 38px;
  height: 38px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  z-index: 3;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  touch-action: none;
}

.slider-thumb:active {
  cursor: grabbing;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
}

.slider-thumb .slider-icon {
  font-size: 14px;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  pointer-events: none;
  transition: all 0.2s ease;
}

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

.animate-spin, .spin-icon {
  animation: spin 1s linear infinite;
}

/* Success State */
.slider-track.success {
  background: #ecfdf5;
  border-color: #10b981;
}

.slider-track.success .slider-fill {
  width: 100% !important;
  background: #d1fae5;
  border-radius: 21px;
}

.slider-track.success .slider-text {
  color: #065f46;
  font-weight: 600;
}

[data-theme="dark"] .slider-track.success {
  background: rgba(16, 185, 129, 0.15);
  border-color: #10b981;
}

[data-theme="dark"] .slider-track.success .slider-fill {
  background: rgba(16, 185, 129, 0.25);
}

[data-theme="dark"] .slider-track.success .slider-text {
  color: #34d399;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .slider-track.success {
    background: rgba(16, 185, 129, 0.15);
    border-color: #10b981;
  }
  :root:not([data-theme="light"]) .slider-track.success .slider-fill {
    background: rgba(16, 185, 129, 0.25);
  }
  :root:not([data-theme="light"]) .slider-track.success .slider-text {
    color: #34d399;
  }
}

.submit-btn {
  background: var(--primary);
  color: white;
  border: none;
  padding: 10px 24px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.submit-btn:hover {
  background: var(--primary-hover);
}

.submit-btn:disabled {
  background: #9ca3af;
  cursor: not-allowed;
}

.form-message {
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  display: none;
}

.form-message.success {
  display: block;
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.form-message.error {
  display: block;
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

/* ================= Sidebar ================= */
.sidebar-widget {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  box-sizing: border-box;
}

.widget-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  margin: 0 0 10px 0;
  padding-bottom: 7px;
  border-bottom: 2px solid var(--primary);
  display: flex;
  align-items: center;
}

.widget-list {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

.widget-list li {
  padding: 7px 0;
  border-bottom: 1px dashed var(--border-subtle);
  font-size: 13.5px;
  line-height: 1.5;
  list-style: none !important;
  margin: 0 !important;
}

.widget-list li:last-child {
  border-bottom: none;
}

.widget-list a {
  color: var(--text-main);
  word-break: break-word;
}

.widget-list a:hover {
  color: var(--primary);
}

.widget-hot-list li.hot-post-item {
  display: flex !important;
  align-items: flex-start !important;
  justify-content: space-between !important;
  gap: 10px;
}

.hot-post-title {
  flex: 1;
  min-width: 0;
  word-break: break-word;
  line-height: 1.5;
  color: var(--text-main);
}

.hot-post-title:hover {
  color: var(--primary);
}

.hot-post-views {
  flex-shrink: 0;
  font-size: 12px;
  color: var(--text-light);
  white-space: nowrap;
  text-align: right;
  min-width: 52px;
  font-variant-numeric: tabular-nums;
  line-height: 1.5;
  display: inline-block;
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-cloud a {
  background: var(--bg-subtle);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 12px;
}

.tag-cloud a:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.sticky-sidebar-wrap {
  width: 100%;
  position: relative;
  box-sizing: border-box;
  overflow: visible !important;
}

.sidebar-sponsor,
.sticky-sidebar-widget {
  overflow: visible !important;
  box-sizing: border-box;
  padding: 16px 18px 22px 18px !important;
  min-height: 320px;
}

.sidebar-sponsor .widget-title {
  text-align: left !important;
  width: 100% !important;
  margin: 0 0 14px 0 !important;
}

.sidebar-sponsor .deferred-ad-slot,
.sidebar-sponsor .ad-container,
.sidebar-sponsor .ad-render-target {
  min-height: 250px;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: visible !important;
  text-align: center;
}

.sidebar-sponsor iframe,
.sidebar-sponsor div[id^="cproIframe"],
.sidebar-sponsor iframe[id^="cproIframe"] {
  width: 250px !important;
  height: 250px !important;
  min-width: 250px !important;
  min-height: 250px !important;
  max-width: 100% !important;
  border: none !important;
  overflow: visible !important;
  display: inline-block !important;
}

/* ================= Pagination ================= */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin: 30px 0;
}

.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.page-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.page-info {
  font-size: 13.5px;
  color: var(--text-muted);
}

/* ================= Footer ================= */
#footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
  padding: 30px 20px;
  text-align: center;
  font-size: 13.5px;
  color: var(--text-muted);
  margin-top: 40px;
}

.footer-nav {
  margin-bottom: 10px;
}

.footer-nav a {
  color: var(--text-muted);
  margin: 0 8px;
}

.footer-nav a:hover {
  color: var(--primary);
}

.copyright {
  line-height: 1.8;
}

#rocket {
  position: fixed;
  right: 25px;
  bottom: 30px;
  width: 42px;
  height: 42px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s ease;
}

#rocket.visible {
  opacity: 1;
  pointer-events: auto;
}

#rocket:hover {
  background: var(--primary-hover);
  transform: translateY(-3px);
}

/* ================= Responsive Styling ================= */
@media (max-width: 900px) {
  .main-wrapper {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 20px;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
  #main, .post-detail, .entry-content {
    min-width: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
  }
  .sidebar-sponsor,
  .sticky-sidebar-widget {
    position: static !important;
    top: auto !important;
  }
}

@media (max-width: 768px) {
  /* Header & Navigation */
  #header {
    height: 56px;
    position: sticky;
    top: 0;
    z-index: 100;
  }

  .header-inner {
    padding: 0 16px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    box-sizing: border-box;
  }

  .brand {
    max-width: calc(100% - 90px);
  }

  .brand-logo .logo-img {
    height: 48px;
  }

  .brand-slogan {
    display: none !important;
  }

  .mobile-menu-btn {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    width: 36px;
    height: 34px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 7px 8px;
    cursor: pointer;
    margin-left: auto;
    flex-shrink: 0;
  }

  .mobile-menu-btn span {
    width: 100%;
    height: 2px;
    background-color: var(--text-main);
    border-radius: 2px;
    transition: all 0.25s ease;
  }

  .mobile-menu-btn.active span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
  }

  .mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
  }

  .mobile-menu-btn.active span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
  }

  /* Dropdown Overlay: does NOT stretch the header bar! */
  .header-nav-wrap {
    display: none;
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    width: 100%;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 12px 28px -4px rgba(0, 0, 0, 0.25);
    padding: 14px 18px 18px 18px;
    flex-direction: column;
    gap: 12px;
    z-index: 999;
    max-height: calc(100vh - 65px);
    overflow-y: auto;
    box-sizing: border-box;
    animation: fadeInDown 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .header-nav-wrap.open {
    display: flex;
  }

  .nav-menu {
    width: 100%;
  }

  .nav-links {
    flex-direction: column;
    width: 100%;
    gap: 0;
    padding: 0 !important;
    margin: 0 !important;
  }

  .nav-links li {
    width: 100%;
    list-style: none !important;
  }

  .nav-links a {
    display: block;
    width: 100%;
    padding: 11px 12px;
    border-bottom: 1px dashed var(--border-subtle);
    font-size: 15px;
    font-weight: 500;
    color: var(--text-main);
  }

  .header-tools {
    width: 100%;
    display: flex;
    gap: 8px;
    padding: 4px 0;
  }

  .search-form {
    flex: 1;
    width: 100%;
  }

  .search-input {
    width: 100% !important;
  }

  /* Main Layout & Cards */
  .main-wrapper {
    padding: 0 12px;
    margin: 15px auto;
  }

  .post-card {
    padding: 14px 16px 16px 16px;
    margin-bottom: 14px;
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden;
  }

  .post-title {
    font-size: 17.5px;
    margin: 0 0 8px 0;
    padding: 0;
    word-break: break-word !important;
    overflow-wrap: anywhere !important;
  }

  .post-excerpt {
    font-size: 14px;
    line-height: 1.65;
    word-break: break-word !important;
    overflow-wrap: anywhere !important;
  }

  .post-detail {
    padding: 18px 14px;
    margin-bottom: 18px;
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .post-detail-title {
    font-size: 21px;
    line-height: 1.4;
  }

  .entry-content {
    font-size: 15.5px;
    line-height: 1.75;
    min-width: 0 !important;
    max-width: 100% !important;
    overflow-wrap: break-word !important;
    word-break: break-word !important;
    box-sizing: border-box !important;
  }

  .entry-content * {
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .entry-content img,
  .blog-img {
    max-width: 100% !important;
    width: auto !important;
    height: auto !important;
    display: block !important;
    margin: 10px auto !important;
  }

  .entry-content table {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    border-collapse: collapse !important;
  }

  pre {
    padding: 12px;
    font-size: 13px;
    margin: 14px 0;
    border-radius: 4px;
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  pre code {
    white-space: pre !important;
    max-width: none !important;
  }

  /* Comments & Forms */
  .comments-section {
    padding: 20px 14px;
    margin-top: 20px;
  }

  .form-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .captcha-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .captcha-input {
    width: 100% !important;
  }

  .slider-submit-row {
    flex-direction: column;
    align-items: stretch;
  }

  .slider-verify-box {
    max-width: 100%;
  }

  .submit-btn {
    width: 100%;
    text-align: center;
    padding: 12px;
  }

  .post-nav-links {
    flex-direction: column;
    gap: 10px;
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ================= Friend Links & Archive Header Cards ================= */
.links-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 20px;
  margin-bottom: 25px;
}

.links-title {
  margin-top: 0;
  font-size: 17px;
  color: var(--text-main);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 8px;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.link-card-item {
  display: block;
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  transition: all 0.2s ease;
}

.link-card-item:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.link-card-name {
  display: block;
  color: var(--text-main);
  font-size: 14px;
}

.link-card-desc {
  font-size: 12px;
  color: var(--text-muted);
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.archive-header-card {
  margin-bottom: 20px;
  padding: 14px 20px;
  background: var(--bg-subtle);
  border-left: 4px solid var(--primary);
}

.archive-header-card h2 {
  font-size: 18px;
  color: var(--text-main);
  margin: 0;
}

.archive-header-card p {
  color: var(--text-muted);
  font-size: 13.5px;
  margin: 4px 0 0 0;
}

/* =======================================================
   Rich Content Components (Alerts, Callouts, Alignments)
   ======================================================= */
.text-left { text-align: left !important; }
.text-center { text-align: center !important; }
.text-right { text-align: right !important; }
.text-justify { text-align: justify !important; }

/* Callout / Alert Boxes */
.alert {
  padding: 14px 18px;
  border-radius: 8px;
  margin: 1.2em 0;
  font-size: 14px;
  line-height: 1.65;
  border: 1px solid transparent;
  border-left-width: 5px;
  box-sizing: border-box;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}
.alert:has(.alert-icon),
.alert.has-icon {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.alert-icon {
  font-size: 18px;
  line-height: 1.3;
  flex-shrink: 0;
}
.alert-body {
  flex: 1;
  min-width: 0;
}
.alert-body p:first-child, .alert p:first-child { margin-top: 0; }
.alert-body p:last-child, .alert p:last-child { margin-bottom: 0; }

.alert-info {
  background: #eff6ff;
  border-color: #bfdbfe;
  border-left-color: #3b82f6;
  color: #1e40af;
}
.alert-info strong { color: #1d4ed8; }

.alert-success {
  background: #ecfdf5;
  border-color: #a7f3d0;
  border-left-color: #10b981;
  color: #065f46;
}
.alert-success strong { color: #047857; }

.alert-warning {
  background: #fffbeb;
  border-color: #fde68a;
  border-left-color: #f59e0b;
  color: #92400e;
}
.alert-warning strong { color: #b45309; }

.alert-danger {
  background: #fef2f2;
  border-color: #fecaca;
  border-left-color: #ef4444;
  color: #991b1b;
}
.alert-danger strong { color: #b91c1c; }

/* Dark mode alerts */
[data-theme="dark"] .alert-info,
body.adm-dark .alert-info {
  background: rgba(59, 130, 246, 0.12) !important;
  border-color: rgba(59, 130, 246, 0.25) !important;
  border-left-color: #60a5fa !important;
  color: #93c5fd !important;
}
[data-theme="dark"] .alert-info strong,
body.adm-dark .alert-info strong { color: #bfdbfe !important; }

[data-theme="dark"] .alert-success,
body.adm-dark .alert-success {
  background: rgba(16, 185, 129, 0.12) !important;
  border-color: rgba(16, 185, 129, 0.25) !important;
  border-left-color: #34d399 !important;
  color: #6ee7b7 !important;
}
[data-theme="dark"] .alert-success strong,
body.adm-dark .alert-success strong { color: #a7f3d0 !important; }

[data-theme="dark"] .alert-warning,
body.adm-dark .alert-warning {
  background: rgba(245, 158, 11, 0.12) !important;
  border-color: rgba(245, 158, 11, 0.25) !important;
  border-left-color: #fbbf24 !important;
  color: #fcd34d !important;
}
[data-theme="dark"] .alert-warning strong,
body.adm-dark .alert-warning strong { color: #fde68a !important; }

[data-theme="dark"] .alert-danger,
body.adm-dark .alert-danger {
  background: rgba(239, 68, 68, 0.12) !important;
  border-color: rgba(239, 68, 68, 0.25) !important;
  border-left-color: #f87171 !important;
  color: #fca5a5 !important;
}
[data-theme="dark"] .alert-danger strong,
body.adm-dark .alert-danger strong { color: #fecaca !important; }

/* Keyboard keys */
kbd {
  display: inline-block;
  padding: 2px 6px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.2;
  color: #334155;
  background-color: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  box-shadow: 0 1px 1px rgba(0,0,0,0.15);
}
[data-theme="dark"] kbd,
body.adm-dark kbd {
  background-color: #1e293b;
  border-color: #475569;
  color: #e2e8f0;
  box-shadow: 0 1px 1px rgba(0,0,0,0.4);
}

/* Accordion details */
details {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin: 1.2em 0;
  background: var(--bg-card);
  transition: all 0.2s ease;
}
details[open] {
  padding-bottom: 16px;
}
details summary {
  font-weight: 600;
  cursor: pointer;
  color: var(--text-main);
  outline: none;
  user-select: none;
}
details summary:hover {
  color: var(--primary);
}

/* ================= Article Share Bar & Poster Modal ================= */
.post-share-bar {
  margin: 28px 0 20px 0;
  padding: 16px 20px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.post-share-desc {
  font-size: 13.5px;
  color: var(--text-muted);
  font-weight: 500;
}

.post-share-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-share-poster {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--primary);
  color: #ffffff !important;
  font-size: 13.5px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(16, 185, 129, 0.25);
  transition: all 0.2s ease;
}

.btn-share-poster:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.35);
}

.btn-copy-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-copy-link:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.post-meta-share-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 2px 7px;
  font-size: 11.5px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  vertical-align: middle;
}

.post-meta-share-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

/* Modal */
.poster-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.poster-modal.open {
  opacity: 1;
  visibility: visible;
}

.poster-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.poster-modal-dialog {
  position: relative;
  z-index: 1;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
  width: 100%;
  max-width: 440px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.95);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.poster-modal.open .poster-modal-dialog {
  transform: scale(1);
}

.poster-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-color);
}

.poster-modal-title {
  font-size: 15.5px;
  font-weight: 600;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-main);
}

.poster-modal-close {
  background: transparent;
  border: none;
  font-size: 22px;
  line-height: 1;
  color: var(--text-light);
  cursor: pointer;
  padding: 0 4px;
  transition: color 0.2s ease;
}

.poster-modal-close:hover {
  color: var(--text-main);
}

.poster-modal-body {
  padding: 16px;
  overflow-y: auto;
  text-align: center;
}

.poster-preview-wrap {
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  line-height: 0;
  background: #ffffff;
}

.poster-preview-wrap img {
  width: 100%;
  height: auto;
  display: block;
  transition: opacity 0.2s ease;
}

.poster-modal-tip {
  margin-top: 14px;
  padding: 9px 14px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.5;
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
}

.poster-modal-tip strong {
  color: var(--primary);
}

.poster-modal-footer {
  padding: 12px 18px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: var(--bg-subtle);
}

.poster-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none !important;
}

.poster-toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(15, 23, 42, 0.9);
  color: #ffffff;
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 14px;
  z-index: 10001;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

.poster-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 600px) {
  .post-share-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .post-share-actions {
    width: 100%;
  }
  .btn-share-poster, .btn-copy-link {
    flex: 1;
    justify-content: center;
  }
  .poster-modal-dialog {
    max-height: 94vh;
  }
  .poster-preview-wrap {
    max-width: 260px;
  }
}


