/* 全局样式 */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #fafafa;
  --fg: #0a0a0a;
  --border: #e5e5e5;
  --shadow: rgba(0,0,0,0.04);
  --accent: #0a0a0a;
  --muted: #737373;
  --hover-bg: #f5f5f5;
  --code-bg: #f5f5f5;
  --primary: #3498db;
  --card-bg: #ffffff;
  --text: #0a0a0a;
  --info-bg: #e3f2fd;
  --info: #1976d2;
}

/* @media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0a0a;
    --fg: #fafafa;
    --border: #262626;
    --shadow: rgba(255,255,255,0.03);
    --accent: #ffffff;
    --muted: #a3a3a3;
    --hover-bg: #171717;
    --code-bg: #171717;
  }
} */

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
  min-height: 100vh;
}

/* @media (prefers-color-scheme: dark) {
  body::before {
    opacity: 0.12;
  }
} */

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 24px;
  position: relative;
  z-index: 1;
}

a {
  color: var(--fg);
  text-decoration: none;
  transition: opacity 0.15s ease;
}

a:hover { 
  opacity: 0.7; 
}

header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 48px;
  background: rgba(250, 250, 250, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
}

header h1 {
  font-size: 18px;
  font-weight: 600;
}

header h1 a {
  color: var(--fg);
  text-decoration: none;
}

header a { 
  opacity: 1; 
}

header a:hover { 
  opacity: 0.6; 
}

.logout-link {
  color: #0d0d0d;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  padding: 7px 18px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 9999px;
  transition: all 0.15s ease;
}

.logout-link:hover {
  background: #f5f5f5;
  color: #0d0d0d;
}

main { 
  line-height: 1.75; 
}

h2 {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 24px;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.1em;
}

.post-list {
  display: grid;
  gap: 8px;
  padding: 0;
  list-style: none;
  margin: 0 0 48px;
}

.post-item {
  padding: 20px 24px;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.post-item:hover {
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12), 0 0 0 1px #e5e5e5;
  transform: translateY(-2px);
}

.post-title {
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.015em;
  display: block;
  margin-bottom: 6px;
}

.post-meta {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
}

article h1 {
  margin: 0 0 8px;
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.64px;
  line-height: 1.2;
}

article h2 {
  font-size: 24px;
  font-weight: 600;
  margin: 36px 0 16px;
  letter-spacing: -0.24px;
  color: var(--fg);
  text-transform: none;
}

article h3 {
  font-size: 18px;
  font-weight: 600;
  margin: 28px 0 12px;
  letter-spacing: -0.01em;
}

article p { 
  margin: 16px 0; 
}

article ul, article ol { 
  margin: 16px 0; 
  padding-left: 24px; 
}

article li { 
  margin: 8px 0; 
}

pre {
  padding: 20px 24px;
  overflow-x: auto;
  border-radius: 12px;
  background: #1e1e2e;
  border: 1px solid rgba(0, 0, 0, 0.05);
  font-size: 14px;
  line-height: 1.6;
  margin: 24px 0;
  color: #e0e0e0;
}

code {
  font-family: "Geist Mono", "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", Consolas, monospace;
  font-size: 0.9em;
}

:not(pre) > code {
  background: #f5f5f5;
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.05);
  font-size: 0.88em;
  color: #0d0d0d;
}

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 48px 0;
}

blockquote {
  margin: 24px 0;
  padding: 16px 20px;
  border-left: 3px solid #18E299;
  background: rgba(24, 226, 153, 0.04);
  border-radius: 0 8px 8px 0;
  color: #333333;
  font-style: normal;
}

/* 登录页面样式 */
.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(168, 85, 247, 0.05) 100%);
  padding: 120px 24px 48px;
  position: relative;
}

.auth-card {
  width: min(400px, 90vw);
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 24px;
  padding: 40px 32px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: rgba(0, 0, 0, 0.03) 0px 2px 4px;
  position: relative;
  z-index: 1;
}

.auth-title {
  margin: 0 0 8px;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.auth-sub {
  margin: 0 0 32px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.field {
  display: grid;
  gap: 8px;
  margin: 0 0 20px;
}

.label {
  font-size: 13px;
  font-weight: 500;
  color: var(--fg);
  letter-spacing: -0.01em;
}

.input {
  width: 100%;
  padding: 12px 16px;
  border-radius: 9999px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: #ffffff;
  color: #0d0d0d;
  font-size: 15px;
  transition: all 0.15s ease;
  font-family: inherit;
}

.input:focus {
  outline: none;
  border-color: #18E299;
  box-shadow: 0 0 0 2px rgba(24, 226, 153, 0.15);
}

.btn {
  width: 100%;
  padding: 12px 14px;
  border-radius: 9999px;
  border: none;
  background: #0d0d0d;
  color: #ffffff;
  cursor: pointer;
  font-weight: 500;
  font-size: 15px;
  transition: opacity 0.15s ease;
  margin-top: 8px;
  font-family: inherit;
  box-shadow: rgba(0, 0, 0, 0.06) 0px 1px 2px;
}

.btn:hover {
  opacity: 0.9;
}

.btn:active { 
  opacity: 0.85;
}

.error {
  margin: 20px 0 0;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid rgba(212, 86, 86, 0.2);
  background: rgba(212, 86, 86, 0.06);
  color: #d45656;
  font-size: 13px;
}

.search-box { 
  margin: 0 0 24px; 
}

.search-input {
  width: 100%;
  padding: 14px 18px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--fg);
  font-size: 15px;
  transition: all 0.2s ease;
  font-family: inherit;
}

.search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--shadow);
}

.search-input::placeholder {
  color: var(--muted);
  opacity: 0.6;
}

.no-results {
  padding: 48px 24px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

.hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.back-btn {
  text-decoration: none;
  position: fixed;
  bottom: 32px;
  right: 32px;
  padding: 12px 20px;
  background: var(--accent);
  color: var(--bg);
  border-radius: 24px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 4px 16px var(--shadow), 0 2px 8px rgba(0,0,0,0.1);
  transition: all 0.2s ease;
  z-index: 100;
  border: 1px solid var(--accent);
}

.back-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--shadow), 0 4px 12px rgba(0,0,0,0.15);
  opacity: 1;
}

.back-btn:active {
  transform: translateY(0);
}

@media (max-width: 640px) {
  .back-btn {
    bottom: 20px;
    right: 20px;
    padding: 10px 16px;
    font-size: 13px;
  }
}

.home-btn {
  text-decoration: none;
  position: fixed;
  bottom: 88px;
  right: 32px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: var(--bg);
  border-radius: 50%;
  font-size: 20px;
  box-shadow: 0 4px 16px var(--shadow), 0 2px 8px rgba(0,0,0,0.1);
  transition: all 0.2s ease;
  z-index: 100;
  border: 1px solid var(--accent);
}

.home-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--shadow), 0 4px 12px rgba(0,0,0,0.15);
  opacity: 1;
}

.home-btn:active {
  transform: translateY(0);
}

@media (max-width: 640px) {
  .home-btn {
    bottom: 76px;
    right: 20px;
    width: 44px;
    height: 44px;
    font-size: 18px;
  }
}

@media (max-width: 640px) {
  .auth-card {
    padding: 28px 20px;
  }
}
