/* =====================================================================
 * GEO + AI 智能内容生成系统 —— 自定义补充样式
 * TailwindCSS 负责绝大部分布局，本文件仅做细节覆盖与第三方组件微调。
 * ===================================================================== */

:root {
  --brand: #059669;          /* emerald-600 */
  --brand-dark: #047857;     /* emerald-700 */
  --ink: #0f172a;            /* slate-900 */
}

html, body {
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

/* 自定义滚动条 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* 侧边栏激活项 */
.nav-link {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .6rem .85rem;
  border-radius: .6rem;
  color: #cbd5e1;
  font-size: .9rem;
  transition: all .15s ease;
}
.nav-link:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.nav-link.active { background: var(--brand); color: #fff; font-weight: 600; }

/* 卡片 */
.card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: .85rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}

/* 统计卡片 */
.stat-card {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  padding: 1.1rem 1.25rem;
}
.stat-card .stat-value { font-size: 1.9rem; font-weight: 800; color: var(--ink); line-height: 1; }
.stat-card .stat-label { font-size: .8rem; color: #64748b; }

/* 表格 */
.table-base { width: 100%; border-collapse: collapse; font-size: .875rem; }
.table-base th {
  text-align: left;
  padding: .65rem .75rem;
  background: #f8fafc;
  color: #475569;
  font-weight: 600;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
}
.table-base td {
  padding: .65rem .75rem;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
  vertical-align: middle;
}
.table-base tr:hover td { background: #f8fafc; }

/* 状态徽章 */
.badge { display: inline-flex; align-items: center; gap: .25rem; padding: .15rem .55rem; border-radius: 9999px; font-size: .72rem; font-weight: 600; }
.badge-draft { background: #f1f5f9; color: #475569; }
.badge-review { background: #fef3c7; color: #b45309; }
.badge-published { background: #d1fae5; color: #047857; }
.badge-rejected { background: #fee2e2; color: #b91c1c; }
.badge-running { background: #dbeafe; color: #1d4ed8; }
.badge-pending { background: #f1f5f9; color: #475569; }
.badge-paused { background: #fef9c3; color: #a16207; }
.badge-completed { background: #d1fae5; color: #047857; }
.badge-failed { background: #fee2e2; color: #b91c1c; }
.badge-stopped { background: #e2e8f0; color: #334155; }

/* 按钮 */
.btn { display: inline-flex; align-items: center; gap: .4rem; border-radius: .55rem; padding: .5rem .9rem; font-size: .85rem; font-weight: 600; transition: all .15s; cursor: pointer; border: 1px solid transparent; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-ghost { background: #fff; border-color: #e2e8f0; color: #334155; }
.btn-ghost:hover { background: #f8fafc; }
.btn-danger { background: #dc2626; color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* 表单 */
.form-input, .form-select, .form-textarea {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: .55rem;
  padding: .5rem .7rem;
  font-size: .875rem;
  color: #0f172a;
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(5, 150, 105, .15);
}
.form-label { display: block; font-size: .8rem; font-weight: 600; color: #475569; margin-bottom: .3rem; }

/* Tab */
.tab-btn { padding: .5rem .9rem; border-radius: .55rem; font-size: .85rem; font-weight: 600; color: #475569; cursor: pointer; }
.tab-btn.active { background: var(--brand); color: #fff; }

/* Toast */
#toast-host { position: fixed; top: 1rem; right: 1rem; z-index: 9999; display: flex; flex-direction: column; gap: .5rem; }
.toast { min-width: 240px; max-width: 360px; padding: .7rem .9rem; border-radius: .6rem; color: #fff; font-size: .85rem; box-shadow: 0 8px 24px rgba(15, 23, 42, .18); animation: toast-in .18s ease; }
.toast-success { background: #059669; }
.toast-error { background: #dc2626; }
.toast-info { background: #2563eb; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* 模态框 */
.modal-mask { position: fixed; inset: 0; background: rgba(15, 23, 42, .5); z-index: 9000; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.modal-panel { background: #fff; border-radius: .9rem; width: 100%; max-width: 640px; max-height: 90vh; overflow: auto; box-shadow: 0 20px 50px rgba(15, 23, 42, .3); }
.hidden { display: none !important; }

/* EasyMDE 覆盖 */
.EasyMDEContainer .CodeMirror { border-color: #cbd5e1; border-radius: 0 .55rem .55rem .55rem; min-height: 360px; font-size: .9rem; }
.editor-toolbar { border-color: #cbd5e1; border-radius: .55rem .55rem 0 0; }
.editor-preview { background: #fff; }

/* Tagify 覆盖 */
.tagify { border-radius: .55rem; border-color: #cbd5e1; --tag-bg: #059669; }

/* 图片网格 */
.img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .75rem; }
.img-cell { position: relative; border: 1px solid #e2e8f0; border-radius: .6rem; overflow: hidden; background: #f8fafc; }
.img-cell img { width: 100%; height: 110px; object-fit: cover; display: block; }
.img-cell .img-meta { padding: .35rem .5rem; font-size: .72rem; color: #64748b; }

/* 步骤条 */
.step-dot { width: 28px; height: 28px; border-radius: 9999px; display: flex; align-items: center; justify-content: center; font-size: .8rem; font-weight: 700; background: #e2e8f0; color: #475569; }
.step-dot.active { background: var(--brand); color: #fff; }
.step-dot.done { background: #a7f3d0; color: #065f46; }

/* 前台阅读样式 */
.prose-content { line-height: 1.8; color: #1e293b; }
.prose-content h1, .prose-content h2, .prose-content h3 { font-weight: 700; margin: 1.4em 0 .6em; color: #0f172a; }
.prose-content h2 { font-size: 1.4rem; }
.prose-content h3 { font-size: 1.15rem; }
.prose-content p { margin: .8em 0; }
.prose-content ul, .prose-content ol { margin: .8em 0 .8em 1.4em; }
.prose-content li { margin: .3em 0; list-style: disc; }
.prose-content a { color: var(--brand); text-decoration: underline; }
.prose-content img { max-width: 100%; border-radius: .6rem; }
.prose-content blockquote { border-left: 4px solid #a7f3d0; padding-left: .9rem; color: #475569; margin: 1em 0; }
.prose-content pre { background: #0f172a; color: #e2e8f0; padding: .9rem; border-radius: .6rem; overflow: auto; }
.prose-content code { background: #f1f5f9; padding: .1rem .3rem; border-radius: .3rem; font-size: .88em; }

/* 加载遮罩 */
.loading-mask { position: fixed; inset: 0; background: rgba(255, 255, 255, .6); z-index: 9500; display: flex; align-items: center; justify-content: center; }
.spinner { width: 36px; height: 36px; border: 3px solid #d1d5db; border-top-color: var(--brand); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* 空状态 */
.empty-state { text-align: center; padding: 2.5rem 1rem; color: #94a3b8; }
