/* ========================================
   多商户手机号码销售管理系统 - 主题样式
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --bg-primary: #0f1117;
    --bg-secondary: #1a1d29;
    --bg-card: #1e2234;
    --bg-hover: #252a3a;
    --bg-input: #252a3a;
    --border-color: #2d3348;
    --border-active: #5b6abf;
    --text-primary: #e4e6f0;
    --text-secondary: #8b8fa7;
    --text-muted: #5f6380;
    --accent-primary: #6c5ce7;
    --accent-secondary: #a29bfe;
    --accent-gradient: linear-gradient(135deg, #6c5ce7, #a29bfe);
    --success: #00b894;
    --success-bg: rgba(0, 184, 148, 0.15);
    --warning: #fdcb6e;
    --warning-bg: rgba(253, 203, 110, 0.15);
    --danger: #e17055;
    --danger-bg: rgba(225, 112, 85, 0.15);
    --info: #74b9ff;
    --info-bg: rgba(116, 185, 255, 0.15);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--accent-secondary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--accent-primary);
}

/* ===== 滚动条 ===== */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

/* ===== 布局 ===== */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* ===== 侧边栏 ===== */
.sidebar {
    width: 260px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: var(--transition);
}

.sidebar-brand {
    padding: 24px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-brand .brand-icon {
    width: 40px;
    height: 40px;
    background: var(--accent-gradient);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 4px 12px rgba(108, 92, 231, 0.4);
}

.sidebar-brand .brand-text {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

.sidebar-brand .brand-sub {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 8px;
}

.nav-section-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    padding: 8px 12px;
    font-weight: 600;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    margin-bottom: 2px;
}

.nav-link:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.nav-link.active {
    background: rgba(108, 92, 231, 0.15);
    color: var(--accent-secondary);
}

.nav-link .nav-icon {
    width: 20px;
    text-align: center;
    font-size: 16px;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-color);
}

.user-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-hover);
    border-radius: var(--radius-sm);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 11px;
    color: var(--text-muted);
}

.user-actions {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

/* ===== 主内容区 ===== */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 32px;
    min-height: 100vh;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
}

.page-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.page-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* ===== 统计卡片 ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent-gradient);
    opacity: 0;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-active);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-card.purple::before { background: linear-gradient(135deg, #6c5ce7, #a29bfe); opacity: 1; }
.stat-card.green::before { background: linear-gradient(135deg, #00b894, #55efc4); opacity: 1; }
.stat-card.blue::before { background: linear-gradient(135deg, #0984e3, #74b9ff); opacity: 1; }
.stat-card.orange::before { background: linear-gradient(135deg, #e17055, #fab1a0); opacity: 1; }
.stat-card.pink::before { background: linear-gradient(135deg, #e84393, #fd79a8); opacity: 1; }
.stat-card.teal::before { background: linear-gradient(135deg, #00cec9, #81ecec); opacity: 1; }

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin-bottom: 16px;
}

.stat-icon.purple { background: rgba(108, 92, 231, 0.15); color: #a29bfe; }
.stat-icon.green { background: rgba(0, 184, 148, 0.15); color: #55efc4; }
.stat-icon.blue { background: rgba(9, 132, 227, 0.15); color: #74b9ff; }
.stat-icon.orange { background: rgba(225, 112, 85, 0.15); color: #fab1a0; }
.stat-icon.pink { background: rgba(232, 67, 147, 0.15); color: #fd79a8; }
.stat-icon.teal { background: rgba(0, 206, 201, 0.15); color: #81ecec; }

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
    letter-spacing: -0.5px;
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ===== 卡片 ===== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 24px;
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.card-body {
    padding: 24px;
}

/* ===== 表格 ===== */
.table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table th {
    padding: 14px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

table td {
    padding: 14px 16px;
    font-size: 14px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

table tr:hover td {
    background: var(--bg-hover);
}

table tr:last-child td {
    border-bottom: none;
}

/* ===== 状态徽章 ===== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    gap: 6px;
}

.badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.badge-success { background: var(--success-bg); color: var(--success); }
.badge-success::before { background: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-warning::before { background: var(--warning); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-danger::before { background: var(--danger); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-info::before { background: var(--info); }
.badge-secondary { background: rgba(139, 143, 167, 0.15); color: var(--text-secondary); }
.badge-secondary::before { background: var(--text-secondary); }

/* ===== 按钮 ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    line-height: 1.4;
    white-space: nowrap;
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 4px 12px rgba(108, 92, 231, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(108, 92, 231, 0.4);
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, #00b894, #55efc4);
    color: #0f1117;
}

.btn-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 184, 148, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #e17055, #fab1a0);
    color: white;
}

.btn-danger:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(225, 112, 85, 0.4);
    color: white;
}

.btn-warning {
    background: linear-gradient(135deg, #fdcb6e, #ffeaa7);
    color: #0f1117;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.btn-outline:hover {
    border-color: var(--accent-primary);
    color: var(--accent-secondary);
    background: rgba(108, 92, 231, 0.1);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 12px;
}

.btn-group {
    display: flex;
    gap: 8px;
}

/* ===== 表单 ===== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-control,
.form-select {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    transition: var(--transition);
}

.form-control:focus,
.form-select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.15);
}

.form-control::placeholder {
    color: var(--text-muted);
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

.form-select {
    appearance: auto;
}

.form-text {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ===== 搜索栏 ===== */
.search-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
    align-items: center;
}

.search-input-wrapper {
    position: relative;
    flex: 1;
    min-width: 200px;
    max-width: 400px;
}

.search-input-wrapper .search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 14px;
}

.search-input-wrapper input {
    padding-left: 40px;
}

.filter-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

.filter-group select {
    min-width: 140px;
}

/* ===== 消息提示 ===== */
.alert {
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.alert-success { background: var(--success-bg); color: var(--success); border: 1px solid rgba(0, 184, 148, 0.3); }
.alert-error { background: var(--danger-bg); color: var(--danger); border: 1px solid rgba(225, 112, 85, 0.3); }
.alert-warning { background: var(--warning-bg); color: var(--warning); border: 1px solid rgba(253, 203, 110, 0.3); }
.alert-info { background: var(--info-bg); color: var(--info); border: 1px solid rgba(116, 185, 255, 0.3); }

/* ===== 分页 ===== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 24px 0;
}

.pagination a,
.pagination span {
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.pagination a:hover {
    border-color: var(--accent-primary);
    color: var(--accent-secondary);
}

.pagination .current {
    background: var(--accent-gradient);
    color: white;
    border-color: transparent;
}

.pagination .disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ===== 登录页 ===== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(108, 92, 231, 0.15), transparent 70%);
    top: -200px;
    right: -200px;
}

.login-page::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(0, 184, 148, 0.1), transparent 70%);
    bottom: -150px;
    left: -150px;
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 48px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
    position: relative;
    z-index: 1;
}

.login-card .logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-card .logo .icon {
    width: 64px;
    height: 64px;
    background: var(--accent-gradient);
    border-radius: var(--radius-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin-bottom: 16px;
    box-shadow: 0 8px 24px rgba(108, 92, 231, 0.4);
}

.login-card .logo h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.login-card .logo p {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 6px;
}

.login-card .btn-primary {
    width: 100%;
    padding: 12px;
    font-size: 15px;
    justify-content: center;
    margin-top: 8px;
}

/* ===== 详情页 ===== */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-value {
    font-size: 15px;
    color: var(--text-primary);
    font-weight: 500;
}

/* ===== 确认删除 ===== */
.confirm-box {
    text-align: center;
    padding: 40px;
}

.confirm-box .icon {
    width: 72px;
    height: 72px;
    background: var(--danger-bg);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    margin-bottom: 24px;
}

.confirm-box h3 {
    font-size: 20px;
    margin-bottom: 12px;
}

.confirm-box p {
    color: var(--text-secondary);
    margin-bottom: 28px;
    font-size: 14px;
}

/* ===== 空状态 ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state .icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 15px;
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
        padding: 16px;
    }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .search-bar {
        flex-direction: column;
    }
    .search-input-wrapper {
        max-width: 100%;
    }
}

/* ===== 动画 ===== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.card, .stat-card {
    animation: fadeIn 0.4s ease;
}

.stat-card:nth-child(2) { animation-delay: 0.05s; }
.stat-card:nth-child(3) { animation-delay: 0.1s; }
.stat-card:nth-child(4) { animation-delay: 0.15s; }
.stat-card:nth-child(5) { animation-delay: 0.2s; }
.stat-card:nth-child(6) { animation-delay: 0.25s; }

/* ===== 金额 ===== */
.money {
    font-weight: 700;
    color: var(--success);
}

.money::before {
    content: '¥';
    font-size: 0.85em;
    margin-right: 2px;
}
