/* ============================================================
   兼职推广 · 管理后台样式
   主题色：橙色 #ff7a45（呼应小程序）
   ============================================================ */

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
                 "Hiragino Sans GB", "Microsoft YaHei", Helvetica, Arial, sans-serif;
    background: #f5f6fa;
    color: #2c2c2c;
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
a { color: #ff7a45; text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
h2, h3 { margin: 0 0 12px; font-weight: 600; }
h2 { font-size: 20px; }
h3 { font-size: 16px; color: #1f1f1f; }
code {
    background: #f5f6fa; border: 1px solid #e8e8ee;
    padding: 1px 6px; border-radius: 4px; font-size: 12px;
    color: #d35400;
}
.muted { color: #888; font-size: 13px; }

/* ============ 登录页 ============ */
body.login-page { background: linear-gradient(135deg, #ff9a5a, #ff7a45); }
.login-wrap {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    padding: 24px;
}
.login-card {
    background: #fff; width: 100%; max-width: 380px;
    border-radius: 16px; padding: 36px 32px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.18);
}
.login-brand { text-align: center; margin-bottom: 24px; }
.login-logo { line-height: 1; margin-bottom: 12px; }
.login-logo img { width: 80px; height: 80px; object-fit: contain; display: inline-block; border-radius: 12px; transform: translateX(-8px); }
.login-name { font-size: 22px; font-weight: 600; color: #1f1f1f; }
.login-sub { color: #888; font-size: 13px; margin-top: 4px; }
.login-form { display: flex; flex-direction: column; gap: 14px; margin-top: 8px; }
.login-hint {
    margin-top: 18px; text-align: center;
    color: #888; font-size: 12px; line-height: 1.8;
}

/* ============ 布局 ============ */
.sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; width: 220px;
    background: #1f1f2e; color: #eaeaea;
    display: flex; flex-direction: column;
    z-index: 10;
}
.sidebar-brand {
    padding: 20px 24px; font-size: 16px; font-weight: 600;
    border-bottom: 1px solid #2c2c40;
    display: flex; align-items: center; gap: 8px;
}
.brand-icon { width: 28px; height: 28px; object-fit: contain; border-radius: 4px; }
.brand-text { letter-spacing: 0.5px; }
.sidebar-nav { flex: 1; padding: 12px 0; overflow-y: auto; }
.nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 24px; color: #d0d0d8; font-size: 14px;
    transition: all 0.15s;
}
.nav-item:hover { background: #2a2a3e; color: #fff; text-decoration: none; }
.nav-item.active {
    background: linear-gradient(90deg, #ff7a45 0%, #ff5e3a 100%);
    color: #fff;
}
.nav-icon { font-size: 18px; }
.sidebar-footer {
    padding: 12px 0; border-top: 1px solid #2c2c40;
}
.sidebar-footer .nav-item { color: #888; }

.main {
    margin-left: 220px; min-height: 100vh;
    display: flex; flex-direction: column;
}
.topbar {
    background: #fff; border-bottom: 1px solid #eee;
    height: 56px; padding: 0 24px;
    display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 5;
}
.topbar-title { font-size: 15px; font-weight: 600; color: #1f1f1f; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.user-chip {
    background: #fff5ee; color: #ff5e3a;
    padding: 4px 12px; border-radius: 999px;
    font-size: 13px; font-weight: 500;
}
.flash-area { padding: 12px 24px 0; }
.flash {
    padding: 10px 14px; border-radius: 8px; margin-bottom: 8px;
    border: 1px solid transparent; font-size: 13px;
}
.flash-success { background: #f0fbf4; color: #1f8a4c; border-color: #cce8d6; }
.flash-error { background: #fdf2f2; color: #c0392b; border-color: #f1c5c5; }

.content { padding: 24px; flex: 1; }

/* ============ 页面通用 ============ */
.page-header {
    display: flex; align-items: flex-end; justify-content: space-between;
    gap: 16px; margin-bottom: 20px;
}
.page-header h2 { margin: 0 0 4px; }
.page-header.with-action { align-items: center; }
.card {
    background: #fff; border-radius: 12px;
    padding: 20px 22px; margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.card-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 12px;
}
.card-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.card h3 { margin-top: 0; }

/* ============ 按钮 ============ */
.btn {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 8px 16px; border-radius: 8px; border: 1px solid transparent;
    background: #fff; color: #333; cursor: pointer; font-size: 13px;
    transition: all 0.15s; font-family: inherit;
}
.btn:hover { text-decoration: none; }
.btn-primary {
    background: linear-gradient(135deg, #ff9a5a, #ff7a45);
    color: #fff; border: none; box-shadow: 0 2px 6px rgba(255,122,69,0.3);
}
.btn-primary:hover { box-shadow: 0 4px 12px rgba(255,122,69,0.45); }
.btn-default { background: #f5f6fa; border-color: #e8e8ee; color: #555; }
.btn-default:hover { background: #ececf2; }
.btn-ghost { background: #fff5ee; color: #ff5e3a; border-color: #ffd9c4; }
.btn-ghost:hover { background: #ffe6d6; }
.btn-danger { background: #fdf2f2; color: #c0392b; border-color: #f1c5c5; }
.btn-danger:hover { background: #fbe1e1; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-block { width: 100%; justify-content: center; }

/* ============ 表格 ============ */
.data-table {
    width: 100%; border-collapse: collapse;
    font-size: 13px;
}
.data-table th, .data-table td {
    padding: 12px 10px; text-align: left;
    border-bottom: 1px solid #f0f0f4;
}
.data-table th {
    background: #fafafc; color: #555;
    font-weight: 600; font-size: 12px;
    text-transform: uppercase; letter-spacing: 0.5px;
}
.data-table tbody tr:hover { background: #fafafc; }
.cell-icon { width: 36px; height: 36px; border-radius: 8px; object-fit: cover; }
.cell-emoji { font-size: 28px; }
.empty-row { text-align: center; padding: 40px 0 !important; color: #888; }

/* ============ 表单 ============ */
.form-grid {
    display: grid; grid-template-columns: repeat(2, 1fr);
    gap: 14px 16px; margin-bottom: 8px;
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field-wide { grid-column: 1 / -1; }
.field span { font-size: 13px; color: #555; font-weight: 500; }
.field input[type="text"],
.field input[type="password"],
.field input[type="number"],
.field select,
.field textarea {
    border: 1px solid #e0e0e8; border-radius: 8px;
    padding: 8px 12px; font-size: 14px; font-family: inherit;
    background: #fff; color: #1f1f1f;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.field textarea {
    min-height: 70px;
    line-height: 1.6;
    resize: vertical;
    width: 100%;
    box-sizing: border-box;
}
.field input:focus, .field select:focus, .field textarea:focus {
    outline: none; border-color: #ff7a45;
    box-shadow: 0 0 0 3px rgba(255,122,69,0.12);
}
.check-field {
    flex-direction: row; align-items: center;
    padding: 10px 0;
}
.check-field input[type="checkbox"] { width: 16px; height: 16px; }
.form-actions {
    display: flex; justify-content: flex-end; gap: 10px;
    margin-top: 20px;
}

/* 状态徽标 */
.status {
    display: inline-block; padding: 2px 10px;
    border-radius: 999px; font-size: 12px; font-weight: 500;
}
.status-on { background: #f0fbf4; color: #1f8a4c; }
.status-off { background: #f5f6fa; color: #888; }
.slot-tag {
    background: #fff5ee; color: #ff5e3a;
    padding: 2px 8px; border-radius: 4px;
    font-size: 12px; margin-right: 6px;
}
.badge-mini {
    display: inline-block; padding: 2px 8px;
    border-radius: 999px; font-size: 12px;
    background: #ff7a45; color: #fff;
}
.badge-orange { background: #ff7a45; }
.badge-red { background: #e74c3c; }
.badge-blue { background: #3498db; }
.badge-green { background: #2ecc71; }
.badge-gray { background: #95a5a6; }

/* 单选胶囊 */
.radio-row { display: flex; gap: 10px; margin: 12px 0; }
.radio-pill {
    display: flex; align-items: center; gap: 6px;
    padding: 8px 14px; border-radius: 999px;
    border: 1px solid #e0e0e8; cursor: pointer;
    font-size: 13px; color: #555;
}
.radio-pill input { accent-color: #ff7a45; }
.radio-pill:has(input:checked) {
    background: #fff5ee; border-color: #ff7a45; color: #ff5e3a;
}

/* 图标区 */
.icon-area {
    display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
    margin-top: 12px; padding: 16px; background: #fafafc; border-radius: 8px;
}
.icon-area .field { flex: 1; min-width: 220px; }
.emoji-preview {
    width: 56px; height: 56px; border-radius: 14px;
    background: linear-gradient(135deg, #ff9a5a, #ff7a45);
    display: flex; align-items: center; justify-content: center;
    font-size: 32px; color: #fff;
}
.emoji-quick { display: flex; flex-wrap: wrap; gap: 6px; max-width: 360px; }
.emoji-btn {
    width: 36px; height: 36px; border-radius: 8px;
    background: #fff; border: 1px solid #e8e8ee;
    font-size: 20px; cursor: pointer;
}
.emoji-btn:hover { background: #fff5ee; border-color: #ff7a45; }
.image-preview img { max-width: 100px; border-radius: 8px; }

/* ============ 模块网格 ============ */
.module-grid {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}
.module-card {
    background: #fff; border: 1px solid #eee; border-radius: 12px;
    padding: 18px; text-align: center; transition: all 0.2s;
    color: inherit;
    position: relative;
}
.module-card-link {
    display: block; color: inherit; text-decoration: none;
}
.module-card-del {
    position: absolute; top: 6px; right: 6px; z-index: 2;
    margin: 0;
}
.module-card-del button {
    width: 22px; height: 22px; padding: 0;
    border: none; border-radius: 50%;
    background: rgba(0,0,0,0.04); color: #c0392b;
    font-size: 16px; line-height: 1; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: all 0.2s;
}
.module-card:hover .module-card-del button { opacity: 1; }
.module-card-del button:hover { background: #fbe1e1; transform: scale(1.1); }
.module-card:hover {
    border-color: #ff7a45; transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255,122,69,0.15); text-decoration: none;
}
.module-icon {
    position: relative;
    width: 60px; height: 60px; border-radius: 16px;
    background: linear-gradient(135deg, #ff9a5a, #ff7a45);
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 10px; font-size: 32px; color: #fff;
}
.module-icon img { width: 100%; height: 100%; border-radius: 16px; object-fit: cover; }
.badge-mini { position: absolute; right: -6px; top: -6px; }
.module-name { font-weight: 600; margin-bottom: 4px; }
.module-sub { font-size: 12px; color: #888; min-height: 36px; }
.module-meta { margin-top: 10px; font-size: 12px; }

/* ============ 概览统计 ============ */
.card-grid {
    display: grid; grid-template-columns: repeat(4, 1fr);
    gap: 16px; margin-bottom: 16px;
}
.stat-card {
    background: #fff; border-radius: 12px;
    padding: 20px; color: #fff;
    transition: all 0.2s;
}
.stat-card:hover { transform: translateY(-2px); text-decoration: none; }
.stat-orange { background: linear-gradient(135deg, #ff9a5a, #ff7a45); }
.stat-blue { background: linear-gradient(135deg, #5fa8ff, #4a7fea); }
.stat-green { background: linear-gradient(135deg, #4cd2a3, #2bb886); }
.stat-purple { background: linear-gradient(135deg, #b288ff, #8c5cff); }
.stat-label { font-size: 13px; opacity: 0.9; }
.stat-value { font-size: 28px; font-weight: 700; margin: 6px 0; }
.stat-foot { font-size: 12px; opacity: 0.8; }

.hint-list { padding-left: 20px; color: #555; }
.hint-list li { margin: 6px 0; }

/* ============ 手机预览 ============ */
.phone-mock {
    width: 360px; margin: 0 auto;
    background: #fff; border-radius: 24px;
    border: 8px solid #1f1f2e; overflow: hidden;
    box-shadow: 0 10px 40px rgba(0,0,0,0.12);
}
.phone-banners {
    background: linear-gradient(180deg, #ff9a5a, #ff7a45);
    height: 130px; padding: 24px 16px; color: #fff;
    text-align: center; position: relative;
}
.phone-banner {
    position: absolute; left: 0; right: 0; top: 30px;
    height: 60px; background: rgba(255,255,255,0.15);
    border-radius: 30px 30px 0 0;
}
.phone-banner-inner {
    position: relative; z-index: 1;
}
.phone-banner-inner strong { font-size: 18px; }
.phone-banner-sub { font-size: 12px; opacity: 0.85; }
.phone-grid {
    display: grid; grid-template-columns: repeat(2, 1fr);
    gap: 12px; padding: 16px;
}
.phone-cell {
    background: #fff; border-radius: 12px;
    text-align: center; padding: 16px 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}
.phone-icon {
    width: 48px; height: 48px; border-radius: 12px;
    background: linear-gradient(135deg, #ff9a5a, #ff7a45);
    margin: 0 auto 8px; display: flex; align-items: center; justify-content: center;
    font-size: 26px; color: #fff;
}
.phone-icon img { width: 100%; height: 100%; border-radius: 12px; object-fit: cover; }
.phone-name { font-weight: 600; }
.phone-sub { font-size: 11px; color: #888; margin-top: 2px; }

.phone-list { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.phone-list-item {
    display: flex; align-items: center; gap: 12px;
    padding: 12px; background: #fff; border-radius: 12px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}
.phone-list-icon {
    width: 44px; height: 44px; border-radius: 10px;
    background: linear-gradient(135deg, #ff9a5a, #ff7a45);
    display: flex; align-items: center; justify-content: center;
    font-size: 24px; color: #fff;
    flex-shrink: 0;
}
.phone-list-icon img { width: 100%; height: 100%; border-radius: 10px; object-fit: cover; }
.phone-list-text { flex: 1; min-width: 0; }
.phone-list-name { font-weight: 600; }
.phone-list-sub { font-size: 11px; color: #888; }

/* ============ 富文本 Block 编辑器 ============ */
.blocks-list { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.block-card {
    background: #fafafc; border: 1px solid #eee;
    border-radius: 10px; padding: 12px 14px;
    transition: border-color 0.15s;
}
.block-card:hover { border-color: #ffd9c4; }
.block-head {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 8px;
}
.block-type { font-size: 12px; color: #ff5e3a; font-weight: 600; }
.block-del {
    background: transparent; border: none; color: #aaa;
    cursor: pointer; font-size: 14px; padding: 2px 8px;
}
.block-del:hover { color: #e74c3c; }
.block-card textarea.block-input,
.block-card input.block-input {
    width: 100%; padding: 8px 10px;
    border: 1px solid #e0e0e8; border-radius: 6px;
    font-family: inherit; font-size: 13px;
    background: #fff; resize: vertical;
}
.block-image-row {
    display: flex; gap: 8px; align-items: center; margin-bottom: 8px;
}
.block-image-row input.block-input { flex: 1; }
.block-image-preview {
    min-height: 80px; border-radius: 8px;
    background: #f0f0f4;
    display: flex; align-items: center; justify-content: center;
    color: #aaa; font-size: 12px;
    background-size: contain; background-repeat: no-repeat; background-position: center;
    margin-bottom: 8px;
}
.block-image-preview.has-image { background-color: #fff; border: 1px solid #e0e0e8; }
.block-file-preview {
    min-height: 38px; border-radius: 8px;
    background: #f0f0f4;
    display: flex; align-items: center; justify-content: center;
    color: #aaa; font-size: 12px;
    padding: 0 12px;
    margin-bottom: 8px;
}
.block-file-preview.has-file { background-color: #eef7ee; border: 1px solid #cfe8cf; color: #2f7d32; }
.block-caption { margin-top: 6px; }

.blocks-empty {
    text-align: center; padding: 40px 16px; color: #888;
    border: 1px dashed #e0e0e8; border-radius: 10px;
}

/* ============ 信息行 ============ */
.info-row {
    display: flex; gap: 14px; padding: 10px 0;
    border-bottom: 1px solid #f0f0f4; margin-bottom: 12px;
}
.info-label { color: #888; min-width: 80px; font-size: 13px; }
.info-value { font-weight: 500; }

/* ============ 响应式 ============ */
@media (max-width: 900px) {
    .sidebar { width: 60px; }
    .sidebar .brand-text, .sidebar .nav-item span:not(.nav-icon) { display: none; }
    .nav-item { justify-content: center; padding: 14px 0; }
    .main { margin-left: 60px; }
    .module-grid, .card-grid { grid-template-columns: repeat(2, 1fr); }
    .form-grid { grid-template-columns: 1fr; }
}
