/* =========================================================
   CITIC Futures 英文官网后管 - 公共样式
   ========================================================= */

:root {
    --primary: #1a365d;
    --primary-light: #e3f2fd;
    --secondary: #2c5282;
    --success: #059669;
    --warning: #d97706;
    --danger: #c41e3a;
    --purple: #7c3aed;
    --text: #202124;
    --gray: #5f6368;
    --light-gray: #9aa0a6;
    --border: #e2e8f0;
    --bg: #f8f9fa;
    --bg-light: #f5f5f5;
    --white: #fff;
    --radius: 10px;
    --radius-sm: 6px;
    --shadow: 0 2px 8px rgba(0,0,0,0.06);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }

/* ========== 布局 ========== */
.admin-layout { display: flex; min-height: 100vh; }

.sidebar {
    width: 240px;
    background: var(--primary);
    color: #fff;
    flex-shrink: 0;
    padding: 20px 0;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    overflow-y: auto;
    z-index: 100;
}

.sidebar-logo {
    padding: 0 20px 20px;
    font-size: 18px;
    font-weight: 700;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 16px;
    letter-spacing: 0.02em;
}

.sidebar-logo span { color: #63b3ed; }

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    color: rgba(255,255,255,0.75);
    font-size: 13px;
    transition: all 0.15s;
    border-left: 3px solid transparent;
    cursor: pointer;
}

.sidebar-nav a:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
}

.sidebar-nav a.active {
    background: rgba(255,255,255,0.12);
    color: #fff;
    border-left-color: #63b3ed;
    font-weight: 500;
}

.sidebar-nav .nav-group {
    padding: 16px 20px 6px;
    font-size: 11px;
    color: rgba(255,255,255,0.4);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
}

.main-content {
    flex: 1;
    margin-left: 240px;
    min-height: 100vh;
}

.content-frame {
    width: 100%;
    border: none;
    display: block;
    min-height: 100vh;
    background: var(--bg);
}

/* ========== 页面头部 ========== */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.page-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.3;
}

.page-subtitle {
    font-size: 13px;
    color: var(--gray);
    margin-top: 4px;
}

.header-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 13px;
    color: var(--gray);
}

.breadcrumb a { color: var(--gray); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb span:last-child { color: var(--text); }

/* ========== 按钮 ========== */
.btn {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s;
    text-decoration: none;
    white-space: nowrap;
    font-family: inherit;
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--secondary); }

.btn-outline {
    background: #fff;
    border: 1px solid var(--border);
    color: var(--text);
}
.btn-outline:hover { background: var(--bg); border-color: #cbd5e0; }

.btn-approve { background: var(--success); color: #fff; }
.btn-approve:hover { background: #047857; }

.btn-reject {
    background: #fff;
    border: 1px solid var(--danger);
    color: var(--danger);
}
.btn-reject:hover { background: #fee; }

.btn-sm { padding: 5px 10px; font-size: 12px; }

.btn-outline.danger {
    border-color: var(--danger);
    color: var(--danger);
}
.btn-outline.danger:hover { background: #fee; }

/* ========== 卡片 ========== */
.card {
    background: #fff;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    margin-bottom: 20px;
    overflow: hidden;
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--primary);
}

.card-hint {
    font-size: 12px;
    color: var(--gray);
}

.card-body { padding: 20px; }

.card-actions { display: flex; gap: 8px; align-items: center; }

/* ========== 统计卡片 ========== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.stat-card {
    background: #fff;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 20px;
    position: relative;
    transition: all 0.15s;
}

.stat-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-1px);
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    margin-bottom: 12px;
}

.stat-icon.blue { background: #dbeafe; color: #2563eb; }
.stat-icon.green { background: #d1fae5; color: var(--success); }
.stat-icon.orange { background: #fed7aa; color: var(--warning); }
.stat-icon.purple { background: #ede9fe; color: var(--purple); }
.stat-icon.red { background: #fee2e2; color: var(--danger); }

.stat-value {
    font-size: 26px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 13px;
    color: var(--gray);
}

.stat-trend {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 12px;
    font-weight: 600;
    margin-top: 8px;
    padding: 2px 8px;
    border-radius: 12px;
}

.stat-trend.up { background: #d1fae5; color: var(--success); }
.stat-trend.down { background: #fee2e2; color: var(--danger); }

/* ========== 搜索栏 ========== */
.search-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    align-items: center;
}

.search-input {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 14px;
    flex: 1;
    min-width: 200px;
    transition: border-color 0.15s;
}

.search-input:focus-within { border-color: var(--primary); }

.search-input input {
    border: none;
    outline: none;
    flex: 1;
    font-size: 13px;
    background: transparent;
    font-family: inherit;
}

.search-input svg,
.search-input i { color: var(--gray); font-size: 14px; }

.form-select {
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 13px;
    background: #fff;
    cursor: pointer;
    font-family: inherit;
    color: var(--text);
}

.form-select:focus { outline: none; border-color: var(--primary); }

/* ========== 过滤药丸 ========== */
.filter-pills {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.filter-pill {
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    border: 1px solid var(--border);
    background: #fff;
    transition: all 0.15s;
    color: var(--gray);
}

.filter-pill:hover { border-color: var(--primary); color: var(--primary); }
.filter-pill.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* ========== 表格 ========== */
.table-container { overflow-x: auto; }

table {
    width: 100%;
    border-collapse: collapse;
}

thead { background: var(--bg); }

th {
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
    border-bottom: 1px solid var(--border);
}

td {
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    font-size: 13px;
    vertical-align: middle;
}

tbody tr { transition: background 0.1s; }
tbody tr:hover { background: var(--bg); }

/* ========== 状态徽章 ========== */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
    line-height: 1.5;
}

.status-badge.published { background: #d1fae5; color: var(--success); }
.status-badge.draft { background: #f5f5f5; color: #9e9e9e; }
.status-badge.ongoing { background: #fff8e1; color: var(--warning); }
.status-badge.ended { background: #ffebee; color: var(--danger); }
.status-badge.approved { background: #d1fae5; color: var(--success); }
.status-badge.pending { background: #fff8e1; color: var(--warning); }
.status-badge.rejected { background: #ffebee; color: var(--danger); }

/* ========== 分页 ========== */
.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    flex-wrap: wrap;
    gap: 12px;
    border-top: 1px solid var(--border);
}

.pagination-info { font-size: 13px; color: var(--gray); }

.pagination-controls { display: flex; gap: 4px; }

.pagination-btn {
    min-width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: #fff;
    cursor: pointer;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    padding: 0 6px;
    font-family: inherit;
    color: var(--text);
}

.pagination-btn:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.pagination-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ========== Tab ========== */
.tabs {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid var(--border);
    margin-bottom: 0;
    flex-wrap: wrap;
    padding: 0 20px;
    background: #fff;
}

.tab {
    padding: 12px 20px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    font-size: 13px;
    font-weight: 500;
    color: var(--gray);
    transition: all 0.15s;
    white-space: nowrap;
}

.tab:hover { color: var(--primary); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ========== 表单 ========== */
.form-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.form-row .form-group { flex: 1; min-width: 200px; }

.form-group { margin-bottom: 16px; }

.form-label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--gray);
    margin-bottom: 6px;
}

.form-label.required::after {
    content: ' *';
    color: var(--danger);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 13px;
    background: #fff;
    font-family: inherit;
    transition: border-color 0.15s;
    color: var(--text);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26,54,93,0.08);
}

.form-input:disabled,
.form-select:disabled {
    background: var(--bg-light);
    color: var(--gray);
    cursor: not-allowed;
}

.form-textarea {
    min-height: 100px;
    resize: vertical;
}

.form-help {
    font-size: 11px;
    color: var(--gray);
    margin-top: 4px;
}

/* ========== 头像 ========== */
.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
    text-transform: uppercase;
}

.avatar.large {
    width: 48px;
    height: 48px;
    font-size: 16px;
}

.avatar.avatar-xl {
    width: 80px;
    height: 80px;
    font-size: 26px;
}

/* ========== 用户单元格 ========== */
.user-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-name { font-weight: 500; font-size: 13px; }
.user-email { font-size: 12px; color: var(--gray); }

/* ========== 标签 ========== */
.tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    background: var(--bg-light);
    color: var(--gray);
    margin-right: 4px;
    margin-bottom: 4px;
}

.tag.muted { background: #f5f5f5; color: #9e9e9e; }

/* ========== 热点标签 ========== */
.hot-tag {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    background: #fff3e0;
    color: #e65100;
}

/* ========== 操作组 ========== */
.action-group {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

/* ========== 其他 ========== */
.code {
    font-family: 'Monaco', 'Menlo', Consolas, monospace;
    font-size: 12px;
}

/* ========== 活动创建页专用组件 ========== */

.poster-upload {
    width: 100%;
    max-width: 200px;
    aspect-ratio: 3/4;
    background: var(--bg-light);
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s;
    gap: 8px;
    color: var(--gray);
    padding: 20px;
    text-align: center;
}

.poster-upload:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

.poster-upload i { font-size: 28px; }
.poster-upload span { font-size: 12px; }

.sub-card {
    margin-top: 16px;
    padding: 16px;
    background: var(--bg-light);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.sub-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.sub-card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
}

.speaker-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #fff;
    border-radius: 8px;
    margin-bottom: 8px;
    border: 1px solid var(--border);
}

.speaker-item:last-child { margin-bottom: 0; }

.speaker-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
    text-transform: uppercase;
}

.speaker-info {
    flex: 1;
    min-width: 0;
}

.speaker-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
    margin-bottom: 2px;
}

.speaker-role {
    display: inline-block;
    font-size: 11px;
    color: var(--gray);
    background: var(--bg-light);
    padding: 1px 6px;
    border-radius: 4px;
    margin-left: 4px;
    font-weight: 400;
}

.speaker-org {
    font-size: 12px;
    color: var(--gray);
}

.icon-btn {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--gray);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    flex-shrink: 0;
    font-size: 13px;
}

.icon-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

.icon-btn.danger { color: var(--danger); }
.icon-btn.danger:hover {
    border-color: var(--danger);
    background: #fee;
}

.add-item-btn {
    width: 100%;
    padding: 10px;
    border: 1px dashed var(--border);
    border-radius: 8px;
    background: transparent;
    color: var(--gray);
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.15s;
    margin-top: 8px;
    font-family: inherit;
}

.add-item-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

.toggle-list {
    margin-top: 8px;
}

.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.toggle-row:last-child { border-bottom: none; }

.toggle-label {
    font-size: 13px;
    color: var(--text);
}

.toggle-label small {
    display: block;
    font-size: 11px;
    color: var(--gray);
    margin-top: 2px;
}

.toggle {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
    display: inline-block;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    inset: 0;
    background: #ccc;
    border-radius: 24px;
    cursor: pointer;
    transition: 0.2s;
}

.toggle-slider:before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: 0.2s;
}

.toggle input:checked + .toggle-slider {
    background: var(--primary);
}

.toggle input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

.toggle input:disabled + .toggle-slider {
    opacity: 0.5;
    cursor: not-allowed;
}

.detail-status-bar {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 16px 20px;
    background: #fff;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.sync-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--success);
}

.detail-stats {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-left: auto;
}

.detail-stat { text-align: center; }

.detail-stat-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
}

.detail-stat-label {
    font-size: 12px;
    color: var(--gray);
}

.detail-stat-divider {
    width: 1px;
    height: 32px;
    background: var(--border);
}

.progress-wrap { min-width: 120px; }

.progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--gray);
    margin-bottom: 4px;
}

.progress-bar {
    height: 6px;
    background: var(--bg-light);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 3px;
}

.stepper {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 20px;
    background: #fff;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    margin-bottom: 20px;
    overflow-x: auto;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 100px;
    text-align: center;
}

.step-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--border);
    color: var(--gray);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 8px;
}

.step.done .step-circle { background: var(--success); color: #fff; }
.step.active .step-circle { background: var(--primary); color: #fff; }

.step-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--gray);
}

.step.done .step-title, .step.active .step-title { color: var(--text); }

.step-range {
    font-size: 11px;
    color: var(--gray);
    margin-top: 2px;
}

.step-line {
    flex: 1;
    height: 2px;
    background: var(--border);
    min-width: 40px;
}

.step-line.done { background: var(--success); }

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.info-item.full { grid-column: 1 / -1; }

.info-label {
    font-size: 11px;
    color: var(--gray);
    text-transform: uppercase;
    margin-bottom: 4px;
    letter-spacing: 0.03em;
}

.info-value {
    font-size: 14px;
    color: var(--text);
}

.feedback-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    padding: 20px;
}

.feedback-stats .stat-card {
    text-align: center;
    padding: 16px;
}

.rating { color: #f9a825; letter-spacing: 2px; }

.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    padding: 20px;
}

.settings-block h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 16px;
}

.settings-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 13px;
}

.settings-item span:first-child { color: var(--gray); }

.settings-actions {
    padding: 0 20px 20px;
    display: flex;
    gap: 12px;
    border-top: 1px solid var(--border);
    padding-top: 16px;
}

.bulk-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: #fff;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.bulk-label {
    font-size: 13px;
    color: var(--gray);
    font-weight: 500;
}

.selected-count {
    margin-left: auto;
    font-size: 13px;
    color: var(--primary);
    font-weight: 500;
}

.expand-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    color: var(--gray);
    font-size: 12px;
}

.expand-row { display: none; }
.expand-row.open { display: table-row; }

.expand-content {
    padding: 12px 20px 12px 60px;
    background: var(--bg-light);
}

.sub-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.sub-table th {
    background: transparent;
    padding: 8px 10px;
    font-size: 11px;
    color: var(--gray);
    text-transform: uppercase;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.sub-table td {
    padding: 8px 10px;
    border-top: 1px solid var(--border);
}

.agent-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 20px;
}

.agent-sidebar { min-width: 0; }
.agent-main { min-width: 0; }

.customer-list {
    max-height: 500px;
    overflow-y: auto;
}

.customer-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
    margin-bottom: 4px;
    border: 1px solid transparent;
}

.customer-item:hover { background: var(--bg-light); }
.customer-item.active {
    background: var(--primary-light);
    border-color: var(--primary);
}

.customer-info { flex: 1; min-width: 0; }
.customer-name { font-weight: 500; font-size: 13px; }
.customer-email { font-size: 11px; color: var(--gray); }
.customer-company { font-size: 11px; color: var(--gray); }

.customer-flag {
    font-size: 10px;
    background: #fff3e0;
    color: #e65100;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

.selected-customer {
    display: flex;
    align-items: center;
    gap: 16px;
}

.selected-customer-info { flex: 1; }
.selected-customer-name { font-size: 16px; font-weight: 600; }
.selected-customer-email { font-size: 13px; color: var(--gray); }
.selected-customer-company { font-size: 13px; color: var(--gray); }

.sub-group { margin-bottom: 20px; }

.sub-group-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
}

.sub-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: 8px;
    transition: background 0.15s;
}

.sub-option:hover { background: var(--bg-light); }

.sub-checkbox {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    flex: 1;
}

.sub-checkbox input {
    width: 16px;
    height: 16px;
    cursor: pointer;
    flex-shrink: 0;
}

.sub-name { font-size: 13px; font-weight: 500; }
.sub-desc { font-size: 11px; color: var(--gray); }

.sub-status {
    font-size: 11px;
    color: var(--success);
    font-weight: 500;
}

.sub-status.muted { color: var(--light-gray); }

.sub-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.sub-info-label {
    font-size: 11px;
    color: var(--gray);
    text-transform: uppercase;
    margin-bottom: 4px;
}

.sub-info-value { font-size: 14px; }

.sub-section { margin-top: 8px; }

.sub-section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 16px;
}

.sub-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.agent-action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding: 12px 16px;
    background: var(--bg-light);
    border-radius: 8px;
}

.action-hint { font-size: 13px; color: var(--gray); }
.action-buttons { display: flex; gap: 8px; }

.form-actions-inline {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.account-danger-zone {
    margin-top: 24px;
    padding: 16px;
    background: #fff5f5;
    border: 1px solid #fed7d7;
    border-radius: 8px;
}

.danger-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--danger);
    margin-bottom: 12px;
}

.danger-actions { display: flex; gap: 8px; }

.avatar-section {
    display: flex;
    align-items: center;
    gap: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
}

.avatar-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.security-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}

.security-item:last-child { border-bottom: none; }

.security-title { font-size: 14px; font-weight: 500; }
.security-desc { font-size: 12px; color: var(--gray); margin-top: 2px; }

.preference-group { margin-bottom: 24px; }

.preference-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 8px;
}

.radio-group { display: flex; gap: 16px; }

.radio-option {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    cursor: pointer;
}

.type-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

.type-badge.invite { background: #e3f2fd; color: #1565c0; }
.type-badge.confirm { background: #e8f5e9; color: #2e7d32; }
.type-badge.success { background: #d1fae5; color: var(--success); }
.type-badge.reminder { background: #fff8e1; color: #f57f17; }
.type-badge.followup { background: #f3e5f5; color: #6a1b9a; }
.type-badge.cancel { background: #fce4ec; color: #c62828; }
.type-badge.agenda { background: #fff3e0; color: #e65100; }
.type-badge.thanks { background: #fff3e0; color: #e65100; }

.template-name { font-weight: 500; font-size: 13px; }
.template-id { font-size: 11px; color: var(--gray); }

.template-type-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.type-tab {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--gray);
    transition: all 0.15s;
}

.type-tab:hover { border-color: var(--primary); color: var(--primary); }
.type-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.editor-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 20px;
}

.editor-main { min-width: 0; }
.editor-sidebar { min-width: 0; }

.editor-header-actions { display: flex; gap: 8px; }

.rich-editor {
    min-height: 500px;
    padding: 24px;
    background: #fff;
    outline: none;
    font-size: 14px;
    line-height: 1.6;
}

.rich-editor:focus { background: #fefefe; }

.rich-editor .placeholder-chip {
    display: inline-block;
    padding: 2px 6px;
    background: #dbeafe;
    color: #1d4ed8;
    border-radius: 4px;
    font-size: 12px;
    font-family: monospace;
    vertical-align: middle;
}

.rich-editor .cta-button {
    display: inline-block;
    background: linear-gradient(135deg, #2c5282, #1a365d);
    color: #fff;
    padding: 14px 32px;
    border-radius: 8px;
    font-weight: 600;
}

.component-list { padding: 12px; }

.component-group { margin-bottom: 12px; }

.component-group-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 6px 4px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 6px;
}

.component-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    margin-bottom: 4px;
    transition: all 0.15s;
    font-size: 12px;
}

.component-item:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

.component-item i { width: 16px; text-align: center; color: var(--gray); }
.component-item:hover i { color: var(--primary); }

.chip {
    margin-left: auto;
    padding: 1px 6px;
    background: #dbeafe;
    color: #1d4ed8;
    border-radius: 3px;
    font-size: 10px;
}

.funnel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.funnel-step {
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s;
}

.funnel-bar {
    flex: 1;
    padding: 12px 20px;
    border-radius: 8px;
    color: #fff;
    font-weight: 600;
    font-size: 13px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
}

.funnel-meta {
    font-size: 12px;
    color: var(--gray);
    white-space: nowrap;
    min-width: 50px;
}

.funnel-arrow { color: var(--light-gray); font-size: 12px; }

.funnel-horizontal {
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    gap: 16px;
    padding: 20px 0;
    min-height: 220px;
}

.funnel-h-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.funnel-h-bar {
    width: 100%;
    max-width: 100px;
    border-radius: 8px 8px 0 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    padding-bottom: 12px;
    transition: all 0.3s;
}

.funnel-h-value { font-size: 18px; font-weight: 700; }
.funnel-h-label { font-size: 12px; color: var(--text); font-weight: 500; }
.funnel-h-pct { font-size: 11px; color: var(--gray); }

.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.conversion-list { display: flex; flex-direction: column; gap: 12px; }

.conversion-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.conversion-label {
    font-size: 12px;
    color: var(--gray);
    min-width: 120px;
}

.conversion-bar {
    flex: 1;
    height: 8px;
    background: var(--bg-light);
    border-radius: 4px;
    overflow: hidden;
}

.conversion-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 4px;
}

.conversion-pct {
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
    min-width: 50px;
    text-align: right;
}

.source-list { display: flex; flex-direction: column; gap: 16px; }

.source-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.source-info { min-width: 140px; }
.source-name { font-size: 13px; font-weight: 500; }
.source-count { font-size: 11px; color: var(--gray); }

.source-bar {
    flex: 1;
    height: 8px;
    background: var(--bg-light);
    border-radius: 4px;
    overflow: hidden;
}

.source-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 4px;
}

.source-pct {
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
    min-width: 40px;
    text-align: right;
}

.pct-good { color: var(--success); font-weight: 600; }
.pct-normal { color: var(--warning); font-weight: 600; }
.pct-muted { color: var(--light-gray); }

.table-name { font-weight: 500; font-size: 13px; }
.table-id { font-size: 11px; color: var(--gray); }

@media (max-width: 900px) {
    .info-grid,
    .settings-grid,
    .two-col,
    .editor-layout,
    .agent-layout {
        grid-template-columns: 1fr;
    }
    .funnel-horizontal { flex-wrap: wrap; }
    .funnel-h-item { flex: 0 0 45%; }
}

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); transition: transform 0.3s; }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
}

/* ========== 品种维护 ========== */
.product-url {
    font-family: 'Monaco', 'Menlo', Consolas, monospace;
    font-size: 12px;
    color: var(--primary);
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
    vertical-align: middle;
}

.product-url.empty {
    color: var(--light-gray);
    cursor: default;
}

.product-url a {
    color: var(--primary);
    text-decoration: none;
}

.product-url a:hover {
    text-decoration: underline;
}

.subject-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.year-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    background: var(--bg-light);
    color: var(--gray);
}

/* ========== 搜索栏：一行四个 ========== */
.search-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    align-items: center;
    margin-bottom: 16px;
}

/* 搜索框跨 4 列，独占一行 */
.search-bar .search-input {
    grid-column: 1 / -1;
    min-width: 0;
}

/* 筛选项宽度自适应 */
.search-bar .form-select {
    width: 100%;
    min-width: 0;
}

/* 响应式 */
@media (max-width: 1200px) {
    .search-bar {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .search-bar {
        grid-template-columns: 1fr;
    }
}