/* 前台自适应样式：桌面双栏，移动端单列堆叠 */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: "Microsoft YaHei", "PingFang SC", system-ui, -apple-system, sans-serif;
    background: #f3f5f7; color: #1f2937; min-height: 100vh;
}

/* 头部 */
.site-header { background: linear-gradient(135deg, #0f766e, #115e59); color: #fff; padding: 26px 16px; }
.header-inner { max-width: 1200px; margin: 0 auto; }
.site-header h1 { margin: 0 0 6px; font-size: 24px; }
.site-header .sub { margin: 0; opacity: .9; font-size: 14px; }

.wrap { max-width: 1200px; margin: 0 auto; }

/* 布局网格 */
.grid {
    display: grid; grid-template-columns: 360px minmax(0, 1fr);
    gap: 20px; padding: 20px 16px 40px; align-items: start;
}
.panel, .preview-panel {
    background: #fff; border-radius: 12px; padding: 18px;
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
}

/* 表单控件 */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; color: #374151; margin-bottom: 6px; }
.field .val { color: #0f766e; font-weight: 600; }
textarea, select, input[type="range"] { width: 100%; }
textarea {
    min-height: 110px; padding: 10px 12px; border: 1px solid #d1d5db; border-radius: 8px;
    font-size: 14px; font-family: inherit; resize: vertical; line-height: 1.6;
}
select {
    padding: 10px 12px; border: 1px solid #d1d5db; border-radius: 8px; font-size: 14px; background: #fff;
}
input[type="range"] { accent-color: #0f766e; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.subfield label { font-size: 13px; color: #374151; margin-bottom: 6px; display: block; }
.subfield.check label { display: flex; align-items: center; gap: 8px; margin-top: 22px; }
input[type="color"] { width: 100%; height: 40px; border: 1px solid #d1d5db; border-radius: 8px; padding: 2px; background: #fff; }
input[type="checkbox"] { width: auto; }
.mini-tip { font-size: 12px; color: #6b7280; margin-top: 10px; }

.actions { display: flex; gap: 12px; margin-top: 18px; flex-wrap: wrap; }
.btn { border: 0; border-radius: 8px; padding: 11px 20px; font-size: 14px; cursor: pointer; }
.btn.primary { background: #0f766e; color: #fff; }
.btn.primary:hover { background: #115e59; }
.btn.ghost { background: #eef2f3; color: #374151; }
.btn.ghost:hover { background: #e2e8f0; }

/* 预览区 */
.preview-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.status { font-size: 13px; color: #6b7280; }
.status.busy { color: #b45309; }
.preview-box {
    min-height: 360px; border-radius: 10px; border: 1px dashed #cbd5e1;
    display: flex; align-items: center; justify-content: center; padding: 20px;
    /* 棋盘格底纹，透明背景时可辨识边缘 */
    background: repeating-conic-gradient(#e9edf2 0% 25%, #f8fafc 0% 50%) 0 0 / 24px 24px;
}
.preview-box img { max-width: 100%; height: auto; max-height: 60vh; background: #fff; border-radius: 6px; }
.empty { color: #9ca3af; font-size: 14px; text-align: center; }

.site-footer { text-align: center; color: #9ca3af; font-size: 12px; padding: 16px; }

/* ============ CMS 首页：分类卡片列表 ============ */
.tabs { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 8px; }
.tabs a {
    padding: 7px 16px; border-radius: 999px; background: #fff; color: #374151;
    text-decoration: none; font-size: 13px; box-shadow: 0 1px 2px rgba(0,0,0,.06);
}
.tabs a:hover { background: #0f766e; color: #fff; }
.cat-block { padding-bottom: 20px; }
.cat-section { margin-top: 26px; scroll-margin-top: 12px; }
.cat-title-row { display: flex; align-items: baseline; gap: 10px; margin-bottom: 14px; }
.cat-title { margin: 0; font-size: 19px; border-left: 4px solid #0f766e; padding-left: 10px; }
.cat-count { font-size: 12px; color: #6b7280; }
.grid-cards {
    display: grid; gap: 16px;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.card-font {
    display: block; background: #fff; border-radius: 12px; overflow: hidden;
    text-decoration: none; color: inherit; box-shadow: 0 1px 4px rgba(0,0,0,.08);
    transition: transform .15s ease, box-shadow .15s ease;
}
.card-font:hover { transform: translateY(-3px); box-shadow: 0 8px 22px rgba(0,0,0,.12); }
.thumb-box { aspect-ratio: 16 / 9; background: #f1f5f9; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.thumb-box img { width: 100%; height: 100%; object-fit: cover; }
.thumb-placeholder { color: #94a3b8; font-size: 13px; }
.card-info { padding: 13px 15px 15px; }
.card-name { font-weight: 600; font-size: 15px; margin-bottom: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-meta { display: flex; gap: 8px; margin-bottom: 8px; }
.chip {
    display: inline-block; padding: 2px 10px; border-radius: 999px;
    background: #ecfdf5; color: #0f766e; font-size: 12px;
}
.chip-ext { background: #f1f5f9; color: #475569; }
.chip.light { background: rgba(255,255,255,.18); color: #fff; margin-right: 8px; }
.card-desc { margin: 0 0 10px; font-size: 13px; color: #6b7280; line-height: 1.5; min-height: 36px; }
.card-cta { font-size: 13px; color: #0f766e; font-weight: 600; }
.empty-big {
    background: #fff; border-radius: 12px; padding: 60px 20px; text-align: center;
    color: #6b7280; margin: 30px 0;
}

/* ============ 详情转换页 ============ */
.back-link { display: inline-block; color: rgba(255,255,255,.85); font-size: 13px; margin-bottom: 8px; text-decoration: none; }
.back-link:hover { color: #fff; }
.detail-desc { background: #f0fdfa; border-radius: 8px; padding: 10px 14px; font-size: 13px; color: #115e59; margin: 0 0 14px; }
.origin-thumb { margin-bottom: 14px; }
.origin-label { display: block; font-size: 12px; color: #6b7280; margin-bottom: 6px; }
.origin-thumb img { max-width: 100%; border: 1px solid #e5e7eb; border-radius: 8px; background: #fff; }
.detail-empty { max-width: 560px; margin: 60px auto; text-align: center; }
.detail-empty .btn { display: inline-block; margin-top: 10px; }

/* 响应式：窄屏单列 */
@media (max-width: 900px) {
    .grid { grid-template-columns: 1fr; }
    .site-header h1 { font-size: 20px; }
    .row2 { grid-template-columns: 1fr; gap: 14px; }
    .subfield.check label { margin-top: 6px; }
    .preview-box { min-height: 240px; }
    .grid-cards { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
    .card-desc { display: none; }
}
