/* 内容工坊 —— 三频道网站样式 */
:root {
  --bg: #f5f6fa;
  --card: #ffffff;
  --text: #2c3e50;
  --muted: #7f8c8d;
  --line: #e4e6eb;
  --accent: #e74c3c;
  --radius: 12px;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
a { color: inherit; text-decoration: none; }

/* 顶栏 */
.site-header {
  background: #1f2430;
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 2px 10px rgba(0,0,0,.15);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 56px; }
.logo { font-size: 20px; font-weight: 700; }
.logo:hover { opacity: .85; }
.site-header nav { display: flex; gap: 18px; align-items: center; }
.site-header nav a { opacity: .8; font-size: 15px; }
.site-header nav a:hover, .site-header nav a.active { opacity: 1; color: #ffd76a; }
.site-header nav a.admin-link {
  border: 1px solid rgba(255,255,255,.4);
  border-radius: 6px;
  padding: 3px 10px;
}

/* 首页 hero */
.hero {
  text-align: center;
  padding: 46px 16px 30px;
  background: linear-gradient(135deg, #1f2430 0%, #2c3e50 100%);
  color: #fff;
  border-radius: 0 0 18px 18px;
  margin-bottom: 26px;
}
.hero h1 { font-size: 30px; margin-bottom: 8px; }
.hero p { color: #bdc3c7; }

/* 频道区块 */
.channel-sec { margin-bottom: 34px; }
.sec-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-left: 4px solid var(--accent);
  padding-left: 12px;
  margin-bottom: 14px;
}
.sec-head h2 { font-size: 21px; }
.sec-head .more { color: var(--muted); font-size: 14px; }
.sec-head .more:hover { color: var(--accent); }

/* 卡片网格 */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 16px;
}
.card {
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .15s ease, box-shadow .15s ease;
  display: block;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 6px 16px rgba(0,0,0,.12); }
.card img { width: 100%; aspect-ratio: 3/4; object-fit: cover; display: block; }
.card .no-poster {
  width: 100%; aspect-ratio: 3/4;
  display: flex; align-items: center; justify-content: center;
  font-size: 40px; background: #eef0f5; color: #b0b6c4;
}
.card-body { padding: 10px 12px 12px; }
.card-body h3 {
  font-size: 14px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-bottom: 4px;
}
.card-body .views { color: var(--muted); font-size: 12px; }
.empty { color: var(--muted); padding: 24px 0; grid-column: 1 / -1; text-align: center; }

/* 频道页 */
.page-head { padding: 26px 0 10px; }
.page-head h1 { font-size: 26px; color: var(--accent); }
.page-head p { color: var(--muted); }
.cat-bar { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0 20px; }
.cat-bar a {
  padding: 6px 16px;
  border-radius: 20px;
  background: var(--card);
  box-shadow: var(--shadow);
  font-size: 14px;
}
.cat-bar a.active { background: var(--accent); color: #fff; }

/* 播放页 */
.player-wrap {
  background: #000;
  border-radius: var(--radius);
  margin: 18px 0;
  overflow: hidden;
}
.player-wrap video { width: 100%; max-height: 70vh; display: block; }
.audio-box { padding: 30px 20px; text-align: center; color: #fff; }
.audio-box .audio-cover { font-size: 90px; margin-bottom: 10px; }
.audio-box .audio-cover img { width: 200px; height: 200px; object-fit: cover; border-radius: 14px; }
.audio-box audio { width: 100%; max-width: 560px; margin-top: 14px; }
.player-placeholder {
  padding: 60px 20px; text-align: center; color: #aaa;
  font-size: 18px;
}
.item-meta { padding: 6px 4px 14px; }
.item-meta h1 { font-size: 24px; margin-bottom: 8px; }
.tags { margin-bottom: 10px; }
.tag {
  display: inline-block;
  background: #eef0f5;
  color: var(--muted);
  border-radius: 6px;
  padding: 2px 10px;
  font-size: 12px;
  margin-right: 6px;
}
.desc { color: var(--muted); margin-bottom: 8px; white-space: pre-wrap; }
.views { color: var(--muted); font-size: 13px; }
.related h2 { margin: 22px 0 12px; font-size: 19px; }

/* 页脚 */
.site-footer {
  margin-top: 40px;
  padding: 20px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

/* ============ 后台 ============ */
.admin-panel { max-width: 980px; }
.admin-nav { display: flex; gap: 16px; margin: 18px 0; flex-wrap: wrap; }
.admin-nav a {
  background: var(--card);
  padding: 8px 16px;
  border-radius: 8px;
  box-shadow: var(--shadow);
  font-size: 14px;
}
.admin-nav a:hover { color: var(--accent); }
.counts { display: flex; gap: 14px; margin: 14px 0; flex-wrap: wrap; }
.counts .count {
  background: var(--card);
  border-radius: 10px;
  padding: 12px 20px;
  box-shadow: var(--shadow);
  flex: 1;
  min-width: 150px;
}
.counts .count b { font-size: 26px; display: block; }
table { width: 100%; border-collapse: collapse; background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); font-size: 14px; }
th { background: #f0f2f7; font-weight: 600; }
tr:hover td { background: #fafbfd; }
.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 18px;
  cursor: pointer;
  font-size: 14px;
}
.btn:hover { opacity: .9; }
.btn.ghost { background: #eef0f5; color: var(--text); }
.btn.danger { background: #c0392b; }
.btn-sm { padding: 4px 10px; font-size: 13px; }

/* 表单 */
.form-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  max-width: 640px;
  margin: 20px auto;
}
.form-card h2 { margin-bottom: 16px; font-size: 20px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 14px; margin-bottom: 6px; font-weight: 600; }
.field input[type="text"], .field input[type="password"], .field select, .field textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
}
.field textarea { min-height: 90px; resize: vertical; }
.field .hint { color: var(--muted); font-size: 12px; margin-top: 4px; }
.upload-row { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.upload-row input[type="file"] { font-size: 13px; }
.flash { background: #eafaf1; color: #1e8449; border: 1px solid #abebc6; border-radius: 8px; padding: 10px 14px; margin-bottom: 14px; }
.error { background: #fdedec; color: #c0392b; border: 1px solid #f5b7b1; border-radius: 8px; padding: 10px 14px; margin-bottom: 14px; }
.login-card { max-width: 380px; margin: 70px auto; text-align: center; }
.login-card .logo { font-size: 26px; color: var(--text); }
.admin-row { display: flex; gap: 8px; align-items: center; }
.admin-row form { display: inline; }

/* 响应式 */
@media (max-width: 600px) {
  .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .site-header .wrap { flex-direction: column; height: auto; padding: 10px 0; gap: 8px; }
  th, td { font-size: 13px; padding: 8px; }
}
