/* ============================================================
   WLinfoBlue - Global Styles
   全局基础样式
   ============================================================ */

/* ----------------------------------------------------------
   字体加载
   ---------------------------------------------------------- */

/* Inter - 英文/数字（由 fonts.loli.net CSS 加载，此处仅声明 fallback） */

/* 思源黑体 - 中文（系统字体 fallback） */
@font-face {
  font-family: 'Source Han Sans CN';
  src:
    local('Source Han Sans CN'),
    local('Noto Sans CJK SC'),
    local('Microsoft YaHei');
  font-display: swap;
}

/* ----------------------------------------------------------
   CSS Reset（精简版）
   ---------------------------------------------------------- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family:
    'Inter',
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    'Source Han Sans CN',
    'Noto Sans CJK SC',
    'Microsoft YaHei',
    sans-serif;
  font-size: var(--text-body);
  font-weight: var(--font-normal);
  line-height: var(--line-height-normal);
  color: var(--text-primary);
  background-color: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ----------------------------------------------------------
   版心容器
   ---------------------------------------------------------- */
.container {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* ----------------------------------------------------------
   通用排版
   ---------------------------------------------------------- */
h1 { font-size: var(--text-h1); font-weight: var(--font-bold); line-height: var(--line-height-tight); }
h2 { font-size: var(--text-h2); font-weight: var(--font-bold); line-height: var(--line-height-tight); }
h3 { font-size: var(--text-h3); font-weight: var(--font-semibold); line-height: var(--line-height-tight); }
h4 { font-size: var(--text-h4); font-weight: var(--font-semibold); line-height: var(--line-height-tight); }

p {
  margin-bottom: var(--spacing-sm);
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

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

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

ul,
ol {
  list-style: none;
}

button {
  font-family: inherit;
  font-size: inherit;
  border: none;
  background: none;
  cursor: pointer;
  color: inherit;
}

input {
  font-family: inherit;
  font-size: inherit;
  border: none;
  outline: none;
}

/* ----------------------------------------------------------
   占位图（无图文章）
   ---------------------------------------------------------- */
.placeholder-image {
  width: 240px;
  height: 135px;
  background: linear-gradient(
    135deg,
    rgba(123, 167, 217, 0.1) 0%,
    rgba(123, 167, 217, 0.3) 100%
  );
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.placeholder-logo {
  font-size: 32px;
  font-weight: var(--font-bold);
  color: var(--primary);
  font-family: 'Inter', sans-serif;
}

/* ----------------------------------------------------------
   文章正文排版（详情页/Markdown 渲染）
   ---------------------------------------------------------- */
.article-content {
  font-size: var(--text-body);
  line-height: var(--line-height-loose);
  color: var(--text-primary);
}

.article-content p {
  margin-bottom: var(--spacing-md);
  text-indent: 0;
}

.article-content h2 {
  font-size: var(--text-h3);
  margin-top: var(--spacing-lg);
  margin-bottom: var(--spacing-sm);
  color: var(--primary);
}

.article-content h3 {
  font-size: var(--text-h4);
  margin-top: var(--spacing-md);
  margin-bottom: var(--spacing-sm);
  color: var(--primary);
}

.article-content img {
  max-width: 100%;
  margin: var(--spacing-md) auto;
  border-radius: var(--radius-sm);
  display: block;
}

.article-content figcaption {
  font-size: var(--text-small);
  color: var(--text-tertiary);
  text-align: center;
  margin-top: var(--spacing-xs);
}

.article-content pre {
  background: var(--bg-primary);
  padding: var(--spacing-md);
  border-radius: var(--radius-sm);
  overflow-x: auto;
  margin-bottom: var(--spacing-md);
}

.article-content code {
  font-family: 'Courier New', monospace;
  font-size: var(--text-small);
}

.article-content blockquote {
  border-left: 3px solid var(--primary);
  padding-left: var(--spacing-md);
  margin: var(--spacing-md) 0;
  color: var(--text-secondary);
}

.article-content ul,
.article-content ol {
  padding-left: var(--spacing-lg);
  margin-bottom: var(--spacing-md);
}

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

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

/* ----------------------------------------------------------
   加载动画（简约）
   ---------------------------------------------------------- */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.loading-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border-light);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ----------------------------------------------------------
   无障碍：焦点指示器
   ---------------------------------------------------------- */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ----------------------------------------------------------
   屏幕阅读器专用（sr-only）
   ---------------------------------------------------------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}
