/* 门户主题（与 demo.html 完全一致） */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #f5f5f5;
  --surface: #ffffff;
  --text: #333333;
  --text-muted: #888888;
  --text-light: #999999;
  --border: #dddddd;
  --border-light: #eeeeee;
  --link: #336699;
  --font: Arial, "Helvetica Neue", Helvetica, "PingFang SC", "Microsoft YaHei", sans-serif;
  /* 点缀色 */
  --accent: #5f8a8a;
  --accent-soft: #e6efef;
  --accent-warm: #b88a5c;
  --accent-warm-soft: #f4ece2;
}

body {
  background: var(--bg);
  font-family: var(--font);
  color: var(--text);
  font-size: 13px;
  line-height: 1.7;
  padding: 0 10px;
}

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

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

/* 顶部 */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 2px solid var(--accent);
  gap: 12px;
  flex-wrap: wrap;
}

.logo { font-size: 16px; font-weight: bold; }
.logo span { color: var(--accent); font-weight: normal; }

.nav { display: flex; gap: 20px; font-size: 13px; }
.nav a { color: var(--text); }
.nav a.active {
  font-weight: bold;
  color: var(--accent);
  border-bottom: 2px solid var(--accent);
  padding-bottom: 2px;
}

.search {
  font-size: 12px;
  color: var(--text-muted);
  border: 1px solid var(--border);
  background: #fff;
  padding: 5px 10px;
  width: 200px;
}
.search:focus { outline: none; border-color: var(--accent); }

/* 标签条 */
.tag-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}
.tag-bar .label { color: var(--text-muted); margin-right: 4px; }
.tag-bar a {
  color: var(--text-muted);
  padding: 2px 8px;
  border: 1px solid var(--border);
  background: #fff;
  transition: all 0.15s;
}
.tag-bar a:hover {
  color: var(--accent);
  border-color: var(--accent);
  text-decoration: none;
  background: var(--accent-soft);
}
.tag-bar a.hot {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

/* 主布局 */
.main-layout {
  display: flex;
  gap: 16px;
  padding: 16px 0 32px;
  align-items: flex-start;
}

/* 左侧分类 */
.left-sidebar {
  width: 130px;
  flex-shrink: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 10px 0;
}
.sidebar-title {
  font-size: 12px;
  color: var(--text-muted);
  padding: 6px 12px 7px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 6px;
}
.sidebar-list { list-style: none; }
.sidebar-list li a {
  display: block;
  padding: 7px 12px;
  font-size: 12px;
  color: var(--text);
  border-left: 3px solid transparent;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.sidebar-list li a:hover {
  background: #f7fafa;
  text-decoration: none;
  color: var(--accent);
}
.sidebar-list li a.active {
  font-weight: bold;
  color: var(--accent);
  background: var(--accent-soft);
  border-left-color: var(--accent);
}

/* 右侧列表 */
.main-content { flex: 1; min-width: 0; background: var(--surface); border: 1px solid var(--border); }

.section-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: #fafafa;
  border-left: 3px solid var(--accent);
  scroll-margin-top: 10px;
}
.section-row h2 { font-size: 13px; font-weight: bold; }
.section-row h2::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 4px;
  background: var(--accent);
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: middle;
}
.section-row a { font-size: 12px; color: var(--accent); }
.section-row a:hover { color: var(--link); }

/* 纯列表 */
.article-list { list-style: none; }
.article-list li {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-light);
  transition: background 0.15s;
}
.article-list li:last-child { border-bottom: none; }
.article-list li:hover { background: #f8fafa; }

.article-main { flex: 1; min-width: 0; }

.article-title {
  font-size: 14px;
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.article-title a { color: var(--text); transition: color 0.15s; }
.article-title a:hover { color: var(--accent); }

.article-desc {
  font-size: 12px;
  color: var(--text-light);
  line-height: 1.6;
  margin-top: 5px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-side {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  padding-top: 2px;
}

.article-cat {
  font-size: 11px;
  color: var(--accent);
  white-space: nowrap;
  background: var(--accent-soft);
  padding: 1px 7px;
  border-radius: 2px;
  font-weight: 500;
}

.article-author {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  width: 60px;
  text-align: right;
}

/* 页脚 */
.footer {
  border-top: 1px solid var(--border);
  padding: 16px 0 28px;
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.footer a { color: var(--text-muted); margin-left: 16px; }
.footer a:hover { color: var(--accent); }

/* 响应式 */
@media (max-width: 720px) {
  .main-layout { flex-direction: column; }
  .left-sidebar {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    padding: 6px;
  }
  .sidebar-title { display: none; }
  .sidebar-list { display: flex; flex-wrap: wrap; }
  .sidebar-list li a {
    padding: 5px 10px;
    border-left: none;
    border-radius: 3px;
  }
  .article-cat { display: none; }
  .article-desc { -webkit-line-clamp: 2; }
}
@media (max-width: 480px) {
  .search { display: none; }
  .article-author { display: none; }
}

/* 站点适配（不改变 demo.html 视觉） */
html { scroll-behavior: smooth; }
.search-form { display: contents; }
.logo a { color: var(--text); }
.logo a:hover { text-decoration: none; }

/* 文章详情 */
.crumb-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-muted);
  flex-wrap: wrap;
}
.crumb-bar a { color: var(--text-muted); }
.crumb-bar a:hover { color: var(--accent); text-decoration: none; }
.crumb-bar .sep { color: var(--border); }
.crumb-current {
  max-width: 420px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.article-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  margin: 16px 0 32px;
}

.article-head {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  background: #fafafa;
}
.article-head h1 { font-size: 16px; line-height: 1.5; }
.article-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.article-body { padding: 20px 16px; font-size: 14px; line-height: 1.9; }
.article-body > *:first-child { margin-top: 0 !important; }
.article-body h1,
.article-body h2,
.article-body h3,
.article-body h4 {
  color: var(--text) !important;
  text-align: left !important;
  font-weight: bold;
}
.article-body h2 {
  font-size: 15px !important;
  border-left: 3px solid var(--accent) !important;
  border-bottom: none !important;
  padding-left: 8px !important;
  margin: 24px 0 10px !important;
}
.article-body h3 { font-size: 14px !important; margin: 18px 0 8px !important; }
.article-body h4 { font-size: 13px !important; margin: 16px 0 6px !important; }
.article-body p { margin: 0 0 12px !important; }
.article-body ul,
.article-body ol { margin: 0 0 12px !important; padding-left: 22px !important; }
.article-body li { margin-bottom: 4px; }
.article-body a { color: var(--link); }
.article-body img {
  max-width: 100% !important;
  height: auto !important;
  display: block;
  margin: 14px 0;
  border: 1px solid var(--border-light);
}
.article-body blockquote {
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  padding: 8px 12px;
  margin: 0 0 12px;
  color: var(--text-muted);
}
.article-body table {
  border-collapse: collapse;
  width: 100%;
  margin: 0 0 14px;
  font-size: 13px;
}
.article-body th,
.article-body td { border: 1px solid var(--border); padding: 6px 8px; text-align: left; }
.article-body th { background: #fafafa; }
.article-body code {
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
  background: #f0f0f0;
  padding: 1px 5px;
  border-radius: 2px;
}
.article-body pre {
  background: #f7f7f7;
  border: 1px solid var(--border-light);
  padding: 10px 12px;
  overflow-x: auto;
  margin: 0 0 12px;
}
.article-body pre code { background: none; padding: 0; }
.article-body hr { border: none; border-top: 1px solid var(--border); margin: 20px 0; }

.back-row {
  display: flex;
  justify-content: space-between;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: #fafafa;
  font-size: 12px;
}
.back-row a { color: var(--accent); }
.back-row a:hover { color: var(--link); text-decoration: none; }

/* 文章页标签行 */
.tag-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 16px;
  border-top: 1px solid var(--border-light);
}
.tag-row .label { font-size: 12px; color: var(--text-muted); }
.tag-chip {
  font-size: 11px;
  color: var(--text-muted);
  border: 1px solid var(--border);
  background: #fff;
  padding: 2px 8px;
  border-radius: 2px;
  transition: all 0.15s;
}
.tag-chip:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
  text-decoration: none;
}

/* 列表页 */
.section-row .count { font-size: 12px; color: var(--text-muted); }
.list-panel { margin: 16px 0 32px; }

.pager {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  background: #fafafa;
  font-size: 12px;
}
.pager a,
.pager span {
  display: inline-block;
  min-width: 26px;
  text-align: center;
  padding: 4px 8px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  transition: all 0.15s;
}
.pager a:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
  text-decoration: none;
}
.pager .current {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: bold;
}
.pager .disabled { color: var(--text-light); border-color: var(--border-light); }
.pager .dots { border: none; background: none; }

/* 错误页 */
.error-box { padding: 60px 16px; text-align: center; }
.error-code { font-size: 48px; font-weight: bold; color: var(--border); letter-spacing: 4px; }
.error-title { font-size: 16px; font-weight: bold; margin: 12px 0 6px; }
.error-desc { font-size: 12px; color: var(--text-muted); margin-bottom: 22px; }
.error-actions a {
  display: inline-block;
  font-size: 12px;
  padding: 5px 14px;
  margin: 0 4px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  transition: all 0.15s;
}
.error-actions a:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
  text-decoration: none;
}

/* 后台 */
.admin-main { margin: 16px 0 32px; }
.admin-user { font-size: 12px; color: var(--text-muted); }

.admin-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.admin-table th,
.admin-table td { border-bottom: 1px solid var(--border-light); padding: 10px 12px; text-align: left; vertical-align: middle; }
.admin-table th { background: #fafafa; border-bottom: 1px solid var(--border); color: var(--text-muted); white-space: nowrap; }
.admin-table tr:hover td { background: #f8fafa; }
.admin-table .t-title { max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-table .t-actions { white-space: nowrap; text-align: right; }

.badge { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 2px; white-space: nowrap; }
.badge-cat { color: var(--accent); background: var(--accent-soft); }
.badge-featured { color: #fff; background: var(--accent-warm); }
.badge-pub { color: var(--text-muted); background: #f0f0f0; }
.badge-draft { color: #a05252; background: #f7ecec; }

.btn {
  display: inline-block;
  font-size: 12px;
  padding: 5px 14px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  font-family: inherit;
}
.btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); text-decoration: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { color: #fff; background: #4f7a7a; border-color: #4f7a7a; }
.btn-danger:hover { border-color: #a05252; color: #a05252; background: #f7ecec; }
.btn-sm { padding: 3px 10px; }

.filter-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: #fff;
  flex-wrap: wrap;
}

.form-input,
.form-select,
.form-textarea {
  font-size: 12px;
  color: var(--text);
  border: 1px solid var(--border);
  background: #fff;
  padding: 5px 10px;
  font-family: inherit;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus { outline: none; border-color: var(--accent); }
.form-textarea {
  width: 100%;
  min-height: 320px;
  font-family: Consolas, "Courier New", monospace;
  line-height: 1.6;
  resize: vertical;
  box-sizing: border-box;
}

.form-body { padding: 16px; }
.form-field { margin-bottom: 14px; }
.form-field label { display: block; font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.form-field .form-input,
.form-field .form-select { width: 100%; max-width: 480px; }
.form-row2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.form-check { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text); }
.form-hint { font-size: 11px; color: var(--text-light); margin-top: 4px; }
.btn[disabled],
.form-input[disabled],
.form-select[disabled],
.form-textarea[disabled] { opacity: 0.5; cursor: not-allowed; }
.btn[disabled]:hover { border-color: var(--border); color: var(--text); background: #fff; }
/* AI 生文:正文预览框更高;提交后的等待提示默认隐藏 */
.ai-content { min-height: 480px; }
.ai-busy { display: none; align-self: center; }
.ai-busy.on { display: block; }
.alert-error code,
.alert-ok code { font-family: Consolas, "Courier New", monospace; background: rgba(0, 0, 0, 0.06); padding: 0 3px; }
.form-actions {
  display: flex;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: #fafafa;
}

.alert-error {
  margin-top: 16px;
  padding: 10px 16px;
  background: #f7ecec;
  border: 1px solid #d9a5a5;
  border-left: 3px solid #a05252;
  color: #a05252;
  font-size: 12px;
}

.alert-ok {
  margin-top: 16px;
  padding: 10px 16px;
  background: var(--accent-soft);
  border: 1px solid #b8d0d0;
  border-left: 3px solid var(--accent);
  color: #3f6a6a;
  font-size: 12px;
}

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; padding: 16px; }
.stat-card { border: 1px solid var(--border); background: #fafafa; padding: 14px 16px; }
.stat-num { font-size: 22px; font-weight: bold; color: var(--accent); }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.login-wrap { max-width: 360px; margin: 80px auto 0; }
.login-panel { background: var(--surface); border: 1px solid var(--border); }
.login-body { padding: 24px 20px; }
.login-title { font-size: 16px; font-weight: bold; text-align: center; }
.login-sub { font-size: 12px; color: var(--text-muted); text-align: center; margin: 6px 0 18px; }
.login-foot { text-align: center; font-size: 12px; padding: 12px; border-top: 1px solid var(--border-light); }

/* 推荐平台(首页外链卡片) */
.platform-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
  padding: 16px;
}
.platform-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  background: var(--surface);
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.platform-card:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(95, 138, 138, 0.15);
  text-decoration: none;
}
.platform-img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--accent-soft);
  border-bottom: 1px solid var(--border-light);
}
.platform-body {
  padding: 10px 12px 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.platform-name { font-size: 14px; font-weight: bold; color: var(--text); }
.platform-card:hover .platform-name { color: var(--accent); }
.platform-desc {
  font-size: 12px;
  color: var(--text-light);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.platform-go { font-size: 12px; color: var(--accent); margin-top: auto; padding-top: 4px; }

/* 推荐平台管理列表缩略图 */
.platform-thumb {
  width: 48px;
  height: 27px;
  object-fit: cover;
  border: 1px solid var(--border-light);
  background: var(--accent-soft);
  display: block;
}
