/* ================= 后台 / 认证 / 控制台页面 ================= */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei",
                 "Segoe UI", Roboto, sans-serif;
    background: #f3f5f9; color: #1f2733;
    min-height: 100vh; display: flex; flex-direction: column;
}

.topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 26px; background: #fff; border-bottom: 1px solid #e6eaf2;
}
.brand { font-weight: 700; text-decoration: none; color: #16203a; font-size: 17px; }
.brand span { color: #2563eb; font-size: 13px; font-weight: 500; margin-left: 4px; }
.topbar nav { display: flex; align-items: center; gap: 16px; }
.topbar nav a { color: #45506a; text-decoration: none; font-size: 14px; }
.topbar nav a:hover { color: #2563eb; }
.whoami { color: #98a2b8; font-size: 13px; }

.page { flex: 1; width: min(1060px, 94vw); margin: 0 auto; padding: 30px 0 50px; }
.footer { text-align: center; color: #a0a8ba; font-size: 12.5px; padding: 18px; }
.footer a { color: inherit; }

h1 { font-size: 24px; margin: 8px 0 14px; }
h2 { font-size: 20px; margin: 0 0 18px; }
.muted { color: #7d879c; font-size: 13.5px; }
code { background: #eef1f7; padding: 2px 8px; border-radius: 6px; font-size: 13px; }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    color: #fff; border: none; cursor: pointer; text-decoration: none;
    font-size: 14px; padding: 10px 20px; border-radius: 10px;
    transition: filter .15s ease, transform .05s ease;
}
.btn:hover { filter: brightness(1.07); }
.btn:active { transform: translateY(1px); }
.btn-sm { padding: 5px 12px; font-size: 12.5px; border-radius: 8px; }
.btn-lg { padding: 13px 30px; font-size: 15.5px; }
.btn-block { width: 100%; }
.btn-ghost { background: #fff; color: #45506a; border: 1px solid #d8deea; }
.btn-ghost:hover { background: #f6f8fc; }
.btn-danger { background: #fee2e2 !important; color: #b91c1c !important; border: 1px solid #fecaca; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }

.flash-slot:empty { display: none; }
.flash-slot:not(:empty) {
    background: #ecfdf5; border: 1px solid #bbf7d0; color: #047857;
    padding: 10px 16px; border-radius: 10px; font-size: 13.5px; margin-bottom: 16px;
}

/* ---------- 首页 hero ---------- */
.hero { max-width: 720px; margin: 40px auto 0; text-align: center; }
.hero h1 { font-size: clamp(28px, 5vw, 44px); line-height: 1.25; margin: 0 0 16px; letter-spacing: -.02em; }
.hero h1 em { font-style: normal; background: linear-gradient(135deg,#2563eb,#7c3aed);
              -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .sub { color: #5b6579; font-size: 15.5px; line-height: 1.8; }
.hero-actions { display: flex; gap: 14px; justify-content: center; margin: 26px 0 34px; flex-wrap: wrap; }
.hero-feats { list-style: none; padding: 0; margin: 0 auto; max-width: 420px;
              display: flex; flex-direction: column; gap: 10px; text-align: left; }
.hero-feats li { background: #fff; border: 1px solid #e6eaf2; padding: 11px 16px;
                 border-radius: 12px; font-size: 14px; }

/* ---------- 登录/注册 ---------- */
.auth-card {
    width: min(400px, 92vw); margin: 46px auto 0; background: #fff;
    border: 1px solid #e6eaf2; border-radius: 16px; padding: 32px 30px 24px;
    box-shadow: 0 18px 50px -22px rgba(23,32,64,.25);
}
.auth-card label { display: block; font-size: 13.5px; color: #45506a; margin-bottom: 14px; }
.auth-card input, .panel input, .panel select {
    width: 100%; margin-top: 5px; padding: 10px 12px; font-size: 14px; font-family: inherit;
    border: 1px solid #d8deea; border-radius: 9px; background: #fbfcfe;
}
.auth-card input:focus, .panel input:focus, textarea:focus, select:focus {
    outline: 2px solid rgba(37,99,235,.3); border-color: #2563eb; background: #fff;
}
.auth-card .btn { margin-top: 6px; }
.auth-alt { text-align: center; font-size: 13.5px; margin: 16px 0 0; color: #7d879c; }
.auth-alt a { color: #2563eb; }

/* ---------- 控制台 ---------- */
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; margin-top: 18px; }
.panel { background: #fff; border: 1px solid #e6eaf2; border-radius: 14px; padding: 22px 24px; }
.panel h3 { margin: 0 0 14px; font-size: 15.5px; }
.panel label { display: block; font-size: 13px; color: #45506a; margin-bottom: 12px; }
.stat-list { list-style: none; padding: 0; margin: 0; }
.stat-list li { display: flex; justify-content: space-between; align-items: center;
                padding: 9px 0; border-bottom: 1px dashed #edf0f6; font-size: 14px; }
.stat-list li:last-child { border-bottom: none; }
.stat-list span { color: #7d879c; }
.tip { margin-top: 22px; }

/* ---------- 表格（用户管理） ---------- */
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid #e6eaf2; border-radius: 14px; }
table.list { border-collapse: collapse; width: 100%; font-size: 13.5px; }
table.list th, table.list td { text-align: left; padding: 11px 14px; border-bottom: 1px solid #eef1f6; white-space: nowrap; }
table.list th { background: #f8fafd; color: #66708a; font-weight: 600; font-size: 12.5px; }
table.list tr:last-child td { border-bottom: none; }
.tag { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; }
.tag.admin { background: #ede9fe; color: #6d28d9; }
.tag.user { background: #e0f2fe; color: #0369a1; }
.tag.off { background: #f1f5f9; color: #94a3b8; }
.row-actions { display: flex; gap: 6px; }

/* ---------- 模板管理网格 ---------- */
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; margin-top: 16px; }
.tpl-card { background: #fff; border: 1px solid #e6eaf2; border-radius: 14px; overflow: hidden; }
.tpl-card img.cover { width: 100%; height: 130px; object-fit: cover; background: #f2f4f8; display: block; }
.tpl-card .body { padding: 14px 16px; }
.tpl-card h4 { margin: 0 0 4px; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.tpl-card .desc { color: #7d879c; font-size: 12.5px; min-height: 32px; margin: 0 0 10px; }
.tpl-card .meta { color: #98a2b8; font-size: 12px; margin-bottom: 12px; }
.accent-dot { width: 13px; height: 13px; border-radius: 50%; display: inline-block; border: 2px solid #fff;
              box-shadow: 0 0 0 1px #d8deea; }

/* ---------- 模板编辑表单 ---------- */
.form-panel { background: #fff; border: 1px solid #e6eaf2; border-radius: 14px; padding: 24px; margin-bottom: 18px; }
.form-panel label { display: block; font-size: 13px; color: #45506a; margin-bottom: 12px; }
.form-inline { display: flex; gap: 14px; flex-wrap: wrap; }
.form-inline > label { flex: 1; min-width: 180px; }
textarea.css-editor {
    width: 100%; min-height: 300px; font-family: ui-monospace, "SF Mono", Consolas, monospace;
    font-size: 12.5px; line-height: 1.55; padding: 14px; border-radius: 10px;
    border: 1px solid #d8deea; background: #10162a; color: #d6e2ff; tab-size: 4;
}
.preview-frame { width: 100%; height: 430px; border: 1px solid #e6eaf2; border-radius: 12px; background: #e9edf3; }
.error-box { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c;
             padding: 10px 16px; border-radius: 10px; margin-bottom: 16px; font-size: 13.5px; }

@media (max-width: 640px) {
    .topbar { padding: 10px 14px; }
    .topbar nav { gap: 10px; }
    .page { padding-top: 20px; }
}

/* ================= 营销首页（工具站风） ================= */
.land-hero { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 40px;
             align-items: center; padding: 26px 0 6px; }
.land-badge { display: inline-block; background: #e8effd; color: #2563eb; font-size: 12.5px;
              font-weight: 600; border-radius: 999px; padding: 6px 14px; margin-bottom: 16px; }
.land-copy h1 { font-size: clamp(30px, 4.6vw, 44px); line-height: 1.22; margin: 0 0 14px; letter-spacing: .01em; }
.land-copy h1 em { font-style: normal; background: linear-gradient(135deg,#2563eb,#7c3aed);
                   -webkit-background-clip: text; background-clip: text; color: transparent; }
.land-copy .sub { color: #5c687e; font-size: 15px; line-height: 1.75; margin: 0 0 22px; }
.land-trust { list-style: none; display: flex; gap: 16px; flex-wrap: wrap; padding: 0; margin: 18px 0 0; }
.land-trust li { color: #7d879c; font-size: 13px; }

.land-showcase { text-align: center; }
.showcase-frame { display: inline-block; background: #fff; border: 1px solid #e6eaf2; border-radius: 20px;
                  padding: 22px 20px; max-width: 100%;
                  box-shadow: 0 24px 60px -18px rgba(31,42,68,.25), 0 8px 22px -12px rgba(37,99,235,.16);
 }
.showcase-frame #card { margin: 0 auto; width: 100%; max-width: 430px; }
.showcase-frame #card .card-head .card-company { font-size: 15px; }
.showcase-frame #card .card-name { font-size: 24px !important; }
.showcase-frame .card-actions, .showcase-frame .mini-copy { display: none; }
.showcase-cap { margin-top: 14px; color: #8590a6; font-size: 13px; }
.showcase-cap a { color: #2563eb; text-decoration: none; margin-left: 8px; }

.land-steps { list-style: none; display: grid; grid-template-columns: repeat(3,1fr); gap: 14px;
              padding: 0; margin: 36px 0 8px; }
.land-steps li { background: #fff; border: 1px solid #e9edf4; border-radius: 14px; padding: 16px 18px;
                 display: flex; flex-direction: column; gap: 4px; }
.land-steps i { font-style: normal; width: 26px; height: 26px; border-radius: 50%; background: #2563eb;
                color: #fff; font-size: 13px; font-weight: 700; display: flex;
                align-items: center; justify-content: center; margin-bottom: 6px; }
.land-steps b { font-size: 15px; }
.land-steps span { color: #7d879c; font-size: 13px; line-height: 1.55; }

.land-feats { margin: 42px 0 10px; }
.land-feats h2 { text-align: center; font-size: 22px; margin-bottom: 20px; }
.land-feats ul { list-style: none; margin: 0; padding: 0; display: grid;
                 grid-template-columns: repeat(2,1fr); gap: 14px; }
.land-feats li { background: #fff; border: 1px solid #e9edf4; border-radius: 14px; padding: 18px; }
.land-feats li span { font-size: 22px; }
.land-feats b { display: block; font-size: 15px; margin: 6px 0 4px; }
.land-feats em { font-style: normal; color: #7d879c; font-size: 13.5px; line-height: 1.6; }

.land-cta { margin: 46px 0 6px; background: linear-gradient(135deg,#2563eb,#4f46e5);
            border-radius: 18px; text-align: center; padding: 36px 20px; }
.land-cta h2 { color: #fff; margin: 0 0 16px; }
.land-cta .btn { background: #fff; color: #2563eb; font-weight: 600; }

@media (max-width: 900px) {
  .land-hero { grid-template-columns: 1fr; text-align: center; gap: 28px; }
  .land-copy .sub { max-width: 520px; margin-inline: auto; }
  .hero-actions, .land-trust { justify-content: center; }
  .land-steps { grid-template-columns: 1fr; }
  .land-feats ul { grid-template-columns: 1fr; }
}

/* ================= 模板长廊（自动巡游 + 拖拽） ================= */
.land-tpl { margin: 30px 0 4px; }
.land-tpl-head { text-align: center; margin-bottom: 4px; }
.land-tpl-head h2 { font-size: 22px; margin: 0 0 6px; }
.land-sub { color: #8590a6; font-size: 13.5px; margin: 0; }
.tpl-scroller { overflow-x: auto; cursor: grab; scrollbar-width: none; -ms-overflow-style: none;
                -webkit-overflow-scrolling: touch; }
.tpl-scroller::-webkit-scrollbar { display: none; }
.tpl-scroller.dragging { cursor: grabbing; user-select: none; }
.tpl-chip img, .tpl-chip b { -webkit-user-drag: none; }
.tpl-track { display: flex; gap: 16px; width: max-content; padding: 12px 4px 6px; }
.tpl-chip { flex: 0 0 auto; width: calc((min(1060px, 94vw) - 56px) / 4); user-select: none;
            -webkit-user-drag: none; background: #fff; border: 1px solid #e9edf4; border-radius: 14px;
            padding: 10px 10px 8px; text-decoration: none; color: inherit;
            transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.tpl-chip:hover { transform: translateY(-4px); border-color: #cfd9f2;
                  box-shadow: 0 14px 30px -18px rgba(31,42,68,.35); }
.tpl-thumb { display: block; border-radius: 9px; overflow: hidden; background: #f6f8fb; }
.tpl-thumb img { display: block; width: 100%; height: auto; }
.tpl-fallback { display: flex; align-items: center; justify-content: center; height: 132px;
                background: linear-gradient(135deg, color-mix(in srgb, var(--a, #2563eb) 12%, #fff), #fff);
                color: var(--a, #2563eb); font-weight: 700; }
.tpl-chip b { display: block; text-align: center; font-size: 13px; margin-top: 8px; color: #384052; }
@media (max-width: 900px) { .tpl-chip { width: calc((min(1060px, 94vw) - 24px) / 2); } }
@media (max-width: 560px) { .tpl-chip { width: calc(min(1060px, 94vw) - 8px); } }

/* ================= 模板长廊：翻页箭头 ================= */
.tpl-wrap { position: relative; }
.tpl-arrow { position: absolute; top: 50%; transform: translateY(-50%); z-index: 5;
             width: 42px; height: 42px; border-radius: 50%; border: 1px solid #e6eaf2;
             background: rgba(255,255,255,.94); color: #2c3a55; font-size: 24px; line-height: 1;
             cursor: pointer; box-shadow: 0 6px 18px -8px rgba(31,42,68,.4);
             display: flex; align-items: center; justify-content: center; padding-bottom: 3px;
             transition: background .15s ease, color .15s ease, border-color .15s ease; }
.tpl-arrow:hover { background: #2563eb; color: #fff; border-color: #2563eb; }
.tpl-arrow:active { transform: translateY(-50%) scale(.94); }
.tpl-prev { left: 10px; }
.tpl-next { right: 10px; }
@media (max-width: 700px) { .tpl-arrow { display: none; } }
