/* Minimal clean styles with auto dark mode */
:root {
  --bg: #ffffff;
  --bg-secondary: #f5f5f5;
  --text: #1a1a1a;
  --text-muted: #666666;
  --border: #e0e0e0;
  --accent: #0066cc;
  --accent-hover: #0052a3;
  --highlight: #fff3cd;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1a1a1a;
    --bg-secondary: #2a2a2a;
    --text: #e0e0e0;
    --text-muted: #999999;
    --border: #404040;
    --accent: #66b3ff;
    --accent-hover: #99ccff;
    --highlight: #3d3d00;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  background: var(--bg);
  color: var(--text);
}

/* Two-column layout */
.container {
  display: flex;
  height: 100vh;
}

/* Left column: search + list */
.sidebar {
  width: 380px;
  min-width: 300px;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  background: var(--bg-secondary);
}

.search-box {
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

.search-box input {
  width: 100%;
  padding: 10px 14px;
  font-size: 15px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  outline: none;
}

.search-box input:focus {
  border-color: var(--accent);
}

.search-box input::placeholder {
  color: var(--text-muted);
}

.results-count {
  padding: 8px 16px;
  font-size: 13px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.article-list {
  flex: 1;
  overflow-y: auto;
}

.article-item {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
}

.article-item:hover {
  background: var(--bg);
}

.article-item.selected {
  background: var(--bg);
  border-left: 3px solid var(--accent);
  padding-left: 13px;
}

.article-item .date {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.article-item .title {
  font-weight: 500;
  line-height: 1.4;
}

.article-item .keywords {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  font-style: italic;
}

/* Right column: article content */
.content {
  flex: 1;
  overflow-y: auto;
  padding: 32px 48px;
  max-width: 800px;
}

.content.empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.content h1 {
  font-size: 24px;
  font-weight: 600;
  margin: 0 0 16px 0;
  line-height: 1.3;
}

.content .meta {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.content .meta a {
  color: var(--accent);
  text-decoration: none;
}

.content .meta a:hover {
  text-decoration: underline;
}

.content .body {
  line-height: 1.7;
}

.content .body h2 {
  font-size: 20px;
  font-weight: 600;
  margin: 28px 0 12px 0;
}

.content .body h3 {
  font-size: 17px;
  font-weight: 600;
  margin: 24px 0 10px 0;
}

.content .body p {
  margin: 0 0 16px 0;
}

.content .body a {
  color: var(--accent);
}

.content .body blockquote {
  margin: 16px 0;
  padding: 12px 20px;
  border-left: 3px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text-muted);
}

.content .body ul, .content .body ol {
  margin: 0 0 16px 0;
  padding-left: 24px;
}

.content .body li {
  margin-bottom: 6px;
}

/* Search highlighting */
mark {
  background: var(--highlight);
  padding: 1px 2px;
  border-radius: 2px;
}

/* Responsive: stack on mobile */
@media (max-width: 768px) {
  .container {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    height: 50vh;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .content {
    padding: 24px;
  }
}
