
:root {
  --primary: #e74c3c;
  --primary-dark: #c0392b;
  --bg: #fafafa;
  --card: #fff;
  --text: #2c3e50;
  --text-light: #7f8c8d;
  --border: #ecf0f1;
  --level-a: #e74c3c;
  --level-b: #f39c12;
  --level-c: #2ecc71;
  --level-d: #95a5a6;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
}

.container { max-width: 1000px; margin: 0 auto; padding: 0 20px; }

/* Header */
.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
  position: sticky; top: 0; z-index: 100;
  box-shadow: var(--shadow);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; }
.logo { font-size: 1.2em; font-weight: 700; color: var(--primary); text-decoration: none; }
.logo span { color: var(--text); font-weight: 400; font-size: 0.85em; }
nav a { color: var(--text); text-decoration: none; margin-left: 24px; font-size: 0.95em; }
nav a:hover { color: var(--primary); }

/* Hero */
.hero { text-align: center; padding: 60px 20px 40px; }
.hero h1 { font-size: 2.2em; color: var(--primary-dark); margin-bottom: 12px; }
.hero-desc { font-size: 1.1em; color: var(--text-light); margin-bottom: 28px; }
.hero-search { display: flex; max-width: 560px; margin: 0 auto 16px; gap: 8px; }
.hero-search input { flex: 1; padding: 12px 16px; border: 2px solid var(--border); border-radius: var(--radius); font-size: 1em; }
.hero-search input:focus { border-color: var(--primary); outline: none; }
.hero-search button { padding: 12px 24px; background: var(--primary); color: #fff; border: none; border-radius: var(--radius); cursor: pointer; font-size: 1em; }
.hero-search button:hover { background: var(--primary-dark); }
.hero-cta a { color: var(--primary); text-decoration: none; margin: 0 4px; }
.hero-cta a:hover { text-decoration: underline; }

/* Subject Grid */
.subjects-section, .top-articles, .laws-section { padding: 40px 0; border-top: 1px solid var(--border); }
.subjects-section h2, .top-articles h2, .laws-section h2 { margin-bottom: 20px; font-size: 1.4em; }
.subject-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.subject-card, .law-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.subject-card h3 a, .law-card h4 a { color: var(--primary-dark); text-decoration: none; }
.subject-card h3 a:hover, .law-card h4 a:hover { text-decoration: underline; }
.level-stats { margin-top: 8px; display: flex; gap: 8px; flex-wrap: wrap; font-size: 0.85em; }

/* Badges */
.badge { display: inline-block; padding: 2px 8px; border-radius: 12px; font-size: 0.8em; font-weight: 600; }
.level-a, .badge.level-a { background: #fde8e8; color: var(--level-a); }
.level-b, .badge.level-b { background: #fef3e2; color: var(--level-b); }
.level-c, .badge.level-c { background: #e8f8f0; color: var(--level-c); }
.level-d, .badge.level-d { background: #f0f0f0; color: var(--level-d); }

/* Article List */
.article-list { list-style: none; }
.article-list li {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.article-list li:hover { background: #f8f9fa; }
.article-list li a { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); flex: 1; min-width: 0; }
.article-list li a:hover .law-key { color: var(--primary); }
.law-key { font-family: 'SF Mono', 'Fira Code', monospace; font-size: 0.85em; color: var(--primary-dark); white-space: nowrap; font-weight: 600; }
.law-desc, .law-title { color: var(--text); }
.meta { font-size: 0.82em; color: var(--text-light); white-space: nowrap; }
.more-link { margin-top: 16px; }
.more-link a { color: var(--primary); text-decoration: none; }

/* Law Page */
.law-page h1 { font-size: 1.6em; margin-bottom: 16px; }
.law-meta { color: var(--text-light); margin-bottom: 24px; }
.article-cards { display: flex; flex-direction: column; gap: 20px; }
.article-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.article-card h3 { font-size: 1.1em; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.article-card h3 a { color: var(--primary-dark); text-decoration: none; }
.article-desc { color: var(--text); font-weight: 400; font-size: 0.95em; }
.article-text { background: #f8f9fa; padding: 16px; border-radius: 6px; font-size: 0.95em; line-height: 1.8; margin-bottom: 12px; border-left: 3px solid var(--primary); }
.article-meta { font-size: 0.82em; color: var(--text-light); display: flex; gap: 16px; flex-wrap: wrap; }

/* Article Page */
.breadcrumb { font-size: 0.9em; color: var(--text-light); padding: 16px 0; }
.breadcrumb a { color: var(--primary); text-decoration: none; }
.article-page h1 { font-size: 1.5em; margin-bottom: 16px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.article-key { font-family: monospace; background: var(--primary); color: #fff; padding: 4px 12px; border-radius: 4px; font-size: 0.85em; }
.article-title-desc { font-weight: 400; }
.article-meta-bar { display: flex; gap: 16px; flex-wrap: wrap; font-size: 0.9em; color: var(--text-light); margin-bottom: 16px; }
.subject-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.tag { display: inline-block; padding: 4px 12px; background: #eef2ff; color: #4f46e5; border-radius: 16px; font-size: 0.85em; text-decoration: none; }
.tag:hover { background: #dde4ff; }
.fulltext-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.fulltext-card h2 { font-size: 1.1em; margin-bottom: 16px; color: var(--primary-dark); }
.fulltext-content { font-size: 1.05em; line-height: 2; background: #fefefe; padding: 20px; border-radius: 6px; border: 1px solid #f0f0f0; }

/* Search Page */
.search-page h1 { margin-bottom: 20px; }
.search-filters { display: flex; gap: 12px; margin-bottom: 24px; flex-wrap: wrap; }
.search-input { flex: 1; min-width: 250px; padding: 12px 16px; border: 2px solid var(--border); border-radius: var(--radius); font-size: 1em; }
.search-input:focus { border-color: var(--primary); outline: none; }
.filter-select { padding: 12px; border: 2px solid var(--border); border-radius: var(--radius); font-size: 0.95em; background: var(--card); }
.search-hint { color: var(--text-light); font-size: 1.1em; text-align: center; padding: 40px 0; }
.search-hint a { color: var(--primary); }
.no-results { text-align: center; color: var(--text-light); padding: 40px 0; }
.result-count { font-size: 0.9em; color: var(--text-light); margin-bottom: 12px; }
.search-result-list { list-style: none; }
.search-result-item {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px;
}
.search-result-item:hover { background: #f8f9fa; }
.result-link { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); flex: 1; min-width: 0; }
.result-link:hover .result-key { color: var(--primary); }
.result-key { font-family: monospace; color: var(--primary-dark); font-weight: 600; white-space: nowrap; }
.result-meta { display: flex; gap: 10px; align-items: center; font-size: 0.82em; color: var(--text-light); flex-wrap: wrap; }
.result-law { color: var(--text-light); max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Law Grid */
.law-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }

/* Footer */
.site-footer { background: var(--card); border-top: 1px solid var(--border); padding: 24px 0; margin-top: 60px; text-align: center; font-size: 0.85em; color: var(--text-light); }
.site-footer p { margin: 4px 0; }
.site-footer a { color: var(--primary); text-decoration: none; }

/* Responsive */
@media (max-width: 640px) {
  .hero h1 { font-size: 1.5em; }
  .subject-grid, .law-grid { grid-template-columns: 1fr; }
  nav a { margin-left: 12px; font-size: 0.85em; }
  .article-meta-bar { flex-direction: column; gap: 8px; }
}
