* { margin:0; padding:0; box-sizing:border-box; }
body { font-family:-apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei",sans-serif;
       background:#f5f7fa; color:#1f2933; line-height:1.6; font-size:14px; }
a { color:#2563eb; text-decoration:none; }
a:hover { text-decoration:underline; }

/* 顶栏 */
.topbar { background:linear-gradient(90deg,#2f278b,#2563eb); color:#fff; box-shadow:0 2px 8px rgba(0,0,0,.1); }
.topbar-inner { max-width:1100px; margin:0 auto; padding:0 24px; height:54px; display:flex; align-items:center; gap:28px; }
.brand { color:#fff; font-weight:700; font-size:16px; }
.topbar nav { display:flex; gap:18px; }
.topbar nav a { color:rgba(255,255,255,.9); }
.user-menu { margin-left:auto; display:flex; align-items:center; gap:14px; font-size:13px; }
.user-menu em { font-style:normal; opacity:.8; }
.btn-link { color:rgba(255,255,255,.9); }

/* 容器 */
.container { max-width:1100px; margin:24px auto; padding:0 24px; }

/* 登录页 */
.login-wrap { min-height:100vh; display:flex; align-items:center; justify-content:center; background:linear-gradient(135deg,#2f278b,#2563eb); }
.login-card { background:#fff; padding:36px 40px; border-radius:14px; box-shadow:0 20px 60px rgba(0,0,0,.25); width:360px; }
.login-card h1 { font-size:20px; margin-bottom:6px; }
.login-card .sub { color:#62728a; font-size:13px; margin-bottom:24px; }

/* 表单 */
label { display:block; margin:14px 0 6px; font-weight:600; font-size:13px; }
input[type=text], input[type=password], input[type=url], textarea, select {
  width:100%; padding:9px 12px; border:1px solid #cbd5e1; border-radius:7px; font-size:14px; font-family:inherit;
}
input:focus, textarea:focus, select:focus { outline:none; border-color:#2563eb; box-shadow:0 0 0 3px rgba(37,99,235,.12); }
textarea { min-height:120px; resize:vertical; font-family:"SF Mono",Consolas,monospace; font-size:12.5px; }
.form-row.code textarea { min-height:240px; }

/* 按钮 */
button, .btn { display:inline-block; background:#2563eb; color:#fff; border:none; padding:9px 20px; border-radius:7px;
  font-size:14px; cursor:pointer; font-weight:600; }
button:hover, .btn:hover { background:#1d4ed8; text-decoration:none; }
.btn-ghost { background:#fff; color:#334155; border:1px solid #cbd5e1; }
.btn-ghost:hover { background:#f1f5f9; }
.btn-danger { background:#dc2626; color:#fff; }
.btn-danger:hover { background:#b91c1c; }
.btn-sm { padding:5px 12px; font-size:13px; }
.form-actions { margin-top:16px; display:flex; gap:10px; align-items:center; flex-wrap:wrap; }

/* 卡片 / 表格 */
.card { background:#fff; border:1px solid #e4e8ef; border-radius:12px; padding:22px 26px; margin:16px 0; box-shadow:0 1px 3px rgba(0,0,0,.04); }
.card h2 { font-size:18px; margin-bottom:14px; }

/* 两栏布局（编辑项目页：左主栏表单 + 右侧栏连接测试/危险操作） */
.two-col { display:grid; grid-template-columns: minmax(0,1fr) 340px; gap:16px; align-items:start; margin:16px 0; }
.two-col .card { margin:0; }
.two-col-main { min-width:0; }
.two-col-side { display:flex; flex-direction:column; gap:16px; min-width:0; }
@media (max-width: 880px) { .two-col { grid-template-columns:1fr; } }
table { width:100%; border-collapse:collapse; background:#fff; }
th { background:#f1f4f9; text-align:left; padding:11px 14px; font-weight:600; border-bottom:2px solid #e4e8ef; font-size:13px; }
td { padding:10px 14px; border-bottom:1px solid #eef2f7; }

/* 提示 */
.alert { padding:12px 16px; border-radius:8px; margin-bottom:16px; font-size:14px; }
.alert-success { background:#f0fdf4; border:1px solid #86efac; color:#166534; }
.alert-error { background:#fef2f2; border:1px solid #fca5a5; color:#991b1b; }
.alert-info { background:#eff6ff; border:1px solid #93c5fd; color:#1e40af; }

.page-title { display:flex; align-items:center; justify-content:space-between; margin-bottom:18px; }
.page-title h1 { font-size:22px; }
.muted { color:#62728a; font-size:13px; }
.tag { display:inline-block; padding:2px 9px; border-radius:5px; font-size:12px; font-weight:600; margin-right:6px; }
.tag-admin { background:#ede9fe; color:#6d28d9; }
.tag-user { background:#e0f2fe; color:#0369a1; }

/* 解析结果展示 */
.parse-result { background:#0f172a; color:#e2e8f0; padding:18px; border-radius:10px; font-family:"SF Mono",Consolas,monospace; font-size:12.5px; overflow-x:auto; white-space:pre-wrap; word-break:break-all; }
pre.json { background:#0f172a; color:#e2e8f0; padding:16px; border-radius:8px; font-size:12.5px; overflow-x:auto; }

.hint { font-size:12px; color:#94a3b8; margin-top:6px; }

/* 状态徽章 */
.status-badge { display:inline-block; padding:3px 11px; border-radius:999px; font-size:12.5px; font-weight:600; white-space:nowrap; }
.status-queued { background:#f1f5f9; color:#475569; }
.status-prep { background:#fff7ed; color:#c2410c; }
.status-ai { background:#f3e8ff; color:#7c3aed; }
.status-review { background:#fef9c3; color:#a16207; }
.status-ok { background:#dcfce7; color:#166534; }
.status-fail { background:#fee2e2; color:#991b1b; }
.status-user { background:#e0f2fe; color:#0369a1; }

/* 文章标题层级前缀：目录路径浅色，文章名正常色加粗 */
.art-title { font-weight:500; }
/* 列表标题单元格：单行截断省略，超长靠 title 属性悬停预览 */
.art-table td .art-title { display:inline-block; max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; vertical-align:bottom; }
.art-prefix { color:#94a3b8; font-weight:400; margin-right:3px; }

/* 文章类型面板（项目详情页） */
.type-panels { display:flex; flex-direction:column; gap:14px; }
.type-panel { padding:18px 22px; }
.type-panel-head { display:flex; align-items:center; justify-content:space-between; margin-bottom:14px; }
.type-panel-name { font-size:16px; font-weight:700; margin-right:8px; }
.type-panel-total { margin-left:10px; font-size:13px; color:#62728a; font-weight:600; }

.stage-stats { display:flex; flex-wrap:wrap; gap:10px; margin-bottom:14px; }
.stage-stat { display:inline-flex; align-items:center; gap:6px; }
.stage-stat-label { font-size:12px; color:#62728a; }
.stage-stat.is-zero { opacity:.4; }

.type-panel-actions { display:flex; gap:10px; flex-wrap:wrap; }

.batch-bar { margin-top:14px; }
.batch-bar-row { display:flex; align-items:center; gap:12px; }
.batch-progress { flex:1; height:14px; background:#f1f5f9; border-radius:999px; overflow:hidden; border:1px solid #e4e8ef; }
.batch-progress-fill { height:100%; width:0%; background:linear-gradient(90deg,#2f278b,#2563eb); transition:width .25s ease; }
.batch-stop { flex-shrink:0; }
.batch-log { margin-top:8px; font-size:13px; min-height:18px; }

/* 项目标题后的网站小字链接 */
.site-sub { font-size:13px; font-weight:400; color:#62728a; margin-left:10px; vertical-align:baseline; text-decoration:none; }
.site-sub:hover { color:#2563eb; text-decoration:underline; }

/* 文章类型空占位 */
.type-empty-placeholder { text-align:center; }
.type-empty-placeholder .muted { font-size:14px; }

/* 文章类型页工具栏 */
.art-toolbar { padding:14px 18px; }
.art-toolbar-row { display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
.art-toolbar-dir { font-size:12px; margin-left:auto; }
.art-toolbar-dir code { font-size:12px; }

/* 分组列表（分段标题扁平展开） */
.groups-wrap { display:flex; flex-direction:column; gap:14px; }
.group-card { padding:16px 22px; }
.group-head { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; margin-bottom:12px; padding-bottom:12px; border-bottom:1px solid #f1f5f9; }
.group-title { display:flex; align-items:center; gap:8px; }
.group-folder { color:#94a3b8; display:inline-flex; }
.group-name { font-size:15px; font-weight:700; }
.group-meta { font-size:12px; color:#62728a; font-weight:600; }
.group-actions { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }

/* 分组进度条百分比 */
.batch-pct { font-size:12px; color:#62728a; min-width:34px; text-align:right; flex-shrink:0; }

/* 文章操作列：主操作文字链接 + 图标按钮组 */
.art-ops { display:flex; align-items:center; gap:6px; white-space:nowrap; }
.art-op-link { background:none; border:none; padding:0; cursor:pointer; font:inherit; color:#2563eb; text-decoration:none; }
.art-op-link:hover { background:none; text-decoration:underline; }
.art-op-link.danger { color:#dc2626; }
.art-op-link .ic { width:13px; height:13px; margin-right:3px; vertical-align:-2px; }

/* 主操作：文字链接型（a 与 button 一致，覆盖 button 默认 padding/背景）*/
.art-act-link { display:inline-flex; align-items:center; gap:4px; padding:4px 8px;
  font-size:13px; font-weight:600; color:#2563eb; background:none; border:none;
  border-radius:6px; cursor:pointer; text-decoration:none; white-space:nowrap; }
.art-act-link:hover { background:#eff6ff; text-decoration:none; }
.art-act-link .ic { width:14px; height:14px; margin:0; }
.art-act-link.is-loading { opacity:.75; pointer-events:none; }

/* 图标按钮（次要操作）：方形、无边框、hover 高亮；a 与 button 一致（padding:0 覆盖 button 默认）*/
.art-icon-btn { display:inline-flex; align-items:center; justify-content:center;
  width:30px; height:30px; padding:0; border:1px solid transparent; border-radius:7px;
  background:none; color:#62728a; font-weight:400; cursor:pointer; text-decoration:none; }
.art-icon-btn:hover { background:#f1f5f9; color:#2563eb; border-color:#e4e8ef; text-decoration:none; }
.art-icon-btn .ic { width:16px; height:16px; margin:0; }
.art-icon-btn.danger:hover { background:#fef2f2; color:#dc2626; border-color:#fecaca; }
.art-icon-btn.is-loading { opacity:.75; pointer-events:none; }

/* 列表表格固定列宽，保证各分组操作列等宽对齐 */
.art-table { table-layout:fixed; }

/* 单篇操作 loading 转圈 */
.art-spin { display:inline-block; width:13px; height:13px; border:2px solid currentColor;
  border-right-color:transparent; border-radius:50%; animation:art-spin .6s linear infinite;
  vertical-align:-2px; margin-right:4px; }
@keyframes art-spin { to { transform:rotate(360deg); } }

.drawer-mask { position:fixed; inset:0; background:rgba(15,23,42,.4); z-index:40; opacity:0; visibility:hidden; transition:opacity .2s, visibility .2s; }
.drawer-mask.open { opacity:1; visibility:visible; }
.drawer { position:fixed; top:0; right:0; bottom:0; width:min(560px, 92vw); background:#fff; z-index:50;
  transform:translateX(100%); transition:transform .25s ease; display:flex; flex-direction:column;
  box-shadow:-8px 0 30px rgba(0,0,0,.12); }
.drawer.open { transform:translateX(0); }
.drawer-head { display:flex; align-items:center; justify-content:space-between; padding:16px 24px; border-bottom:1px solid #e4e8ef; }
.drawer-head h2 { font-size:17px; margin:0; }
.drawer-close { background:#f1f5f9; color:#475569; border:none; width:30px; height:30px; border-radius:7px; cursor:pointer; font-size:15px; line-height:1; }
.drawer-close:hover { background:#e2e8f0; }
.drawer-body { flex:1; overflow-y:auto; padding:18px 24px; }

/* 内联 SVG 图标（outline 风格，颜色继承 currentColor，尺寸跟随字号）*/
.ic { display:inline-block; width:1em; height:1em; vertical-align:-0.15em;
      fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
.btn .ic, button .ic { width:14px; height:14px; margin-right:5px; vertical-align:-2px; }
.btn-sm .ic { width:12px; height:12px; margin-right:4px; vertical-align:-1px; }
.btn-link .ic, .topbar .ic { width:14px; height:14px; margin-right:4px; vertical-align:-2px; }
/* 纯图标按钮（抽屉关闭 / tag 移除）：无文字间距 */
.btn-icon { padding:6px 8px; line-height:0; }
.btn-icon .ic { margin:0; width:15px; height:15px; }

/* 同步 POST 表单提交反馈：触发按钮变转圈 + 禁用态，防重复点击（轻量，无遮罩） */
/* .art-spin 已有转圈动画，复用；is-loading 仅降透明度 + 禁指针，不禁用 button 以保留其 value 提交 */
button.is-loading, .btn.is-loading, input[type=submit].is-loading {
  opacity:.7; pointer-events:none; cursor:progress; }
/* 按钮内转圈与文字对齐（覆盖 .btn .ic 的图标间距） */
.is-loading .art-spin { width:14px; height:14px; margin-right:5px; vertical-align:-2px; border-width:2px; }
.btn-sm.is-loading .art-spin { width:12px; height:12px; margin-right:4px; vertical-align:-1px; }


