/* ============================================================
   column.css —— 专栏 / 写文章 / 文章详情 统一自包含样式
   不依赖 style.css，换掉 style.css 也不会塌。
   设计规范见任务书，严格使用下列品牌变量。
   ============================================================ */

:root {
  --brand: #FB7299;
  --brand-hover: #E85C86;
  --accent: #00AEEC;
  --accent-2: #7C5CFF;
  --grad: linear-gradient(135deg, #FB7299 0%, #FF8FB1 45%, #00AEEC 100%);
  --bg: #F6F7F9;
  --surface: #FFFFFF;
  --surface-2: #F1F2F4;
  --text: #18191C;
  --text-2: #61666D;
  --text-3: #9499A0;
  --line: #E3E5E7;
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 20px;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, .05);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, .10);
  --shadow-lg: 0 18px 48px rgba(251, 114, 153, .18);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC",
    "Microsoft YaHei UI", "Microsoft YaHei", "Segoe UI", Roboto, "Helvetica Neue", Arial,
    "Noto Sans SC", sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* ===== 顶部导航（自包含，不与主站冲突） ===== */
.col-site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, .85);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.col-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.col-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}
.col-brand-logo {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--grad);
  color: #fff;
  font-weight: 800;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
}
.col-brand-text { line-height: 1.2; }
.col-site-title {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
}
.col-site-subtitle {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--text-3);
}
.col-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.col-nav-link {
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-2);
  transition: color .2s ease, background .2s ease, transform .2s ease;
}
.col-nav-link:hover {
  color: var(--brand);
  background: var(--surface-2);
}
.col-nav-link.active {
  color: #fff;
  background: var(--brand);
}
.col-nav-link.active:hover {
  background: var(--brand-hover);
}

/* ===== 页面主体 ===== */
.col-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 20px 56px;
}
.col-page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.col-page-title {
  margin: 0;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: .5px;
}
.col-page-desc {
  margin: 6px 0 0;
  color: var(--text-2);
  font-size: 14px;
}
.col-btn-primary {
  border: none;
  cursor: pointer;
  background: var(--grad);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  padding: 11px 20px;
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}
.col-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  filter: brightness(1.03);
}
.col-btn-primary:active { transform: translateY(0); }

/* ===== 卡片网格 ===== */
.col-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
@media (max-width: 1024px) { .col-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 720px)  { .col-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 460px)  { .col-grid { grid-template-columns: 1fr; } }

.col-card {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--line);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: transform .22s ease, box-shadow .22s ease;
  /* 进场动画初始态 */
  opacity: 0;
  transform: translateY(16px);
  animation: col-fade-up .5s ease forwards;
}
.col-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
}
.col-card-cover {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--surface-2);
  overflow: hidden;
}
.col-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .35s ease;
}
.col-card:hover .col-card-cover img {
  transform: scale(1.06);
}
.col-card-cover.col-cover-empty {
  display: flex;
  align-items: center;
  justify-content: center;
}
.col-card-cover.col-cover-empty::after {
  content: "📄";
  font-size: 34px;
  opacity: .5;
}
.col-card-body {
  padding: 12px 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.col-card-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.45;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.col-card-summary {
  margin: 0;
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}
.col-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-3);
  margin-top: auto;
}
.col-card-author {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-2);
  font-weight: 600;
}
.col-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--grad);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.col-dot { color: var(--line); }

/* ===== 骨架屏 ===== */
.col-skeleton {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  overflow: hidden;
}
.col-skeleton .sk-cover {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: linear-gradient(100deg, var(--surface-2) 30%, #e9eaee 50%, var(--surface-2) 70%);
  background-size: 200% 100%;
  animation: col-shimmer 1.3s infinite linear;
}
.col-skeleton .sk-line {
  height: 12px;
  margin: 12px 14px 0;
  border-radius: 6px;
  background: linear-gradient(100deg, var(--surface-2) 30%, #e9eaee 50%, var(--surface-2) 70%);
  background-size: 200% 100%;
  animation: col-shimmer 1.3s infinite linear;
}
.col-skeleton .sk-line.short { width: 60%; margin-bottom: 14px; }

/* ===== 状态提示 ===== */
.col-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-2);
}
.col-state .col-emoji { font-size: 40px; display: block; margin-bottom: 12px; }
.col-state.col-error .col-retry {
  margin-top: 16px;
  display: inline-block;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--brand);
  font-weight: 700;
  padding: 9px 18px;
  border-radius: 999px;
  cursor: pointer;
  transition: background .2s ease, transform .2s ease;
}
.col-state.col-error .col-retry:hover { background: var(--surface-2); transform: translateY(-1px); }

/* ===== 写文章页 ===== */
.col-write-wrap {
  max-width: 960px;
  margin: 0 auto;
}
.col-form {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 22px;
}
.col-field { margin-bottom: 18px; }
.col-label {
  display: block;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}
.col-label .col-opt { color: var(--text-3); font-weight: 500; font-size: 12px; margin-left: 6px; }
.col-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  font-size: 14px;
  background: var(--surface);
  color: var(--text);
  transition: border-color .2s ease, box-shadow .2s ease;
  font-family: inherit;
}
.col-input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(251, 114, 153, .15);
}
.col-textarea {
  width: 100%;
  min-height: 320px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px;
  font-size: 15px;
  line-height: 1.7;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.col-textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(251, 114, 153, .15);
}

/* 工具栏 */
.col-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-bottom: none;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
.col-tool {
  border: none;
  background: var(--surface);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 700;
  padding: 7px 11px;
  border-radius: 8px;
  cursor: pointer;
  transition: background .18s ease, color .18s ease, transform .12s ease;
}
.col-tool:hover { background: #fff; color: var(--brand); }
.col-tool:active { transform: scale(.94); }
.col-tool.col-tool-toggle.active {
  background: var(--brand);
  color: #fff;
}
.col-tool-sep { width: 1px; background: var(--line); margin: 4px 2px; }

/* 编辑器 + 预览 两栏 */
.col-editor-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}
.col-editor-row .col-textarea { border-radius: 0 0 var(--radius-sm) var(--radius-sm); }
.col-editor-row.is-split .col-textarea { border-radius: 0 0 0 var(--radius-sm); }
.col-preview {
  border: 1px solid var(--line);
  border-left: none;
  border-radius: 0 0 var(--radius-sm) 0;
  padding: 14px;
  background: #fff;
  overflow: auto;
  min-height: 320px;
  max-height: 70vh;
}
.col-preview:empty::before {
  content: "预览会显示在这里～";
  color: var(--text-3);
  font-size: 14px;
}
.col-preview:empty { border-left: 1px solid var(--line); }
/* 单栏（隐藏预览）时 */
.col-editor-row:not(.is-split) .col-preview { display: none; }

/* 预览里的基础排版 */
.col-md h2 { font-size: 20px; margin: 18px 0 10px; }
.col-md p { margin: 10px 0; }
.col-md ul { padding-left: 22px; margin: 10px 0; }
.col-md li { margin: 4px 0; }
.col-md img { max-width: 100%; border-radius: var(--radius-sm); margin: 10px 0; display: block; }
.col-md strong { color: var(--brand); }

.col-hint { font-size: 12px; color: var(--text-3); margin-top: 6px; }

.col-form-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 6px;
}
.col-err {
  color: var(--brand-hover);
  font-size: 13px;
  font-weight: 600;
}

/* 审核中提示卡片 */
.col-review-card {
  margin-top: 22px;
  background: linear-gradient(135deg, rgba(251,114,153,.10), rgba(0,174,236,.10));
  border: 1px solid rgba(251, 114, 153, .35);
  border-radius: var(--radius-lg);
  padding: 26px;
  text-align: center;
  box-shadow: var(--shadow-md);
  animation: col-pop .4s ease;
}
.col-review-card .col-review-emoji { font-size: 44px; }
.col-review-card h3 { margin: 10px 0 6px; font-size: 20px; }
.col-review-card p { margin: 4px 0; color: var(--text-2); font-size: 14px; }
.col-review-card .col-review-tip {
  margin-top: 12px;
  display: inline-block;
  font-size: 13px;
  color: var(--brand);
  font-weight: 700;
}

/* ===== 文章详情页 ===== */
.col-article {
  max-width: 820px;
  margin: 0 auto;
}
.col-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-2);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 16px;
  cursor: pointer;
}
.col-back:hover { color: var(--brand); }
.col-article-cover {
  width: 100%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface-2);
  margin: 14px 0 22px;
  box-shadow: var(--shadow-sm);
}
.col-article-cover img { width: 100%; display: block; }
.col-article h1 {
  font-size: 28px;
  line-height: 1.4;
  margin: 0 0 12px;
}
.col-article-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-3);
  font-size: 13px;
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.col-article-meta .col-avatar { width: 28px; height: 28px; font-size: 13px; }
.col-article-meta .col-author { color: var(--text); font-weight: 700; }
.col-article-body {
  font-size: 16px;
  line-height: 1.85;
  color: var(--text);
}
.col-article-body h2 { font-size: 22px; margin: 26px 0 12px; }
.col-article-body p { margin: 14px 0; }
.col-article-body ul { padding-left: 24px; margin: 14px 0; }
.col-article-body li { margin: 6px 0; }
.col-article-body img { max-width: 100%; border-radius: var(--radius); margin: 16px 0; display: block; }
.col-article-body strong { color: var(--brand); }
.col-article-video {
  margin: 18px 0;
  border-radius: var(--radius);
  overflow: hidden;
}
.col-article-video a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  padding: 12px 18px;
  border-radius: 999px;
  transition: transform .18s ease, filter .18s ease;
}
.col-article-video a:hover { transform: translateY(-2px); filter: brightness(1.05); }
.col-gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: 18px 0;
}
.col-gallery img {
  width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
}

/* ===== 动画 ===== */
@keyframes col-fade-up {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes col-shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}
@keyframes col-pop {
  from { opacity: 0; transform: scale(.96) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .col-card, .col-skeleton .sk-cover, .col-skeleton .sk-line, .col-review-card {
    animation: none !important;
  }
  .col-card { opacity: 1; transform: none; }
}

@media (max-width: 720px) {
  .col-editor-row { grid-template-columns: 1fr; }
  .col-editor-row.is-split .col-textarea { border-radius: 0 0 var(--radius-sm) var(--radius-sm); }
  .col-editor-row.is-split .col-preview {
    border-left: 1px solid var(--line);
    border-top: none;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    min-height: 200px;
  }
  .col-page-title { font-size: 22px; }
  .col-form { padding: 16px; }
}
