/* Artof - Permanent Light Theme */
:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f6f8fa;
  --bg-card: #ffffff;
  --text-main: #0f172a;
  --text-muted: #475569;
  --accent: #D5081B;
  --accent-hover: #b50717;
  --border: #e2e8f0;
  --border-subtle: #f1f5f9;
  --radius: 12px;
  --max-width: 760px;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.04), 0 4px 6px -4px rgba(0, 0, 0, 0.02);
  --font-sans: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-serif: 'IBM Plex Serif', Georgia, serif;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-secondary) !important;
  color: var(--text-main) !important;
  line-height: 1.75;
  padding: clamp(1rem, 3vw, 3rem) clamp(0.75rem, 2vw, 1.5rem);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

.page-wrapper {
  max-width: var(--max-width);
  margin: 0 auto;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  background: var(--bg-primary) !important;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 2rem;
  position: sticky;
  top: 1rem;
  z-index: 100;
  backdrop-filter: blur(12px);
}

.brand {
  font-weight: 600;
  font-size: 1.6rem;
  letter-spacing: -0.02em;
  color: var(--text-main);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  transition: opacity 0.2s ease;
}

.brand:hover {
  opacity: 0.85;
}

.brand svg {
  height: 20px; /* 控制 Logo 高度与文字相匹配 */
  width: auto;  /* 宽度自适应，保持原比例 */
  flex-shrink: 0;
}

nav {
  display: flex;
  gap: clamp(0.75rem, 2vw, 1.5rem);
  align-items: center;
}

nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.925rem;
  font-weight: 500;
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  transition: color 0.15s ease, background-color 0.15s ease;
}

nav a:hover, nav a.active {
  color: var(--accent);
  background-color: var(--border-subtle);
}

main {
  background: var(--bg-card) !important;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 5vw, 3rem);
  box-shadow: var(--shadow-md);
  will-change: transform;
}

h1, h2, h3 {
  font-family: var(--font-serif);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-main);
  margin-bottom: 1rem;
}

h1 {
  font-size: clamp(1.4rem, 4vw, 2.0rem);
  line-height: 1.25;
  margin-bottom: 1rem;
}

h2 {
  font-size: clamp(1.3rem, 3vw, 1.6rem);
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

p {
  margin-bottom: 1.25rem;
  color: var(--text-main);
  font-size: 1rem;
}

.lead {
  font-size: clamp(0.95rem, 2vw, 1rem);
  color: var(--text-muted);
  margin-bottom: 2rem;
  line-height: 1.7;
}

.post-list {
  list-style: none;
  display: grid;
  gap: 1rem;
}

.post-item {
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-primary) !important;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s ease, box-shadow 0.2s ease;
}

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

.post-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.post-title {
  font-size: 1.1rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--text-main);
  display: block;
  transition: color 0.15s ease;
}

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

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  transition: opacity 0.15s ease;
}

.back-link:hover {
  opacity: 0.8;
}

footer {
  margin-top: 3rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 1.5rem 0;
}

@media (max-width: 640px) {
  header {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
    padding: 1rem;
    position: static;
  }
  nav {
    justify-content: space-between;
    width: 100%;
    overflow-x: auto;
    padding-bottom: 0.25rem;
  }
  nav a {
    font-size: 0.875rem;
    padding: 0.25rem 0.4rem;
  }
  main {
    padding: 1.25rem;
  }
}

/* Markdown Table Styles */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.95rem;
  overflow-x: auto;
  display: block;
}

th, td {
  border: 1px solid var(--border);
  padding: 0.75rem 1rem;
  text-align: left;
}

th {
  background-color: var(--bg-secondary);
  font-weight: 600;
  color: var(--text-main);
}

tr:nth-child(even) {
  background-color: var(--bg-secondary);
}
