/**
 * 租户门户主题样式
 * 支持品牌配置动态加载
 */

:root {
    --brand-primary: #667eea;
    --brand-primary-dark: #4a5fc7;
    --brand-gradient: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-primary-dark) 100%);
    --text-primary: #1a1a1a;
    --text-secondary: #666;
    --text-muted: #999;
    --bg-white: #ffffff;
    --bg-gray: #f5f7fa;
    --border-color: #e8e8e8;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.1);
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

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

body {
    min-width: 320px;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'PingFang SC', 'Microsoft YaHei', sans-serif;
    color: var(--text-primary);
    background: var(--bg-white);
    line-height: 1.6;
    overflow-x: hidden;
}

/* 通用容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* 按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-primary {
    background: var(--brand-gradient);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-outline {
    background: transparent;
    color: var(--brand-primary);
    border: 2px solid var(--brand-primary);
}

.btn-outline:hover {
    background: var(--brand-primary);
    color: white;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 16px;
}

/* 导航栏 */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
}

.navbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-primary);
}

.navbar-logo {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    object-fit: contain;
}

.navbar-logo-placeholder {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: var(--brand-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 18px;
}

.navbar-brand .brand-name {
    font-size: 20px;
    font-weight: 600;
}

.navbar-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    overflow-x: auto;
}

.navbar-nav::-webkit-scrollbar {
    display: none;
}

.nav-link {
    padding: 8px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 15px;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.nav-link:hover,
.nav-link.active {
    color: var(--brand-primary);
    background: rgba(102, 126, 234, 0.08);
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-greeting {
    color: var(--text-secondary);
    font-size: 14px;
    margin-right: 8px;
}

/* Hero区域 */
.hero {
    padding: 140px 0 80px;
    background: linear-gradient(180deg, #f8f9ff 0%, white 100%);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 30%, rgba(102, 126, 234, 0.08) 0%, transparent 50%),
                radial-gradient(circle at 70% 70%, rgba(118, 75, 162, 0.06) 0%, transparent 50%);
}

.hero-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
    position: relative;
    z-index: 1;
}

.hero-content h1 {
    font-size: 48px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 20px;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--brand-primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-content p {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 32px;
    line-height: 1.8;
}

.hero-actions {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.hero-demo {
    background: white;
    border-radius: var(--radius-xl);
    padding: 24px;
    box-shadow: var(--shadow-lg);
}

/* 统计数据 */
.stats {
    padding: 60px 0;
    background: var(--bg-white);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 32px;
}

.stat-item {
    text-align: center;
    padding: 32px;
    background: var(--bg-gray);
    border-radius: var(--radius-lg);
}

.stat-number {
    font-size: 42px;
    font-weight: 700;
    color: var(--brand-primary);
    margin-bottom: 8px;
}

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

/* 特色功能 */
.features {
    padding: 80px 0;
    background: var(--bg-gray);
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-header h2 {
    font-size: 36px;
    font-weight: 600;
    margin-bottom: 16px;
}

.section-header p {
    font-size: 16px;
    color: var(--text-secondary);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.feature-card {
    background: white;
    padding: 40px 32px;
    border-radius: var(--radius-lg);
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-md);
}

.feature-icon {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-md);
    background: var(--brand-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 28px;
    margin-bottom: 20px;
}

.feature-card h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 12px;
}

.feature-card p {
    color: var(--text-secondary);
    line-height: 1.7;
}

/* 应用场景 */
.scenarios {
    padding: 80px 0;
    background: white;
}

.scenarios-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.scenario-card {
    display: flex;
    gap: 20px;
    padding: 32px;
    background: var(--bg-gray);
    border-radius: var(--radius-lg);
    transition: all 0.3s ease;
}

.scenario-card:hover {
    background: rgba(102, 126, 234, 0.05);
}

.scenario-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    background: var(--brand-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    flex-shrink: 0;
}

.scenario-content h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.scenario-content p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* 小程序引导 */
.miniprogram-guide {
    padding: 80px 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
}

.miniprogram-card {
    background: white;
    border-radius: var(--radius-xl);
    padding: 60px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: center;
    box-shadow: var(--shadow-md);
}

.miniprogram-info h2 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 16px;
}

.miniprogram-info p {
    color: var(--text-secondary);
    font-size: 16px;
    margin-bottom: 24px;
    line-height: 1.7;
}

.miniprogram-features {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 32px;
}

.miniprogram-feature {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-secondary);
}

.miniprogram-feature i {
    color: var(--brand-primary);
}

.miniprogram-qrcode {
    text-align: center;
}

.qrcode-placeholder {
    width: 200px;
    height: 200px;
    background: var(--bg-gray);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.qrcode-placeholder i {
    font-size: 48px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.qrcode-placeholder span {
    font-size: 14px;
    color: var(--text-muted);
}

/* 开发者引导 */
.developer-cta {
    padding: 80px 0;
    background: white;
}

.developer-card {
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-primary-dark) 100%);
    border-radius: var(--radius-xl);
    padding: 60px;
    color: white;
    text-align: center;
    overflow: hidden;
    position: relative;
}

.developer-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 70% 30%, rgba(255,255,255,0.1) 0%, transparent 50%);
    pointer-events: none;
}

.developer-content {
    position: relative;
    z-index: 1;
}

.developer-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    font-size: 28px;
    margin-bottom: 20px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.developer-card h2 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 16px;
}

.developer-card p {
    font-size: 16px;
    opacity: 0.9;
    margin-bottom: 32px;
}

.developer-features {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
    margin-bottom: 32px;
}

.developer-feature {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    opacity: 0.95;
    background: rgba(255,255,255,0.1);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
}

.developer-feature i {
    color: #52c41a;
}

.developer-card .btn {
    background: white;
    color: var(--brand-primary);
}

.developer-card .btn:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateY(-2px);
}

/* 页脚 */
.footer {
    background: #1a1a1a;
    color: rgba(255, 255, 255, 0.8);
    padding: 60px 0 32px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 48px;
    margin-bottom: 48px;
}

.footer-brand .brand-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.footer-brand .logo-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: var(--brand-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
}

.footer-brand p {
    font-size: 14px;
    line-height: 1.7;
    opacity: 0.8;
}

.footer-column h3 {
    color: white;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 20px;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-link {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}

.footer-link:hover {
    color: white;
}

.footer-bottom {
    padding-top: 32px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
}

/* Toast */
.portal-toast {
    position: fixed;
    top: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-size: 14px;
    z-index: 9999;
    opacity: 0;
    transition: all 0.3s ease;
}

.portal-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.portal-toast-success {
    background: #52c41a;
}

.portal-toast-error {
    background: #ff4d4f;
}

.portal-toast-info {
    background: var(--brand-primary);
}

/* 响应式 */
@media (max-width: 992px) {
    .hero-inner {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .miniprogram-card {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .navbar-inner {
        height: 64px;
    }
    
    .navbar-nav {
        display: none;
    }
    
    .hero {
        padding: 100px 0 60px;
    }
    
    .hero-content h1 {
        font-size: 32px;
    }
    
    .hero-content p {
        font-size: 16px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 16px;
    }
    
    .stat-item {
        padding: 24px 16px;
    }
    
    .stat-number {
        font-size: 32px;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .scenarios-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }
}
