/* ==========================================================================
   辰市集 · 活动后台 样式表
   风格：Neo-Brutalism —— 实心填充 + 墨黑描边 + 平移硬阴影 + 糖果色
   框架对齐辰市集 2.0「集市管理」：浅米侧栏 / 白色标题条 / 米色画布 / 蓝色表头
   ========================================================================== */

:root {
    --ink:      #111111;
    --ink-soft: #3A3A42;
    --paper:    #FFFFFF;
    --bg:       #F5F0E2;   /* 画布米色 */
    --line:     #E2DCC8;

    --pink:   #FF7EB6;
    --yellow: #FFD84D;
    --blue:   #4A90D9;
    --green:  #5BD868;
    --purple: #C89BFF;
    --orange: #FF9F45;
    --red:    #FF6B6B;
    --candy-blue: #5BC8FF;

    --shadow:    3px 3px 0 var(--ink);
    --shadow-sm: 2px 2px 0 var(--ink);
    --radius:    6px;
}

* { box-sizing: border-box; }

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

body {
    background: var(--bg);
    color: var(--ink);
    font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
b  { font-weight: 700; }

/* ── 通用按钮 ──────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 7px 14px;
    border: 2px solid var(--ink);
    border-radius: var(--radius);
    background: var(--paper);
    color: var(--ink);
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: transform .12s ease, box-shadow .12s ease;
    white-space: nowrap;
    font-family: inherit;
}
.btn:hover  { transform: translateY(-2px); box-shadow: 3px 3px 0 var(--ink); }
.btn:active { transform: translate(1px, 1px);  box-shadow: 1px 1px 0 var(--ink); }

.btn-primary { background: var(--yellow); }
.btn-ghost   { background: var(--paper); color: #666; }
.btn-new     { background: var(--green); }
.btn-block   { width: 100%; justify-content: center; padding: 11px; font-size: 15px; }

/* ── 骨架：浅米侧栏 + 白色标题条 + 米色画布 ───────────────────── */
.shell { display: flex; min-height: 100vh; background: var(--bg); }

.sidebar {
    width: 214px;
    flex: 0 0 214px;
    background: #F7F2E2;
    border-right: 3px solid var(--ink);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.sb-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 14px;
    border-bottom: 3px solid var(--ink);
    background: var(--paper);
}
.sb-logo  { font-size: 24px; line-height: 1; }
.sb-name  { font-size: 13.5px; font-weight: 900; line-height: 1.3; }
.sb-name em {
    display: block;
    font-style: normal;
    font-size: 10.5px;
    font-weight: 600;
    color: #8A8A96;
    letter-spacing: .2px;
}

.sb-nav { padding: 10px 10px; flex: 1; }
.sb-group {
    padding: 14px 8px 6px;
    font-size: 11px;
    font-weight: 800;
    color: #8A8A96;
    letter-spacing: 1.4px;
}
.sb-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 10px;
    margin-bottom: 4px;
    border: 2px solid transparent;
    border-radius: var(--radius);
    color: var(--ink);
    font-size: 13.5px;
    font-weight: 700;
    transition: transform .12s ease;
}
.sb-item:hover { background: #FFFDF4; transform: translateX(2px); }
.sb-item.is-active {
    background: var(--yellow);
    border-color: var(--ink);
    box-shadow: var(--shadow-sm);
    font-weight: 900;
}
.sb-icon { font-size: 15px; width: 20px; text-align: center; }

.sb-foot {
    padding: 12px 16px;
    border-top: 3px solid var(--ink);
    font-size: 12px;
    font-weight: 700;
    color: #6E6E7A;
}
.sb-foot a:hover { color: #B3541E; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* ── 白色标题条 ───────────────────────────────────────────────── */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 13px 20px;
    background: var(--paper);
    color: var(--ink);
    border-bottom: 3px solid var(--ink);
}
.page-title {
    margin: 0;
    font-size: 22px;
    font-weight: 900;
    letter-spacing: .5px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.pt-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px; height: 36px;
    border: 2px solid var(--ink);
    border-radius: var(--radius);
    background: var(--yellow);
    font-size: 17px;
    box-shadow: var(--shadow-sm);
}
.topbar-right { display: flex; align-items: center; gap: 10px; }

.icon-btn {
    width: 36px; height: 36px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 2px solid var(--ink);
    border-radius: var(--radius);
    background: var(--paper);
    color: var(--ink);
    font-size: 16px;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}
.icon-btn:hover { background: var(--yellow); }

.adm-drop { position: relative; }
.adm-btn {
    display: flex; align-items: center; gap: 7px;
    padding: 5px 12px 5px 5px;
    border: 2px solid var(--ink);
    border-radius: var(--radius);
    background: var(--paper);
    color: var(--ink);
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    font-family: inherit;
}
.adm-btn:hover { background: #FFFDF4; }
.adm-avatar {
    display: inline-flex; align-items: center; justify-content: center;
    width: 26px; height: 26px;
    background: var(--yellow);
    border: 2px solid var(--ink);
    border-radius: 4px;
    font-weight: 900;
    font-size: 13px;
}
.caret { font-size: 10px; opacity: .6; }

.adm-menu {
    position: absolute;
    right: 0; top: calc(100% + 8px);
    min-width: 200px;
    background: var(--paper);
    border: 2px solid var(--ink);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 6px;
    display: none;
    z-index: 60;
}
.adm-drop:hover .adm-menu { display: block; }
.adm-menu-head {
    padding: 8px 10px 10px;
    border-bottom: 2px solid var(--line);
    margin-bottom: 6px;
}
.adm-menu-head b   { display: block; font-size: 13px; }
.adm-menu-head small { color: #888; font-size: 11.5px; word-break: break-all; }
.adm-menu-item {
    display: block;
    width: 100%;
    padding: 8px 10px;
    border: none;
    border-radius: 4px;
    background: transparent;
    text-align: left;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    color: var(--ink);
    font-family: inherit;
}
.adm-menu-item:hover { background: var(--bg); }
.adm-menu-item.danger { color: var(--red); }

/* ── 面包屑 ───────────────────────────────────────────────────── */
.crumb {
    padding: 8px 20px;
    background: #EFE9D6;
    border-bottom: 2px solid var(--ink);
    font-size: 12.5px;
    color: #6E6E7A;
    font-weight: 700;
}
.crumb .sep { margin: 0 6px; color: var(--ink); }

.content { padding: 18px 20px 60px; flex: 1; }

/* ── 提示条 ───────────────────────────────────────────────────── */
.flash {
    padding: 10px 14px;
    border: 2px solid var(--ink);
    border-radius: var(--radius);
    margin-bottom: 14px;
    font-size: 13px;
    font-weight: 800;
    box-shadow: var(--shadow-sm);
}
.flash-ok  { background: var(--green); }
.flash-err { background: var(--red); color: #fff; }

/* ── 页头 ─────────────────────────────────────────────────────── */
.page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}
.tag-block {
    display: inline-block;
    padding: 8px 18px;
    background: var(--tag-color, var(--blue));
    border: 2px solid var(--ink);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    font-weight: 900;
    font-size: 15px;
    color: #fff;
}
.head-right {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    font-size: 13px;
}
.muted { color: #8A8A96; }

.per-page { display: inline-flex; align-items: center; gap: 4px; color: #8A8A96; }
.per-page a {
    padding: 4px 12px;
    border: 2px solid var(--ink);
    border-radius: 999px;
    background: var(--paper);
    color: var(--ink);
    font-weight: 800;
    font-size: 12px;
}
.per-page a.on { background: var(--green); }

.view-toggle { display: inline-flex; }
.view-toggle a {
    padding: 6px 13px;
    border: 2px solid var(--ink);
    background: var(--paper);
    font-size: 12.5px;
    font-weight: 800;
    cursor: pointer;
}
.view-toggle a:first-child { border-radius: 999px 0 0 999px; }
.view-toggle a:last-child  { border-radius: 0 999px 999px 0; border-left: none; }
.view-toggle a.on { background: var(--blue); color: #fff; }

/* ── 黄色说明条 ───────────────────────────────────────────────── */
.note-bar {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 11px 14px;
    background: var(--yellow);
    border: 2px solid var(--ink);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    margin-bottom: 14px;
    font-size: 13px;
    font-weight: 700;
}
.note-icon  { font-size: 16px; line-height: 1.4; }
.note-text  { flex: 1; }
.note-close {
    border: none; background: transparent; cursor: pointer;
    font-size: 14px; font-weight: 900; padding: 0 2px; line-height: 1.4;
}
.note-close:hover { color: #B00; }
.note-bar.is-closed { display: none; }

/* ── 状态 Tab ─────────────────────────────────────────────────── */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.tab {
    padding: 6px 15px;
    border: 2px solid var(--ink);
    border-radius: 999px;
    background: var(--paper);
    font-size: 12.5px;
    font-weight: 800;
}
.tab b { margin-left: 3px; }
.tab.on { background: var(--candy-blue); }

/* ── 筛选行 ───────────────────────────────────────────────────── */
.filter-row { margin-bottom: 12px; }
.filter-form { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-form input[type="search"],
.filter-form input[type="text"],
.filter-form select {
    padding: 8px 12px;
    border: 2px solid var(--ink);
    border-radius: var(--radius);
    background: var(--paper);
    font-size: 13px;
    font-family: inherit;
    color: var(--ink);
    min-width: 150px;
}
.filter-form input[type="search"] { min-width: 240px; }

/* ── 批量行：绿/黄/粉 三色按钮组 ──────────────────────────────── */
.batch-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 10px 12px;
    margin-bottom: 14px;
    background: var(--paper);
    border: 2px solid var(--ink);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.batch-select {
    padding: 7px 12px;
    border: 2px solid var(--ink);
    border-radius: var(--radius);
    background: var(--paper);
    font-size: 13px;
    font-family: inherit;
    font-weight: 700;
}
.danger-text { color: var(--red); }

/* ── 数据表（对齐辰市集 2.0 集市管理） ───────────────────────── */
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--paper);
    border: 2px solid var(--ink);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.data-table thead th {
    background: var(--blue);
    color: #fff;
    border-bottom: 2px solid var(--ink);
    padding: 9px 11px;
    text-align: left;
    font-size: 12.5px;
    font-weight: 900;
    white-space: nowrap;
}
.data-table tbody td {
    padding: 9px 11px;
    border-bottom: 1px solid var(--line);
    font-size: 13px;
    vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: #FFFEFA; }
.data-table tbody tr.dragging { opacity: .4; }
.data-table tbody tr.drag-over td { box-shadow: inset 0 3px 0 var(--blue); }

.col-chk  { width: 34px; text-align: center; }
.col-thumb{ width: 58px; }
.col-ops  { width: 160px; white-space: nowrap; }
.col-drag { width: 30px; text-align: center; cursor: grab; color: #9A9AA6; font-size: 15px; }

.thumb-cell img, .thumb-ph {
    width: 44px; height: 44px;
    object-fit: cover;
    display: block;
    border: 2px solid var(--ink);
    border-radius: 4px;
    background: #F0EDE0;
}
.thumb-ph {
    display: flex; align-items: center; justify-content: center;
    font-size: 10px; color: #A8A8B4; font-weight: 700;
}

.cell-main b { display: block; font-weight: 800; }
.cell-main span { display: block; font-size: 12px; color: #8A8A96; }

.chip {
    display: inline-block;
    padding: 2px 10px;
    border: 2px solid var(--ink);
    border-radius: 999px;
    background: var(--purple);
    font-size: 11.5px;
    font-weight: 800;
}
.chip-free { background: var(--green); }
.chip-soft  { background: var(--paper); color: #666; font-weight: 600; }

.badge {
    display: inline-block;
    padding: 2px 11px;
    border: 2px solid var(--ink);
    border-radius: 999px;
    color: var(--ink);
    font-size: 11.5px;
    font-weight: 900;
    white-space: nowrap;
}

/* ── 属性方形图标开关（对齐辰市集 2.0 attr-badge） ───────────── */
.attr-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px; height: 28px;
    border: 2px solid var(--ink);
    border-radius: 5px;
    background: #E5E5EA;
    color: #B4B4BE;
    cursor: pointer;
    padding: 0;
    transition: transform .1s ease;
}
.attr-badge:hover { transform: translateY(-2px); }
.attr-badge.lit { color: var(--ink); }
.attr-badge.lit.tag-green  { background: var(--green); }
.attr-badge.lit.tag-blue   { background: var(--candy-blue); }
.attr-badge.lit.tag-yellow { background: var(--yellow); }
.attr-badge.lit.tag-pink   { background: var(--pink); }

/* ── 行内快速开关 😊 ⭐ ⚠️ ───────────────────────────────────── */
.quicks { display: inline-flex; gap: 5px; }
.q-btn {
    min-width: 30px;
    height: 30px;
    padding: 0 7px;
    border: 2px solid var(--ink);
    border-radius: var(--radius);
    background: var(--paper);
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    filter: grayscale(1);
    opacity: .5;
    transition: transform .1s ease;
}
.q-btn:hover { transform: translateY(-2px); }
.q-btn.on { filter: none; opacity: 1; background: var(--yellow); }
.q-btn.q-flag.on { background: var(--orange); }
.q-btn small { font-size: 11px; font-weight: 700; margin-left: 2px; }

/* ── 行内操作按钮 ─────────────────────────────────────────────── */
.op {
    display: inline-block;
    padding: 4px 11px;
    border: 2px solid var(--ink);
    border-radius: 4px;
    background: var(--paper);
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    font-family: inherit;
}
.op:hover { transform: translateY(-2px); }
.op-view { background: var(--paper); }
.op-edit { background: var(--yellow); }
.op-del  { background: var(--pink); }
.inline-form { display: inline; }

.empty-cell {
    padding: 42px 16px;
    text-align: center;
    color: #9A9AA6;
    font-weight: 600;
}

/* ── 分页 ─────────────────────────────────────────────────────── */
.pager {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
    font-size: 13px;
}
.pg {
    padding: 6px 14px;
    border: 2px solid var(--ink);
    border-radius: 999px;
    background: var(--paper);
    font-weight: 800;
}
.pg.disabled { opacity: .4; }
.pg-info { color: #8A8A96; font-weight: 700; }

/* ── 卡片视图 ─────────────────────────────────────────────────── */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(248px, 1fr));
    gap: 16px;
}
.view-wrap.is-hidden { display: none !important; }

.card {
    background: var(--paper);
    border: 2px solid var(--ink);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.card-cover {
    position: relative;
    height: 158px;
    background: #F0EDE0;
    border-bottom: 2px solid var(--ink);
    overflow: hidden;
}
.card-cover.is-empty { display: flex; align-items: center; justify-content: center; }
.cover-ph { color: #B4B4C0; font-size: 12.5px; font-weight: 700; }
.carousel { display: flex; height: 100%; }
.carousel .slide { min-width: 100%; height: 100%; object-fit: cover; display: none; }
.carousel .slide.on { display: block; }
.dots {
    position: absolute; left: 0; right: 0; bottom: 8px;
    display: flex; justify-content: center; gap: 5px;
}
.dot {
    width: 8px; height: 8px;
    border: 1.5px solid var(--ink);
    border-radius: 50%;
    background: #fff;
}
.dot.on { background: var(--ink); }
.card-check {
    position: absolute; top: 8px; right: 8px;
    background: #fff;
    border: 2px solid var(--ink);
    border-radius: 4px;
    padding: 2px 5px;
    cursor: pointer;
}
.card-badge { position: absolute; top: 8px; left: 8px; }

.card-body { padding: 12px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-title { font-weight: 900; font-size: 14.5px; line-height: 1.35; }
.card-sub   { font-size: 12px; color: #8A8A96; }
.card-fields { display: flex; gap: 5px; flex-wrap: wrap; }
.card-quicks { display: flex; gap: 5px; flex-wrap: wrap; margin-top: auto; }
.card-ops   { display: flex; gap: 6px; align-items: center; padding-top: 8px; border-top: 1px solid var(--line); }

/* ── 弹窗 ─────────────────────────────────────────────────────── */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(17, 17, 17, .5);
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding: 30px 16px;
    overflow-y: auto;
    z-index: 100;
}
.modal.is-open { display: flex; }
.modal-card {
    width: 100%;
    max-width: 680px;
    background: var(--paper);
    border: 2px solid var(--ink);
    border-radius: var(--radius);
    box-shadow: 6px 6px 0 var(--ink);
    animation: pop .16s ease-out;
}
@keyframes pop {
    from { transform: translateY(-14px) scale(.98); opacity: 0; }
    to   { transform: none; opacity: 1; }
}
.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--yellow);
    border-bottom: 2px solid var(--ink);
    font-size: 15px;
}
.modal-close {
    border: none; background: transparent;
    font-size: 16px; font-weight: 900; cursor: pointer; line-height: 1;
}
.modal-body { padding: 16px; max-height: 68vh; overflow-y: auto; }
.modal-foot {
    display: flex; justify-content: flex-end; gap: 10px;
    padding: 12px 16px;
    border-top: 2px solid var(--ink);
    background: var(--bg);
}

/* ── 表单 ─────────────────────────────────────────────────────── */
.form-row { display: flex; gap: 12px; margin-bottom: 14px; align-items: flex-start; }
.form-label {
    flex: 0 0 96px;
    padding-top: 9px;
    font-size: 13px;
    font-weight: 800;
}
.form-label em { color: var(--red); font-style: normal; margin-left: 2px; }
.form-ctrl { flex: 1; min-width: 0; }
.form-ctrl input[type="text"],
.form-ctrl input[type="number"],
.form-ctrl input[type="datetime-local"],
.form-ctrl select,
.form-ctrl textarea {
    width: 100%;
    padding: 9px 12px;
    border: 2px solid var(--ink);
    border-radius: 4px;
    background: var(--paper);
    font-size: 13.5px;
    font-family: inherit;
    color: var(--ink);
}
.form-ctrl textarea { resize: vertical; min-height: 90px; line-height: 1.6; }
.form-ctrl input:focus, .form-ctrl select:focus, .form-ctrl textarea:focus {
    outline: 3px solid var(--candy-blue);
    outline-offset: 1px;
}
.form-hint { margin: 5px 0 0; font-size: 11.5px; color: #8A8A96; }

/* ── 组件 1：卡片选择 ─────────────────────────────────────────── */
.form-chips { display: flex; gap: 10px; flex-wrap: wrap; }
.form-chip { position: relative; }
.form-chip input { position: absolute; opacity: 0; pointer-events: none; }
.form-chip span {
    display: inline-block;
    padding: 9px 18px;
    border: 2px solid var(--ink);
    border-radius: var(--radius);
    background: var(--paper);
    font-weight: 800;
    font-size: 13.5px;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: transform .12s ease;
}
.form-chip span:hover { transform: translateY(-2px); }
.form-chip input:checked + span { background: var(--yellow); }
.form-chip input:checked + span::after { content: ' ✓'; }

/* ── 组件 2：滑块开关（iOS 风格） ────────────────────────────── */
.switch-field {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
}
.switch { position: relative; display: inline-block; width: 56px; height: 30px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute; cursor: pointer; inset: 0;
    border: 2px solid var(--ink); border-radius: 30px;
    background: #9CA3AF; transition: .2s;
}
.slider::before {
    content: ''; position: absolute;
    height: 22px; width: 22px; left: 2px; top: 2px;
    background: #fff; border: 2px solid var(--ink);
    border-radius: 50%; transition: .2s;
}
.switch input:checked + .slider { background: var(--green); }
.switch input:checked + .slider::before { transform: translateX(26px); }
.switch-label { font-weight: 800; font-size: 13.5px; }

/* ── 组件 3：标签输入 ─────────────────────────────────────────── */
.tag-input {
    display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
    border: 2px solid var(--ink); border-radius: var(--radius);
    padding: 8px; background: var(--paper); min-height: 46px;
}
.tag-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-chip {
    display: inline-flex; align-items: center; gap: 4px;
    background: var(--yellow); border: 2px solid var(--ink);
    border-radius: 20px; padding: 2px 8px; font-weight: 800; font-size: 13px;
}
.tag-x {
    border: none; background: transparent; cursor: pointer;
    font-weight: 900; font-size: 12px; line-height: 1; color: var(--ink); padding: 0;
}
.tag-text {
    flex: 1; min-width: 140px; border: none; outline: none;
    font-family: inherit; font-size: 13.5px; background: transparent; padding: 4px;
}
.tag-lib-select {
    padding: 4px 8px; border: 2px solid var(--ink); border-radius: 4px;
    background: var(--paper); font-size: 12px; font-family: inherit; font-weight: 700;
}

/* ── 组件 4：富文本编辑器 ─────────────────────────────────────── */
.rich-editor { border: 2px solid var(--ink); border-radius: var(--radius); background: #fff; overflow: hidden; }
.re-toolbar {
    display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
    padding: 8px; background: var(--yellow); border-bottom: 2px solid var(--ink);
}
.re-btn {
    border: 2px solid var(--ink); background: #fff; color: var(--ink);
    font-weight: 800; font-size: 12px; padding: 4px 9px; border-radius: 4px;
    cursor: pointer; font-family: inherit; box-shadow: var(--shadow-sm); line-height: 1.2;
}
.re-btn:active { transform: translate(1px, 1px); box-shadow: 1px 1px 0 var(--ink); }
.re-sep { width: 2px; height: 18px; background: var(--ink); opacity: .35; margin: 0 2px; }
.re-area { padding: 12px; font-size: 14px; line-height: 1.7; outline: none; background: #fff; }
.re-area:empty:before { content: attr(data-placeholder); color: #999; }
.re-area h2 { font-size: 18px; font-weight: 900; margin: 10px 0 6px; }
.re-area h3 { font-size: 15.5px; font-weight: 800; margin: 8px 0 5px; }
.re-area p { margin: 0 0 8px; }
.re-area ul, .re-area ol { margin: 0 0 8px; padding-left: 22px; }
.re-area a { color: var(--ink); text-decoration: underline; }

/* ── 组件 5：地图选点 ─────────────────────────────────────────── */
.map-picker { display: block; }
.map-canvas {
    width: 100%; height: 300px;
    border: 2px solid var(--ink);
    border-radius: var(--radius);
    background: #EDEADF;
    overflow: hidden;
}
.map-fallback {
    padding: 18px; font-size: 12.5px; font-weight: 700;
    color: #8A6A2A; line-height: 1.8;
}
.map-coord { font-size: 12px; color: #6E6E7A; margin-top: 6px; font-weight: 700; }
.map-fields { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.map-fields input {
    flex: 1; min-width: 180px;
    padding: 8px 12px;
    border: 2px solid var(--ink); border-radius: 4px;
    background: var(--paper); font-size: 13px; font-family: inherit;
}
.map-lib-select {
    padding: 8px 10px; border: 2px solid var(--ink); border-radius: 4px;
    background: var(--paper); font-size: 12.5px; font-family: inherit; font-weight: 700;
}

/* ── 组件 6：九宫格图片 ───────────────────────────────────────── */
.img-grid { display: block; }
.ig-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding: 10px;
    border: 2px dashed #B9B0A0;
    border-radius: var(--radius);
    background: #FBFAF5;
    min-height: 92px;
}
.ig-item {
    position: relative;
    aspect-ratio: 1/1;
    border: 2px solid var(--ink);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    background: #fff;
    cursor: grab;
}
.ig-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ig-item.dragging { opacity: .4; }
.ig-item.drag-over { outline: 3px solid var(--blue); outline-offset: 2px; }
.ig-del {
    position: absolute; top: 3px; right: 3px;
    width: 22px; height: 22px;
    background: var(--red); color: #fff;
    border: 2px solid var(--ink); border-radius: 50%;
    font-size: 11px; font-weight: 900; line-height: 1;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.ig-cover {
    position: absolute; left: 3px; bottom: 3px;
    background: var(--green); color: var(--ink);
    border: 2px solid var(--ink); border-radius: 999px;
    font-size: 10px; font-weight: 900; padding: 0 7px;
}
.ig-count { margin-top: 8px; font-size: 12px; font-weight: 700; color: #6E6E7A; }
.ig-count b { color: var(--ink); }

/* ── 组件 7：联系人名片 ───────────────────────────────────────── */
.sp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 9px; }
.sp-card {
    position: relative;
    display: flex; align-items: center; gap: 9px;
    padding: 8px 10px;
    border: 2px solid var(--ink);
    border-radius: var(--radius);
    background: var(--paper);
    cursor: pointer;
    transition: transform .12s ease;
}
.sp-card:hover { transform: translateY(-2px); }
.sp-card.on { background: var(--yellow); box-shadow: var(--shadow-sm); }
.sp-card input { position: absolute; opacity: 0; pointer-events: none; }
.sp-avatar {
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; flex: 0 0 34px;
    border: 2px solid var(--ink); border-radius: 50%;
    background: var(--candy-blue);
    font-weight: 900; font-size: 15px;
    overflow: hidden;
}
.sp-avatar img { width: 100%; height: 100%; object-fit: cover; }
.sp-info { min-width: 0; }
.sp-info b { display: block; font-size: 13px; font-weight: 800; }
.sp-info small { display: block; font-size: 11px; color: #7A7A86; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-ip {
    position: absolute; top: -8px; right: -6px;
    background: var(--pink); color: var(--ink);
    border: 2px solid var(--ink); border-radius: 999px;
    font-size: 10px; font-weight: 900; padding: 0 6px;
}
.sp-empty {
    padding: 16px; border: 2px dashed #B9B0A0; border-radius: var(--radius);
    color: #8A8A96; font-size: 12.5px; font-weight: 700; text-align: center;
}

/* ── 组件 8：收费项列表 ───────────────────────────────────────── */
.pl-rows { display: flex; flex-direction: column; gap: 8px; margin-bottom: 9px; }
.pl-row { display: flex; gap: 8px; align-items: center; }
.pl-row input {
    flex: 1; min-width: 0;
    padding: 8px 11px;
    border: 2px solid var(--ink); border-radius: 4px;
    background: var(--paper); font-size: 13px; font-family: inherit;
}
.pl-row input[name="price_amount[]"] { flex: 0 0 120px; }
.pl-del {
    width: 30px; height: 30px; flex: 0 0 30px;
    background: var(--pink); color: var(--ink);
    border: 2px solid var(--ink); border-radius: 4px;
    font-size: 13px; font-weight: 900; cursor: pointer;
}
.pl-add {
    padding: 6px 14px;
    border: 2px solid var(--ink); border-radius: var(--radius);
    background: var(--candy-blue); color: var(--ink);
    font-size: 12.5px; font-weight: 800; cursor: pointer; font-family: inherit;
    box-shadow: var(--shadow-sm);
}

/* ── 旧版上传控件（保留兼容） ─────────────────────────────────── */
.uploader {
    border: 2px dashed #B9B0A0;
    border-radius: var(--radius);
    padding: 10px;
    background: #FBFAF5;
}
.up-list { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.up-item {
    position: relative;
    width: 76px; height: 76px;
    border: 2px solid var(--ink);
    border-radius: 4px;
    overflow: hidden;
    background: #fff;
    cursor: grab;
}
.up-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.up-del {
    position: absolute; top: 2px; right: 2px;
    width: 19px; height: 19px;
    border: 1.5px solid var(--ink);
    border-radius: 4px;
    background: var(--red);
    color: #fff;
    font-size: 10px; font-weight: 900;
    cursor: pointer;
    line-height: 1;
    display: flex; align-items: center; justify-content: center;
}
.up-add {
    padding: 6px 14px;
    border: 2px solid var(--ink);
    border-radius: var(--radius);
    background: var(--candy-blue);
    font-size: 12.5px;
    font-weight: 800;
    cursor: pointer;
}
.up-hint { margin: 6px 0 0; font-size: 11.5px; color: #8A8A96; }

/* ── 仪表盘 ───────────────────────────────────────────────────── */
.dash-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    padding: 20px 22px;
    background: var(--yellow);
    border: 2px solid var(--ink);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    margin-bottom: 18px;
}
.dash-hero h2 { margin: 0 0 6px; font-size: 21px; font-weight: 900; }
.dash-hero p  { margin: 0; font-size: 13px; font-weight: 600; max-width: 640px; }
.dash-hero-side { display: flex; flex-direction: column; gap: 6px; }
.hero-chip {
    padding: 5px 12px;
    background: var(--paper);
    border: 2px solid var(--ink);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}
.hero-chip-2 { background: var(--pink); }

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}
.stat-card {
    display: flex; flex-direction: column; gap: 2px;
    padding: 16px;
    background: var(--paper);
    border: 2px solid var(--ink);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
    transition: transform .12s ease;
}
.stat-card:hover { transform: translateY(-3px); }
.stat-card::before {
    content: ""; position: absolute; top: 0; left: 0;
    width: 100%; height: 5px; background: var(--stat-color, var(--blue));
}
.stat-icon  { font-size: 21px; }
.stat-title { font-size: 12.5px; font-weight: 800; color: #6E6E7A; }
.stat-num   { font-size: 30px; font-weight: 900; line-height: 1.15; }
.stat-sub   { font-size: 11.5px; color: #9A9AA6; }

.dash-panels { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.panel {
    background: var(--paper);
    border: 2px solid var(--ink);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    margin-bottom: 16px;
    overflow: hidden;
}
.panel-head {
    padding: 11px 15px;
    background: var(--ink);
    color: #fff;
    font-weight: 800;
    font-size: 13.5px;
}
.panel-body { padding: 14px 15px; }
.quick-list { margin: 0; padding-left: 18px; }
.quick-list li { margin-bottom: 8px; font-weight: 700; }
.quick-list a:hover { color: #B3541E; }
.rule-list { margin: 0; padding-left: 18px; }
.rule-list li { margin-bottom: 7px; color: #55555F; }

.sticky-save {
    position: sticky; bottom: 0;
    padding: 12px 0;
    background: linear-gradient(to top, var(--bg) 70%, transparent);
}

/* ── 登录页 ───────────────────────────────────────────────────── */
.login-body {
    display: flex; align-items: center; justify-content: center;
    min-height: 100vh; padding: 24px;
    background: var(--bg);
}
.login-wrap { width: 100%; max-width: 400px; }
.login-card {
    background: var(--paper);
    border: 2px solid var(--ink);
    border-radius: var(--radius);
    box-shadow: 8px 8px 0 var(--yellow);
    padding: 28px 26px;
}
.login-brand { text-align: center; margin-bottom: 20px; }
.login-logo { font-size: 44px; display: block; line-height: 1; margin-bottom: 10px; }
.login-brand h1 { margin: 0 0 4px; font-size: 20px; font-weight: 900; }
.login-brand p  { margin: 0; font-size: 12px; color: #8A8A96; letter-spacing: .5px; }
.login-form .form-label { display: block; flex: none; padding: 0 0 5px; }
.login-form input[type="text"],
.login-form input[type="password"] {
    width: 100%;
    padding: 10px 13px;
    margin-bottom: 15px;
    border: 2px solid var(--ink);
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
}
.login-form input:focus { outline: 3px solid var(--candy-blue); outline-offset: 1px; }
.login-remember {
    display: flex; align-items: center; gap: 6px;
    font-size: 12.5px; font-weight: 700; margin: -4px 0 16px;
}
.login-foot { margin: 18px 0 0; text-align: center; font-size: 11.5px; color: #9A9AA6; }

/* ── 响应式 ───────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .sidebar { width: 62px; flex: 0 0 62px; }
    .sb-name, .sb-text, .sb-group, .sb-foot { display: none; }
    .sb-brand { justify-content: center; padding: 12px 6px; }
    .sb-item { justify-content: center; padding: 10px 4px; }
    .content { padding: 14px 12px 50px; }
    .topbar { padding: 12px 14px; }
    .page-title { font-size: 18px; }
    .form-row { flex-direction: column; gap: 5px; }
    .form-label { flex: none; padding-top: 0; }
    .pl-row { flex-wrap: wrap; }
    .pl-row input[name="price_amount[]"] { flex: 1 1 100px; }
}
