/* 影视VIP代理系统 - 全局样式 */
:root {
    --primary: #667eea;
    --primary-dark: #5a6fd6;
    --secondary: #764ba2;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --dark: #1e293b;
    --sidebar-bg: #0f172a;
    --sidebar-hover: rgba(255,255,255,0.08);
    --card-shadow: 0 4px 20px rgba(0,0,0,0.06);
    --radius: 14px;
}

* { box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f1f5f9;
    color: #334155;
    margin: 0;
    line-height: 1.6;
}

/* ===== 前端首页 ===== */
.hero {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 40%, #334155 100%);
    color: #fff;
    min-height: 100vh;
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 80%;
    height: 150%;
    background: radial-gradient(circle, rgba(102,126,234,0.15) 0%, transparent 70%);
    pointer-events: none;
}
.hero-content { position: relative; z-index: 2; }
.hero h1 { font-size: 3rem; font-weight: 800; letter-spacing: -1px; }
.hero .lead { font-size: 1.25rem; opacity: 0.85; max-width: 560px; }
.btn-hero {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
    color: #fff;
    padding: 0.85rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1.05rem;
    transition: transform 0.2s, box-shadow 0.2s;
}
.btn-hero:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(102,126,234,0.4); color: #fff; }
.btn-outline-hero {
    border: 2px solid rgba(255,255,255,0.4);
    color: #fff;
    padding: 0.75rem 1.8rem;
    border-radius: 50px;
    font-weight: 500;
    background: transparent;
}
.btn-outline-hero:hover { background: rgba(255,255,255,0.1); color: #fff; border-color: #fff; }

.feature-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--card-shadow);
    height: 100%;
    transition: transform 0.25s, box-shadow 0.25s;
    border: 1px solid #e2e8f0;
}
.feature-card:hover { transform: translateY(-6px); box-shadow: 0 12px 40px rgba(0,0,0,0.1); }
.feature-icon {
    width: 56px; height: 56px;
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem;
    margin-bottom: 1.2rem;
}
.feature-icon.purple { background: linear-gradient(135deg, #667eea33, #764ba233); color: var(--primary); }
.feature-icon.green { background: linear-gradient(135deg, #10b98133, #34d39933); color: var(--success); }
.feature-icon.orange { background: linear-gradient(135deg, #f59e0b33, #fbbf2433); color: var(--warning); }
.feature-icon.blue { background: linear-gradient(135deg, #3b82f633, #60a5fa33); color: #3b82f6; }

.pricing-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--card-shadow);
    border: 2px solid transparent;
    transition: all 0.25s;
    height: 100%;
}
.pricing-card:hover, .pricing-card.popular {
    border-color: var(--primary);
    transform: translateY(-4px);
}
.pricing-card.popular { position: relative; }
.pricing-card .badge-popular {
    position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff; padding: 0.3rem 1rem; border-radius: 20px; font-size: 0.8rem;
}
.price { font-size: 2.5rem; font-weight: 800; color: var(--dark); }
.price small { font-size: 1rem; font-weight: 400; color: #94a3b8; }

.footer-home {
    background: #0f172a;
    color: #94a3b8;
    padding: 3rem 0 1.5rem;
}

/* ===== 后台布局 ===== */
.wrapper { display: flex; min-height: 100vh; }
.sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    color: #cbd5e1;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 1050;
    overflow-y: auto;
    transition: transform 0.3s ease;
    padding: 1.5rem 1rem;
}
.sidebar.collapsed { transform: translateX(-100%); }
.sidebar-brand {
    color: #fff;
    font-weight: 700;
    font-size: 1.15rem;
    padding: 0.5rem 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.sidebar-brand i { color: var(--primary); font-size: 1.4rem; }
.sidebar .nav-link {
    color: #94a3b8;
    padding: 0.7rem 1rem;
    border-radius: 10px;
    margin: 2px 0;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    transition: all 0.2s;
    font-size: 0.95rem;
}
.sidebar .nav-link i { width: 20px; text-align: center; font-size: 1rem; }
.sidebar .nav-link:hover { background: var(--sidebar-hover); color: #fff; }
.sidebar .nav-link.active {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(102,126,234,0.35);
}
.sidebar .nav-section {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
    padding: 1.2rem 1rem 0.4rem;
    font-weight: 600;
}
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 1.75rem 2rem;
    transition: margin-left 0.3s ease;
    min-height: 100vh;
}
.sidebar.collapsed ~ .main-content { margin-left: 0; }

.toggle-sidebar-btn {
    position: fixed;
    top: 1rem;
    left: 270px;
    z-index: 1060;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 50%;
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: left 0.3s ease;
}
.sidebar.collapsed ~ .toggle-sidebar-btn { left: 12px; }

/* 卡片 */
.card {
    border: none;
    border-radius: var(--radius);
    box-shadow: var(--card-shadow);
    background: #fff;
}
.card-header {
    background: transparent;
    border-bottom: 1px solid #f1f5f9;
    padding: 1rem 1.25rem;
    font-weight: 600;
}
.stat-card {
    border-radius: var(--radius);
    padding: 1.4rem;
    background: #fff;
    box-shadow: var(--card-shadow);
    transition: transform 0.2s;
}
.stat-card:hover { transform: translateY(-3px); }
.stat-card .stat-value { font-size: 1.9rem; font-weight: 700; color: var(--dark); }
.stat-card .stat-label { color: #94a3b8; font-size: 0.9rem; }
.stat-card .stat-icon {
    width: 48px; height: 48px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.25rem;
}

/* 按钮 */
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
    border-radius: 10px;
    font-weight: 500;
}
.btn-primary:hover { background: linear-gradient(135deg, var(--primary-dark), #6a4190); }
.btn-success { background: var(--success); border: none; border-radius: 10px; }
.btn-warning { border-radius: 10px; }
.btn-outline-secondary, .btn-outline-warning, .btn-outline-danger, .btn-outline-primary {
    border-radius: 10px;
}

/* 表格 */
.table { margin-bottom: 0; }
.table th {
    background: #f8fafc;
    font-weight: 600;
    color: #475569;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-bottom: 1px solid #e2e8f0;
}
.table td { vertical-align: middle; }
.table-hover tbody tr:hover { background: #f8fafc; }

/* 表单 */
.form-control, .form-select {
    border-radius: 10px;
    border-color: #e2e8f0;
    padding: 0.6rem 1rem;
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102,126,234,0.15);
}
.input-group-text { border-radius: 10px 0 0 10px; border-color: #e2e8f0; background: #f8fafc; }

/* 徽章 */
.badge { font-weight: 500; padding: 0.35em 0.7em; border-radius: 6px; }

/* 分页 */
.page-link { border-radius: 8px !important; margin: 0 2px; color: #64748b; border-color: #e2e8f0; }
.page-item.active .page-link {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-color: transparent;
}

/* 公告条 */
.announcement-bar {
    background: #fffbeb;
    border-left: 4px solid var(--warning);
    border-radius: 10px;
    padding: 0.85rem 1.1rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.04);
    margin-bottom: 1.5rem;
}

/* 登录页 */
.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.login-card {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.25);
    padding: 2.5rem 2rem;
}
.login-card .form-control { border-radius: 10px; padding: 0.7rem 1rem; }

/* 响应式 */
@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.show { transform: translateX(0); }
    .main-content { margin-left: 0; padding: 1rem; }
    .toggle-sidebar-btn { left: 12px; }
    .sidebar.show ~ .toggle-sidebar-btn { left: 270px; }
    .hero h1 { font-size: 2.2rem; }
}
@media (max-width: 575.98px) {
    .hero h1 { font-size: 1.8rem; }
    .stat-card .stat-value { font-size: 1.5rem; }
}

/* ===== 额外移动端优化 ===== */
@media (max-width: 991.98px) {
    .main-content { padding: 1rem 0.85rem !important; }
    .stat-card { padding: 1rem; }
    .stat-card .stat-value { font-size: 1.4rem; }
    .table-responsive { font-size: 0.875rem; }
    .card { border-radius: 12px; }
    h4.fw-bold { font-size: 1.2rem; }
}
@media (max-width: 575.98px) {
    .login-card { padding: 1.75rem 1.25rem; margin: 0 0.5rem; }
    .btn-lg { font-size: 1rem; padding: 0.65rem 1rem; }
    .sidebar { width: 240px; }
    .sidebar.show ~ .toggle-sidebar-btn { left: 250px; }
}
/* 表格在手机上横向滚动更顺畅 */
.table-responsive { -webkit-overflow-scrolling: touch; }
