:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

  /* 基础尺寸与圆角（克制直角微圆角设计） */
  --radius-xs: 2px;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --site-max-width: 1040px;

  /* 浅色主题色彩 (Light Mode - 沉稳中性纸感) */
  --bg-body: #f8f9fa;
  --bg-card: #ffffff;
  --bg-card-hover: #fcfcfd;
  --bg-subtle: #f1f3f5;
  --bg-input: #ffffff;
  --border-color: #e9ecef;
  --border-color-hover: #d0d7de;
  --border-focus: #18181b;
  --focus-ring: 0 0 0 3px rgba(37, 99, 235, 0.15);

  --text-main: #18181b;
  --text-muted: #64748b;
  --text-subtle: #94a3b8;
  --text-inverse: #ffffff;

  --primary: #18181b;
  --primary-hover: #27272a;
  --primary-subtle: #f1f5f9;
  --primary-text: #ffffff;

  --accent-color: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-subtle: rgba(37, 99, 235, 0.08);
  --badge-top-bg: #ef4444;
  --badge-top-text: #ffffff;

  --shadow-subtle: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.03);
  --shadow-card-hover: 0 6px 16px -2px rgba(0, 0, 0, 0.06), 0 2px 6px -1px rgba(0, 0, 0, 0.03);
  --shadow-dropdown: 0 10px 25px -3px rgba(0, 0, 0, 0.08), 0 4px 8px -2px rgba(0, 0, 0, 0.04);

  --header-height: 62px;
}

/* 深色模式色彩 (Dark Mode - 深邃高质感) */
html[data-theme="dark"] {
  --bg-body: #0b0f14;
  --bg-card: #151a21;
  --bg-card-hover: #1b212b;
  --bg-subtle: #1e2430;
  --bg-input: #11151c;
  --border-color: #262d38;
  --border-color-hover: #3b4454;
  --border-focus: #58a6ff;
  --focus-ring: 0 0 0 3px rgba(88, 166, 255, 0.2);

  --text-main: #f0f6fc;
  --text-muted: #94a3b8;
  --text-subtle: #64748b;
  --text-inverse: #0b0f14;

  --primary: #2d3644;
  --primary-hover: #3a4556;
  --primary-subtle: #1e2430;
  --primary-text: #f0f6fc;

  --accent-color: #58a6ff;
  --accent-hover: #79b8ff;
  --accent-subtle: rgba(88, 166, 255, 0.12);
  --badge-top-bg: #dc2626;
  --badge-top-text: #ffffff;

  --shadow-subtle: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-card-hover: 0 6px 16px -2px rgba(0, 0, 0, 0.4), 0 2px 6px -1px rgba(0, 0, 0, 0.25);
  --shadow-dropdown: 0 10px 25px -3px rgba(0, 0, 0, 0.5), 0 4px 8px -2px rgba(0, 0, 0, 0.3);
}

/* 基础重置与浏览器表面打磨 (Browser Surfaces) */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

::selection {
  background-color: var(--accent-subtle);
  color: var(--text-main);
}

/* 精致自定义滚动条 */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-color-hover);
  border-radius: var(--radius-sm);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-subtle);
}

/* 键盘无障碍焦点 */
:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.65;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  transition: background-color 0.25s ease, color 0.25s ease;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease, opacity 0.15s ease;
}

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

img {
  max-width: 100%;
  height: auto;
  display: block;
}

button, input, textarea, select {
  font-family: inherit;
  font-size: inherit;
}

ul, ol {
  list-style: none;
}

/* 布局容器 */
.neat-container {
  width: 100%;
  max-width: var(--site-max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: 20px;
  padding-right: 20px;
}

.neat-main-wrap {
  flex: 1 0 auto;
  padding-top: 24px;
  padding-bottom: 48px;
}

/* ==========================================================================
   1. 头部导航 (Header & Nav)
   ========================================================================== */
.neat-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  height: var(--header-height);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

.neat-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

/* Logo */
.neat-logo-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.neat-logo-text {
  font-size: 1.18rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.neat-logo-img {
  max-height: 32px;
  width: auto;
  object-fit: contain;
}

.neat-logo-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}

/* 导航链接 */
.neat-nav-desktop {
  display: flex;
  align-items: center;
}

.neat-nav-list {
  display: flex;
  align-items: center;
  gap: 4px;
}

.neat-nav-item {
  position: relative;
  list-style: none;
}

.neat-nav-link-wrap {
  display: inline-flex;
  align-items: center;
}

.neat-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 13px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

.neat-nav-link:hover,
.neat-nav-link.active {
  color: var(--text-main);
  background-color: var(--bg-subtle);
  border-color: var(--border-color);
}

.neat-dropdown-toggle {
  display: none;
}

.neat-caret {
  opacity: 0.55;
  transition: transform 0.2s ease;
}

/* 下拉菜单 */
.neat-dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 148px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 6px 0;
  box-shadow: var(--shadow-dropdown);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
  z-index: 110;
}

.neat-nav-dropdown:hover .neat-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.neat-dropdown-item {
  display: block;
  padding: 8px 16px;
  font-size: 13.5px;
  color: var(--text-muted);
  transition: all 0.15s ease;
}

.neat-dropdown-item:hover {
  color: var(--text-main);
  background-color: var(--bg-subtle);
}

/* 头部右侧操作区 */
.neat-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.neat-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.neat-icon-btn:hover {
  color: var(--text-main);
  border-color: var(--border-color-hover);
  background: var(--bg-subtle);
}

.neat-btn-mobile-toggle {
  display: none;
}

/* 搜索弹出框 */
.neat-search-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 200;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 100px;
}

.neat-search-modal {
  width: 100%;
  max-width: 560px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-dropdown);
  animation: neatModalSlideIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes neatModalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.neat-search-box {
  display: flex;
  gap: 8px;
}

.neat-input {
  width: 100%;
  height: 40px;
  padding: 0 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  outline: none;
  font-size: 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.neat-input:focus {
  border-color: var(--accent-color);
  box-shadow: var(--focus-ring);
}

.neat-textarea {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  outline: none;
  font-size: 14px;
  line-height: 1.6;
  resize: vertical;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.neat-textarea:focus {
  border-color: var(--accent-color);
  box-shadow: var(--focus-ring);
}

.neat-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 18px;
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-subtle);
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.neat-btn:hover {
  background: var(--border-color-hover);
  border-color: var(--border-color-hover);
  color: var(--text-main);
}

.neat-btn:active {
  transform: scale(0.98);
}

.neat-btn-primary {
  background: var(--primary);
  color: var(--primary-text);
  border-color: var(--primary);
}

.neat-btn-primary:hover {
  background: var(--primary-hover);
  color: var(--primary-text);
  border-color: var(--primary-hover);
}

.neat-btn-primary:active {
  transform: scale(0.98);
}

/* 移动端菜单抽屉 */
.neat-mobile-drawer {
  display: none;
}

@media (max-width: 768px) {
  .neat-nav-desktop {
    display: none;
  }
  .neat-btn-mobile-toggle {
    display: inline-flex;
  }
  .neat-mobile-drawer {
    display: block;
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: 100%;
    max-height: calc(100vh - var(--header-height));
    overflow-y: auto;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    padding: 8px 16px 20px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease, visibility 0.25s;
    z-index: 99;
  }
  .neat-mobile-drawer.open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }
  .neat-mobile-drawer .neat-nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    width: 100%;
    margin: 0;
    padding: 0;
  }
  .neat-mobile-drawer .neat-nav-item {
    width: 100%;
    border-bottom: 1px solid var(--border-color);
    list-style: none;
  }
  .neat-mobile-drawer .neat-nav-item:last-child {
    border-bottom: none;
  }
  .neat-mobile-drawer .neat-nav-link-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
  }
  .neat-mobile-drawer .neat-nav-link {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 13px 4px;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-main);
    border: none;
    background: transparent;
    border-radius: 0;
  }
  .neat-mobile-drawer .neat-nav-link:hover,
  .neat-mobile-drawer .neat-nav-link.active {
    color: var(--accent-color);
    background: transparent;
    border-color: transparent;
  }
  .neat-mobile-drawer .neat-dropdown-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
  }
  .neat-mobile-drawer .neat-dropdown-toggle:hover {
    color: var(--text-main);
    background: var(--bg-subtle);
  }
  .neat-mobile-drawer .neat-nav-dropdown.expanded .neat-dropdown-toggle .neat-caret {
    transform: rotate(180deg);
    color: var(--accent-color);
  }
  /* 二级子菜单默认折叠隐藏 */
  .neat-mobile-drawer .neat-dropdown-menu {
    display: none;
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: none;
    border-left: 2px solid var(--accent-color);
    margin: 0 0 10px 8px;
    padding: 2px 0 2px 10px;
    background: var(--bg-subtle);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  }
  /* 展开二级子菜单 */
  .neat-mobile-drawer .neat-nav-dropdown.expanded > .neat-dropdown-menu {
    display: flex;
    flex-direction: column;
    gap: 2px;
  }
  .neat-mobile-drawer .neat-dropdown-item {
    display: block;
    padding: 8px 10px;
    font-size: 13.5px;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
  }
  .neat-mobile-drawer .neat-dropdown-item:hover {
    color: var(--text-main);
    background: var(--bg-card);
  }
}

/* ==========================================================================
   2. 顶部大图 / 推荐展示卡片 (Hero Featured Banner)
   ========================================================================== */
.neat-hero-wrap {
  margin-bottom: 20px;
}

.neat-hero-card {
  position: relative;
  width: 100%;
  height: 290px;
  overflow: hidden;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-subtle);
  box-shadow: var(--shadow-card);
}

.neat-hero-slider {
  position: relative;
  width: 100%;
  height: 100%;
}

.neat-hero-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease;
}

.neat-hero-slide.active {
  opacity: 1;
  visibility: visible;
}

.neat-hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.neat-hero-slide:hover .neat-hero-img {
  transform: scale(1.02);
}

.neat-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.05) 0%, rgba(0, 0, 0, 0.3) 50%, rgba(0, 0, 0, 0.72) 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  padding: 28px 24px;
  text-align: center;
}

.neat-hero-title {
  font-size: 1.45rem;
  font-weight: 700;
  color: #ffffff;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
  letter-spacing: -0.015em;
  line-height: 1.35;
  max-width: 90%;
}

.neat-hero-bar {
  width: 40px;
  height: 3px;
  background: #ffffff;
  margin-top: 12px;
  border-radius: var(--radius-xs);
  opacity: 0.85;
}

.neat-hero-ctrl {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 5;
  transition: background 0.2s ease, transform 0.2s ease;
}

.neat-hero-ctrl:hover {
  background: rgba(0, 0, 0, 0.65);
  transform: translateY(-50%) scale(1.05);
}

.neat-hero-prev {
  left: 14px;
}

.neat-hero-next {
  right: 14px;
}

/* ==========================================================================
   3. 微语与通告动态胶囊栏 (Twitter / Dynamic Notice Bar)
   ========================================================================== */
.neat-notice-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  margin-bottom: 20px;
  font-size: 13.5px;
  box-shadow: var(--shadow-card);
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.neat-notice-bar:hover {
  border-color: var(--border-color-hover);
}

.neat-notice-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.neat-notice-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  background: var(--accent-subtle);
  color: var(--accent-color);
  flex-shrink: 0;
}

.neat-notice-content {
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 450;
}

.neat-notice-content p {
  display: inline;
  margin: 0;
}

.neat-notice-content a {
  color: var(--accent-color);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.neat-notice-right {
  flex-shrink: 0;
}

.neat-notice-link {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  transition: all 0.15s ease;
}

.neat-notice-link:hover {
  color: var(--text-main);
  border-color: var(--border-color-hover);
  background: var(--bg-card-hover);
}

/* ==========================================================================
   4. 文章流单列卡片列表 (Article Feed - Single Column Flow)
   ========================================================================== */
.neat-post-feed {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.neat-post-card {
  display: flex;
  gap: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  box-shadow: var(--shadow-card);
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.neat-post-card:hover {
  border-color: var(--border-color-hover);
  background-color: var(--bg-card-hover);
  box-shadow: var(--shadow-card-hover);
}

/* 缩略图 */
.neat-card-thumb-wrap {
  width: 180px;
  height: 118px;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-subtle);
  position: relative;
}

.neat-card-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.neat-post-card:hover .neat-card-thumb {
  transform: scale(1.04);
}

/* 文章主体 */
.neat-card-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
}

.neat-card-header {
  margin-bottom: 6px;
}

.neat-card-title {
  font-size: 1.14rem;
  font-weight: 650;
  line-height: 1.42;
  color: var(--text-main);
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px;
  letter-spacing: -0.015em;
}

.neat-card-title a {
  color: var(--text-main);
  transition: color 0.15s ease;
}

.neat-card-title a:hover {
  color: var(--accent-color);
}

/* 徽章与分类 */
.neat-badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  padding: 3px 6px;
  border-radius: var(--radius-xs);
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.neat-badge-top {
  background: var(--badge-top-bg);
  color: var(--badge-top-text);
}

.neat-card-sort a {
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  padding: 2px 7px;
  border-radius: var(--radius-xs);
  font-weight: normal;
  transition: all 0.15s ease;
}

.neat-card-sort a:hover {
  color: var(--accent-color);
  border-color: var(--accent-color);
}

.neat-card-desc {
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 12px;
}

/* 元信息 */
.neat-card-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 12.5px;
  color: var(--text-subtle);
  flex-wrap: wrap;
}

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

.neat-meta-item svg {
  opacity: 0.75;
}

/* 移动端文章列表自适应 */
@media (max-width: 640px) {
  .neat-hero-card {
    height: 200px;
  }
  .neat-hero-title {
    font-size: 1.15rem;
  }
  .neat-post-card {
    flex-direction: column;
    gap: 12px;
    padding: 14px;
  }
  .neat-card-thumb-wrap {
    width: 100%;
    height: 160px;
  }
}

/* ==========================================================================
   5. 分页导航 (Pagination)
   ========================================================================== */
.neat-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 36px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.neat-pagination a,
.neat-pagination span,
.neat-pagination em,
.neat-pagination .page-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 12px;
  font-size: 13.5px;
  font-weight: 500;
  font-style: normal;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-main);
  text-decoration: none;
  transition: all 0.15s ease;
  cursor: pointer;
  box-sizing: border-box;
}

.neat-pagination a:hover,
.neat-pagination a.page-item:hover {
  border-color: var(--border-color-hover);
  background: var(--bg-subtle);
  color: var(--text-main);
}

.neat-pagination span,
.neat-pagination .page-item.active {
  background: var(--primary);
  color: var(--primary-text);
  border-color: var(--primary);
  cursor: default;
}

.neat-pagination em,
.neat-pagination .page-ellipsis {
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: default;
  min-width: auto;
  padding: 0 4px;
}

.neat-pagination .disabled,
.neat-pagination .page-item.disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

/* 评论区分页 */
.neat-comment-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.neat-comment-pagination a,
.neat-comment-pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-main);
  text-decoration: none;
  transition: all 0.15s ease;
}

.neat-comment-pagination a:hover {
  border-color: var(--border-color-hover);
  background: var(--bg-subtle);
  color: var(--text-main);
}

.neat-comment-pagination span {
  background: var(--primary);
  color: var(--primary-text);
  border-color: var(--primary);
  cursor: default;
}

/* ==========================================================================
   6. 文章详情页 (Article Detail - echo_log & page)
   ========================================================================== */
.neat-article-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 36px 40px;
  box-shadow: var(--shadow-card);
}

@media (max-width: 640px) {
  .neat-article-wrap {
    padding: 24px 18px;
  }
}

.neat-article-header {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 22px;
  margin-bottom: 28px;
}

.neat-article-title {
  font-size: 1.8rem;
  font-weight: 750;
  line-height: 1.35;
  color: var(--text-main);
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

.neat-article-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: 12px;
}

.neat-article-meta-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.neat-edit-link {
  font-size: 12px;
  color: var(--accent-color);
  background: var(--accent-subtle);
  border: 1px solid transparent;
  padding: 2px 8px;
  border-radius: var(--radius-xs);
  transition: all 0.15s ease;
}

.neat-edit-link:hover {
  border-color: var(--accent-color);
}

/* 文章封面 */
.neat-article-cover {
  margin-bottom: 28px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.neat-article-cover img {
  width: 100%;
  max-height: 440px;
  object-fit: cover;
}

/* 正文 Markdown 排版 - 黄金阅读节奏 */
.neat-content {
  font-size: 16px;
  line-height: 1.8;
  color: var(--text-main);
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.neat-content p {
  margin-bottom: 1.35em;
}

.neat-content h1,
.neat-content h2,
.neat-content h3,
.neat-content h4,
.neat-content h5,
.neat-content h6 {
  color: var(--text-main);
  font-weight: 700;
  margin-top: 2em;
  margin-bottom: 0.75em;
  line-height: 1.38;
  letter-spacing: -0.015em;
}

.neat-content h1 { font-size: 1.6rem; }

.neat-content h2 {
  font-size: 1.38rem;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
}

.neat-content h3 {
  font-size: 1.2rem;
}

.neat-content h4 {
  font-size: 1.08rem;
}

.neat-content blockquote {
  margin: 1.4em 0;
  padding: 12px 18px;
  border-left: 1px solid var(--border-color-hover);
  background: var(--bg-subtle);
  color: var(--text-muted);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 15px;
}

.neat-content blockquote p:last-child {
  margin-bottom: 0;
}

.neat-content code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--accent-color);
}

.neat-content pre {
  margin: 1.4em 0;
  padding: 16px 20px;
  overflow-x: auto;
  border-radius: var(--radius-sm);
  background: #0f141c;
  color: #e6edf3;
  border: 1px solid var(--border-color);
  line-height: 1.6;
}

html[data-theme="dark"] .neat-content pre {
  background: #090d13;
  border-color: #262d38;
}

.neat-content pre code {
  background: transparent;
  border: none;
  padding: 0;
  color: inherit;
  font-size: 13.5px;
}

.neat-content ul,
.neat-content ol {
  margin: 1.1em 0;
  padding-left: 24px;
}

.neat-content ul {
  list-style: disc;
}

.neat-content ol {
  list-style: decimal;
}

.neat-content li {
  margin-bottom: 0.45em;
  line-height: 1.7;
}

.neat-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
  font-size: 14px;
}

.neat-content th,
.neat-content td {
  border: 1px solid var(--border-color);
  padding: 10px 14px;
  text-align: left;
}

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

.neat-content tr:nth-child(even) td {
  background: var(--bg-card-hover);
}

.neat-content img {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  margin: 1.4em auto;
  box-shadow: var(--shadow-card);
}

/* 标签列表 */
.neat-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px dashed var(--border-color);
}

.neat-tag-item {
  font-size: 12.5px;
  color: var(--text-muted);
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  padding: 3px 10px;
  border-radius: var(--radius-xs);
  transition: all 0.15s ease;
}

.neat-tag-item:hover {
  color: var(--accent-color);
  border-color: var(--accent-color);
}

/* 上下篇导航 */
.neat-post-nav {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  margin-top: 32px;
  margin-bottom: 32px;
  width: 100%;
}

@media (max-width: 640px) {
  .neat-post-nav {
    grid-template-columns: minmax(0, 1fr);
  }
}

.neat-post-nav-item {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
  box-sizing: border-box;
  transition: all 0.15s ease;
}

.neat-post-nav-item:hover {
  border-color: var(--border-color-hover);
  background: var(--bg-card-hover);
}

.neat-post-nav-next {
  text-align: right;
}

.neat-post-nav-label {
  font-size: 11.5px;
  font-weight: 500;
  text-transform: uppercase;
  color: var(--text-subtle);
  letter-spacing: 0.04em;
}

.neat-post-nav-title {
  font-size: 14px;
  font-weight: 550;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  width: 100%;
}

.neat-post-nav-title:hover {
  color: var(--accent-color);
}

.neat-post-nav-item.disabled {
  opacity: 0.45;
  cursor: default;
}

/* ==========================================================================
   7. 评论组件 (Comments & Form)
   ========================================================================== */
.neat-comments-list {
  margin-top: 40px;
  padding-top: 28px;
  border-top: 1px solid var(--border-color);
}

.neat-section-title {
  font-size: 1.18rem;
  font-weight: 650;
  color: var(--text-main);
  margin-bottom: 20px;
  letter-spacing: -0.01em;
}

.neat-comment-items {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.neat-comment-card {
  display: flex;
  gap: 14px;
  padding: 16px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s ease;
}

.neat-comment-card:hover {
  border-color: var(--border-color-hover);
}

.neat-comment-avatar img {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.neat-comment-main {
  flex: 1;
  min-width: 0;
}

.neat-comment-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  margin-bottom: 8px;
}

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

.neat-comment-date {
  color: var(--text-subtle);
  font-size: 12px;
}

.neat-comment-reply-btn {
  font-size: 12px;
  font-weight: 500;
  color: var(--accent-color);
  margin-left: auto;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  transition: all 0.15s ease;
}

.neat-comment-reply-btn:hover {
  background: var(--accent-subtle);
}

.neat-comment-body {
  font-size: 14px;
  color: var(--text-main);
  line-height: 1.65;
}

.neat-comment-children {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.neat-comment-child {
  background: var(--bg-card);
}

/* 评论表单 */
.neat-comment-form-container {
  margin-top: 32px;
  padding: 20px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
}

.neat-reply-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 14px;
}

.neat-reply-target {
  font-weight: 600;
}

.neat-cancel-reply {
  font-size: 12px;
  color: var(--accent-color);
  background: none;
  border: none;
  cursor: pointer;
  margin-left: auto;
}

.neat-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

@media (max-width: 640px) {
  .neat-form-row {
    grid-template-columns: 1fr;
  }
}

.neat-form-col,
.neat-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.neat-form-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}

.neat-required {
  color: #dc2626;
}

.neat-form-user-tip {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.neat-verify-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.neat-verify-input {
  max-width: 140px;
}

.neat-form-action {
  display: flex;
  justify-content: flex-end;
}

/* ==========================================================================
   8. 动态 / 微语独立页面 (page_t.php)
   ========================================================================== */
.neat-dynamic-wrap {
  width: 100%;
}

.neat-dynamic-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px 28px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 16px;
  box-shadow: var(--shadow-card);
}

.neat-dynamic-title {
  font-size: 1.6rem;
  font-weight: 750;
  color: var(--text-main);
  line-height: 1.3;
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}

.neat-dynamic-subtitle {
  font-size: 13.5px;
  color: var(--text-muted);
}

.neat-dynamic-subtitle strong {
  color: var(--text-main);
}

.neat-twitter-user {
  display: flex;
  align-items: center;
}

.neat-twitter-feed {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.neat-twitter-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px 22px;
  display: flex;
  gap: 16px;
  box-shadow: var(--shadow-card);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.neat-twitter-item:hover {
  border-color: var(--border-color-hover);
  box-shadow: var(--shadow-card-hover);
}

.neat-twitter-avatar img {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.neat-twitter-main {
  flex: 1;
  min-width: 0;
}

.neat-twitter-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.neat-twitter-author {
  font-weight: 600;
  font-size: 14.5px;
  color: var(--text-main);
}

.neat-twitter-time {
  font-size: 12px;
  color: var(--text-subtle);
}

.neat-twitter-text {
  font-size: 15px;
  line-height: 1.75;
  color: var(--text-main);
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.neat-twitter-text p {
  margin-bottom: 10px;
}

.neat-twitter-text p:last-child {
  margin-bottom: 0;
}

.neat-twitter-text blockquote {
  margin: 12px 0;
  padding: 10px 16px;
  background: var(--bg-subtle);
  border-left: 1px solid var(--border-color-hover);
  border-radius: var(--radius-xs);
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.65;
}

.neat-twitter-text blockquote p {
  margin-bottom: 6px;
}

.neat-twitter-text blockquote p:last-child {
  margin-bottom: 0;
}

.neat-twitter-text img {
  max-width: 100%;
  max-height: 380px;
  height: auto;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  margin: 10px 0;
  display: block;
  transition: all 0.15s ease;
}

.neat-twitter-text img:hover {
  border-color: var(--border-focus);
}

.neat-twitter-text code {
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  color: var(--accent-color);
}

.neat-twitter-text pre {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  overflow-x: auto;
  margin: 12px 0;
}

.neat-twitter-text pre code {
  background: transparent;
  border: none;
  padding: 0;
  color: var(--text-main);
}

.neat-twitter-text a {
  color: var(--accent-color);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.neat-twitter-text a:hover {
  opacity: 0.85;
}

.neat-twitter-text ul,
.neat-twitter-text ol {
  margin: 10px 0;
  padding-left: 22px;
}

.neat-twitter-text ul {
  list-style: disc;
}

.neat-twitter-text ol {
  list-style: decimal;
}

.neat-twitter-text li {
  margin-bottom: 4px;
}

.neat-twitter-text h1,
.neat-twitter-text h2,
.neat-twitter-text h3,
.neat-twitter-text h4 {
  font-weight: 650;
  color: var(--text-main);
  margin: 14px 0 8px 0;
  line-height: 1.4;
}

.neat-twitter-text h1 { font-size: 1.25rem; }
.neat-twitter-text h2 { font-size: 1.15rem; }
.neat-twitter-text h3 { font-size: 1.05rem; }
.neat-twitter-text h4 { font-size: 1rem; }

.neat-twitter-text table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 13.5px;
}

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

.neat-twitter-text th {
  background: var(--bg-subtle);
  font-weight: 600;
}

.neat-twitter-img-wrap {
  margin-top: 12px;
  max-width: 460px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.neat-twitter-img-wrap img {
  width: 100%;
  max-height: 380px;
  object-fit: cover;
  display: block;
}

/* ==========================================================================
   9. 边栏小工具 (Side Widgets)
   ========================================================================== */
.neat-widget {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-card);
}

.neat-widget-head {
  padding-bottom: 10px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.neat-widget-title {
  font-size: 14px;
  font-weight: 650;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.neat-widget-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13.5px;
}

.neat-widget-list li {
  line-height: 1.5;
}

.neat-widget-sorts li a,
.neat-widget-list li a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-muted);
  padding: 4px 6px;
  border-radius: var(--radius-xs);
  transition: all 0.15s ease;
}

.neat-widget-list li a:hover {
  color: var(--text-main);
  background: var(--bg-subtle);
}

.neat-count-badge {
  font-size: 11px;
  padding: 1px 6px;
  border-radius: var(--radius-xs);
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-subtle);
}

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

.neat-search-form {
  display: flex;
  gap: 8px;
}

.neat-btn-search {
  background: var(--primary);
  color: var(--primary-text);
  border-color: var(--primary);
}

.neat-btn-search:hover {
  background: var(--primary-hover);
  color: var(--primary-text);
}

.neat-widget-blogger {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 8px 0;
}

.neat-blogger-avatar {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  margin-bottom: 10px;
}

.neat-blogger-name {
  font-size: 15px;
  font-weight: 650;
  color: var(--text-main);
}

.neat-blogger-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 6px;
  line-height: 1.55;
}

/* ==========================================================================
   10. 页脚 (Footer)
   ========================================================================== */
.neat-footer {
  margin-top: auto;
  background-color: var(--bg-card);
  border-top: 1px solid var(--border-color);
  padding: 28px 0 32px;
  font-size: 13px;
  color: var(--text-muted);
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

/* 友情链接模块 */
.neat-footer-friendlinks {
  margin-bottom: 22px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
}

.neat-friendlinks-header {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
}

.neat-friendlinks-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 650;
  color: var(--text-main);
  letter-spacing: 0.02em;
}

.neat-friendlinks-title svg {
  color: var(--text-muted);
}

.neat-friendlinks-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
}

.neat-friendlink-item {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  color: var(--text-muted);
  padding: 4px 11px;
  border-radius: var(--radius-xs);
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.neat-friendlink-item:hover {
  color: var(--accent-color);
  border-color: var(--accent-color);
  background: var(--bg-card-hover);
}

.neat-footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
}

.neat-footer-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.neat-footer-links {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.neat-footer-pill {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  padding: 3px 10px;
  border-radius: var(--radius-xs);
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
}

.neat-footer-pill:hover {
  color: var(--text-main);
  border-color: var(--border-color-hover);
}

.neat-footer-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.neat-footer-meta {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
  font-size: 12px;
  color: var(--text-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.neat-footer-copy {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.neat-footer-engine {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.neat-footer-badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--radius-xs);
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

/* 侧边悬浮返回顶部与主题切换 */
.neat-float-tools {
  position: fixed;
  right: 22px;
  bottom: 26px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 90;
}

.neat-float-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
  box-shadow: var(--shadow-dropdown);
  transition: all 0.15s ease;
}

.neat-float-btn:hover {
  color: var(--text-main);
  border-color: var(--border-color-hover);
  background: var(--bg-subtle);
  transform: translateY(-2px);
}

/* 提示与空状态 */
.neat-empty-state {
  text-align: center;
  padding: 56px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 14.5px;
  box-shadow: var(--shadow-card);
}

/* 登录 / 注册 / 找回密码 模态弹窗样式 */
body.scroll-fix,
html.scroll-fix {
  overflow: hidden !important;
}

.auth-modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  z-index: 1090;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-modal-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.18);
  padding: 26px 24px;
  position: relative;
  animation: neatModalFadeIn 0.18s ease-out;
}

@keyframes neatModalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.auth-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-muted);
  font-size: 18px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.auth-modal-close:hover {
  color: var(--text-main);
  background: var(--bg-subtle);
  border-color: var(--border-color-hover);
}

.auth-modal-head h3 {
  margin-bottom: 16px;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.auth-modal-alert {
  display: none;
  margin-bottom: 14px;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 13.5px;
  line-height: 1.45;
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.auth-modal-alert.show {
  display: block;
}

.auth-modal-alert.success {
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
  border-color: rgba(16, 185, 129, 0.2);
}

.auth-form-row {
  margin-bottom: 12px;
}

.auth-form-row input {
  width: 100%;
}

.auth-captcha-row,
.auth-inline-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.auth-captcha-row input,
.auth-inline-row input {
  flex: 1;
}

.auth-captcha-row img {
  width: 100px;
  height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  cursor: pointer;
  background: var(--bg-input);
  display: block;
  object-fit: cover;
}

.auth-inline-btn {
  height: 38px;
  line-height: 1;
  white-space: nowrap;
  padding: 0 12px;
  font-size: 13px;
  border-radius: var(--radius-sm);
}

.auth-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--text-muted);
  margin: 4px 0 14px;
  cursor: pointer;
  user-select: none;
}

.auth-checkbox input {
  width: 15px;
  height: 15px;
  cursor: pointer;
}

.auth-submit {
  width: 100%;
  height: 40px;
  margin-top: 4px;
}

.auth-submit:disabled,
.auth-inline-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.auth-modal-switch {
  margin-top: 14px;
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 13.5px;
}

.auth-modal-switch a {
  color: var(--accent-color);
  text-decoration: none;
}

.auth-modal-switch a:hover {
  text-decoration: underline;
}

.auth-login-ext {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.auth-login-ext a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.auth-login-ext img {
  max-height: 28px;
  border-radius: var(--radius-sm);
}

@media (max-width: 576px) {
  .auth-modal {
    align-items: flex-end;
    padding: 0;
  }

  .auth-modal-card {
    max-width: none;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    padding: 22px 18px calc(env(safe-area-inset-bottom, 0px) + 20px);
    max-height: 88vh;
    overflow-y: auto;
  }

  .auth-inline-row {
    flex-direction: column;
    align-items: stretch;
  }

  .auth-inline-btn {
    width: 100%;
  }
}
