/* 破产重整知识库样式 */
:root {
  --primary: #1e3a5f;
  --accent: #3b82f6;
  --bg: #f8fafc;
  --sidebar-bg: #1e293b;
  --sidebar-text: #cbd5e1;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --card-bg: #ffffff;
  --max-width: 900px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
}

.layout {
  display: flex;
  min-height: 100vh;
}

/* 侧边栏 */
.sidebar {
  width: 280px;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  padding: 1.5rem 0;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  overflow-y: auto;
  z-index: 100;
}
.nav-section { margin-bottom: 1rem; }
.nav-section-title {
  padding: 0.4rem 1.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
}
.sidebar ul { list-style: none; }
.sidebar li a {
  display: block;
  padding: 0.3rem 1.5rem;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 0.875rem;
  border-left: 3px solid transparent;
  transition: all 0.15s;
}
.sidebar li a:hover { background: rgba(255,255,255,0.05); color: #fff; }
.sidebar li.active a {
  background: rgba(59,130,246,0.15);
  color: #60a5fa;
  border-left-color: #3b82f6;
}

/* 主内容 */
.content {
  margin-left: 280px;
  flex: 1;
  max-width: var(--max-width);
  padding: 2rem 3rem;
}

/* 页面头部 */
.page-header { margin-bottom: 2rem; }
.page-header h1 { font-size: 1.75rem; margin-top: 0.5rem; }
.type-badge, .status-badge {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 4px;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  margin-right: 0.5rem;
}
.tags { margin-top: 0.5rem; }
.tag {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 3px;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-right: 0.3rem;
}

/* 文章内容 */
article h2 { font-size: 1.35rem; margin: 2rem 0 0.75rem; padding-bottom: 0.3rem; border-bottom: 1px solid var(--border); }
article h3 { font-size: 1.1rem; margin: 1.5rem 0 0.5rem; }
article p { margin-bottom: 0.75rem; }
article ul, article ol { padding-left: 1.5rem; margin-bottom: 1rem; }
article li { margin-bottom: 0.3rem; }
article blockquote {
  border-left: 3px solid var(--accent);
  padding: 0.5rem 1rem;
  margin: 1rem 0;
  background: #f0f7ff;
  color: var(--text-muted);
}
article hr { border: none; border-top: 1px solid var(--border); margin: 2rem 0; }

/* 表格 */
.table-wrapper { overflow-x: auto; margin: 1rem 0; }
table { border-collapse: collapse; width: 100%; font-size: 0.875rem; }
th, td { padding: 0.5rem 0.75rem; text-align: left; border: 1px solid var(--border); }
th { background: #f1f5f9; font-weight: 600; white-space: nowrap; }
tr:hover { background: #f8fafc; }

/* Wiki-links */
.wiki-link { color: var(--accent); text-decoration: none; border-bottom: 1px dotted var(--accent); }
.wiki-link:hover { border-bottom-style: solid; }
.broken-link { color: #ef4444; border-bottom: 1px dashed #ef4444; cursor: help; }

/* 反向链接 */
.backlinks {
  margin-top: 3rem;
  padding: 1rem;
  background: #f8fafc;
  border-radius: 6px;
  border: 1px solid var(--border);
}
.backlinks h3 { font-size: 0.95rem; margin-bottom: 0.5rem; }
.backlinks ul { list-style: none; padding: 0; }
.backlinks li { padding: 0.2rem 0; }

/* 首页 */
.home-header { text-align: center; padding: 2rem 0; }
.home-header h1 { font-size: 2rem; }
.subtitle { color: var(--text-muted); margin: 0.5rem 0 1.5rem; }
.stats-bar { display: flex; gap: 2rem; justify-content: center; margin-top: 1.5rem; }
.stat { text-align: center; }
.stat-num { display: block; font-size: 1.75rem; font-weight: 700; color: var(--accent); }
.stat-label { font-size: 0.8rem; color: var(--text-muted); }

.home-section { margin: 2.5rem 0; }
.home-section h2 { font-size: 1.35rem; margin-bottom: 1rem; }

.concept-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 0.75rem; }
.concept-card {
  display: flex; flex-direction: column;
  padding: 0.75rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  text-decoration: none;
  color: var(--text);
  transition: box-shadow 0.15s;
}
.concept-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.concept-name { font-weight: 600; font-size: 0.9rem; }
.concept-count { font-size: 0.75rem; color: var(--text-muted); }

/* 搜索 */
.search-box { position: relative; max-width: 500px; margin: 0 auto; }
#search-input {
  width: 100%;
  padding: 0.6rem 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.95rem;
  outline: none;
}
#search-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(59,130,246,0.1); }
#search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-top: 4px;
  display: none;
  max-height: 400px;
  overflow-y: auto;
  z-index: 50;
}

.status-sm {
  font-size: 0.7rem;
  padding: 0.1rem 0.4rem;
  background: #e2e8f0;
  border-radius: 3px;
  color: var(--text-muted);
}

.page-footer { margin-top: 3rem; padding-top: 1rem; border-top: 1px solid var(--border); font-size: 0.8rem; color: var(--text-muted); }

/* 响应式 */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .content { margin-left: 0; padding: 1rem; }
  .stats-bar { flex-wrap: wrap; gap: 1rem; }
}
