/* ============================================================
   互联网电视政策收录检索档案柜 - 共享样式
   配色：深蓝(#1a3c5e) + 金色(#c5a55a)，政府档案风格
   ============================================================ */

:root {
  --bg: #f5f6f8;
  --bg2: #ffffff;
  --ink: #1a2332;
  --muted: #5a6c7d;
  --rule: #dce0e6;
  --accent: #1a3c5e;
  --accent-light: #e8f0f7;
  --gold: #c5a55a;
  --gold-light: #faf5eb;
  --success: #2d7a4f;
  --success-light: #eef7f0;
  --danger: #c0392b;
  --danger-light: #fbeae8;
  --warning: #b87b1a;
  --tag-bg: #eef2f6;
  --shadow: 0 2px 8px rgba(26, 35, 50, 0.08);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans CJK SC', sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.7;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- 顶部导航 ---------- */

.navbar {
  background: var(--accent);
  color: #fff;
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

.navbar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #fff;
  text-decoration: none;
}

.navbar .brand:hover { text-decoration: none; }

.navbar .brand .logo {
  width: 30px; height: 30px;
  background: var(--gold);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  color: #fff;
}

.navbar .nav-links { display: flex; gap: 20px; align-items: center; }

.navbar .nav-links a {
  color: rgba(255, 255, 255, 0.85);
  font-size: 14px;
  text-decoration: none;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all .15s;
}

.navbar .nav-links a:hover { color: #fff; background: rgba(255, 255, 255, 0.12); text-decoration: none; }

/* ---------- 页面容器 ---------- */

.container { max-width: 1200px; margin: 0 auto; padding: 24px; }

.page-title { font-size: 22px; font-weight: 700; color: var(--accent); margin-bottom: 4px; }
.page-subtitle { font-size: 13px; color: var(--muted); margin-bottom: 20px; }

/* ---------- 卡片 ---------- */

.card {
  background: var(--bg2);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 20px;
  box-shadow: var(--shadow);
}

/* ---------- 检索区 ---------- */

.search-panel {
  background: var(--bg2);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 18px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.search-row { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }

.search-input {
  flex: 1;
  min-width: 260px;
  padding: 10px 14px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(26, 60, 94, 0.12);
}

.select {
  padding: 10px 12px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: var(--bg2);
  color: var(--ink);
  outline: none;
  cursor: pointer;
}

.filter-group { margin-bottom: 12px; }
.filter-label { font-size: 13px; color: var(--muted); margin-bottom: 8px; display: block; }

/* ---------- 标签 ---------- */

.tag-cloud { display: flex; gap: 8px; flex-wrap: wrap; }

.tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 14px;
  font-size: 13px;
  background: var(--tag-bg);
  color: var(--muted);
  border: 1px solid var(--rule);
  cursor: pointer;
  transition: all .15s;
  user-select: none;
}

.tag:hover { border-color: var(--accent); color: var(--accent); }
.tag.selected { background: var(--accent); color: #fff; border-color: var(--accent); }

.tag-mini {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 12px;
  background: var(--tag-bg);
  color: var(--muted);
  border: 1px solid var(--rule);
  margin: 1px 2px 1px 0;
}

/* ---------- 类型徽标 ---------- */

.type-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.type-content { background: #e8f0f7; color: #1a3c5e; }
.type-tech    { background: #eef7f0; color: #2d7a4f; }
.type-license { background: #faf5eb; color: #8a6d2f; }
.type-fee     { background: #fbeae8; color: #a93226; }
.type-minor   { background: #f0eaf7; color: #5d3a8e; }
.type-live    { background: #e7f4f4; color: #1a6b6b; }

/* 状态徽标 */
.status-badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}
.status-long   { background: var(--success-light); color: var(--success); }
.status-expire { background: var(--gold-light); color: var(--warning); }
.status-update { background: var(--gold-light); color: var(--warning); }
.status-pending { background: var(--gold-light); color: var(--warning); }
.status-published { background: var(--success-light); color: var(--success); }
.src-official { background: var(--success-light); color: var(--success); }
.src-media    { background: var(--gold-light); color: var(--gold); }
.src-industry { background: var(--tag-bg); color: var(--muted); }
.src-other    { background: var(--danger-light); color: var(--danger); }

/* ---------- 政策列表 ---------- */

.policy-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 10px;
}

.result-count { font-size: 13px; color: var(--muted); }

.sort-toggle { font-size: 13px; }
.sort-toggle button {
  background: none; border: 1px solid var(--rule); border-radius: 6px;
  padding: 4px 12px; font-size: 12px; cursor: pointer; font-family: inherit;
  color: var(--muted); margin-left: 6px;
}
.sort-toggle button.active { background: var(--accent); color: #fff; border-color: var(--accent); }

.policy-item {
  background: var(--bg2);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 16px 18px;
  margin-bottom: 12px;
  transition: box-shadow .15s, border-color .15s;
}

.policy-item:hover { box-shadow: var(--shadow); border-color: #c5d3e0; }

.policy-item .item-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 6px;
}

.policy-item .item-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  line-height: 1.5;
}

.policy-item .item-title:hover { color: var(--accent); text-decoration: underline; }

.policy-item .item-meta {
  font-size: 12.5px;
  color: var(--muted);
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.policy-item .item-summary {
  font-size: 13.5px;
  color: var(--muted);
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.policy-item .item-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.link-btn {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
}

mark {
  background: var(--gold-light);
  color: var(--accent);
  padding: 0 2px;
  border-radius: 2px;
}

/* ---------- 空状态 ---------- */

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}

.empty-state .icon { font-size: 40px; margin-bottom: 12px; opacity: .4; }
.empty-state .hint { font-size: 13px; margin-top: 6px; }

/* ---------- 加载 ---------- */

.loading { text-align: center; padding: 60px; color: var(--muted); font-size: 14px; }

.spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--rule);
  border-top-color: var(--accent);
  border-radius: 50%;
  margin: 0 auto 12px;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 详情页 ---------- */

.detail-hero {
  background: var(--accent);
  color: #fff;
  padding: 28px 24px;
  border-radius: 10px;
  margin-bottom: 20px;
}

.detail-hero .badges { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.detail-hero .badges span {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
}

.detail-hero h1 { font-size: 22px; line-height: 1.5; margin-bottom: 6px; }
.detail-hero .doc-number { font-size: 13px; color: rgba(255, 255, 255, 0.75); }

.meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.meta-item {
  padding: 12px 14px;
  background: var(--bg);
  border-radius: 8px;
}

.meta-item .label { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.meta-item .value { font-size: 14px; font-weight: 500; }
.meta-item .value small { font-weight: 400; color: var(--muted); font-size: 12px; }

/* ---------- 按钮 ---------- */

.btn {
  display: inline-block;
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: opacity .15s;
  text-decoration: none;
}

.btn:hover { opacity: .88; text-decoration: none; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-gold { background: var(--gold); color: #fff; }
.btn-outline {
  background: transparent; color: var(--ink);
  border: 1px solid var(--rule);
}
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 4px 12px; font-size: 12.5px; border-radius: 6px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- 表单 ---------- */

.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 5px; }
.form-group input, .form-group textarea, .form-group select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
}

.form-group input:focus, .form-group textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(26, 60, 94, 0.1);
}

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ---------- 后台标签页 ---------- */

.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--rule);
  margin-bottom: 18px;
  overflow-x: auto;
}

.tab-btn {
  padding: 8px 18px;
  background: none;
  border: none;
  font-size: 14px;
  font-family: inherit;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
}

.tab-btn.active { color: var(--accent); font-weight: 700; border-bottom-color: var(--accent); }
.tab-btn:hover { color: var(--accent); }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ---------- 表格 ---------- */

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--bg2);
}

table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 640px; }

thead { background: var(--accent); color: #fff; }

th {
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
  white-space: nowrap;
  font-size: 13px;
}

td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}

tbody tr:hover { background: var(--accent-light); }
tbody tr:last-child td { border-bottom: none; }

/* ---------- 提示 ---------- */

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  padding: 10px 22px;
  border-radius: 8px;
  font-size: 14px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  opacity: 0;
  transition: opacity .25s;
  z-index: 200;
  pointer-events: none;
}

.toast.show { opacity: 1; }
.toast.error { background: var(--danger); }

/* ---------- 页脚 ---------- */

.footer {
  margin-top: 40px;
  padding: 20px 24px;
  text-align: center;
  font-size: 12.5px;
  color: var(--muted);
  border-top: 1px solid var(--rule);
}

/* ---------- 响应式 ---------- */

@media (max-width: 768px) {
  .container { padding: 14px; }
  .meta-grid, .form-row { grid-template-columns: 1fr; }
  .navbar { padding: 0 14px; }
  .navbar .brand { font-size: 15px; }
  .policy-item .item-head { flex-direction: column; }
  .search-row { flex-direction: column; }
  .search-input { min-width: 0; }
}
