/* ============ 股票分析博客 - 公共样式 ============ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #ffffff;
  --bg-soft: #f6f8fa;
  --text: #1f2328;
  --text-2: #59636e;
  --text-3: #9198a1;
  --border: #e1e4e8;
  --border-soft: #f0f1f3;
  --link: #0969da;
  --link-hover: #0550ae;
  --success: #1a7f37;
  --error: #cf222e;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --mono: SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.75;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: inherit; }

/* ============ Header ============ */
.header {
  height: 56px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 24px;
  position: sticky; top: 0; background: var(--bg); z-index: 100;
}
.header-inner {
  max-width: 760px; margin: 0 auto; width: 100%;
  display: flex; align-items: center; justify-content: space-between;
}
.site-title {
  font-size: 17px; font-weight: 600; color: var(--text);
}
.header-right {
  display: flex; align-items: center; gap: 16px;
}
.admin-link {
  font-size: 13px; color: var(--text-3); cursor: pointer;
  background: none; border: none; padding: 4px 0;
}
.admin-link:hover { color: var(--text-2); }
.new-post-link {
  font-size: 13px; color: var(--link); display: none;
}
.new-post-link.show { display: inline-block; }
.user-badge {
  font-size: 12px; color: var(--success);
  padding: 2px 8px; background: rgba(26,127,55,0.1);
  border-radius: 10px; display: none;
}
.user-badge.show { display: inline-block; }

/* ============ Main ============ */
.main {
  max-width: 760px; margin: 0 auto; padding: 32px 24px 64px;
}

/* ============ Footer ============ */
.footer {
  text-align: center; padding: 24px;
  color: var(--text-3); font-size: 12px;
  border-top: 1px solid var(--border-soft); margin-top: 48px;
}

/* ============ 工具 ============ */
.spinner {
  display: inline-block; width: 16px; height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--link);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty-state {
  padding: 48px 16px; text-align: center;
  color: var(--text-3); font-size: 14px;
}

/* ============ H5 适配 ============ */
@media (max-width: 768px) {
  body { font-size: 16px; }
  .header { padding: 0 16px; height: 52px; }
  .site-title { font-size: 16px; }
  .main { padding: 20px 16px 48px; }
}