/* ========================================
   数智工坊 · 统一设计系统
   Mobile First 响应式
   ======================================== */

/* === CSS变量 === */
:root {
    --primary: #667eea;
    --primary-dark: #5a67d8;
    --secondary: #764ba2;
    --bg-dark: #0f0f1a;
    --bg-card: #1a1a2e;
    --bg-input: #16213e;
    --text-primary: #ffffff;
    --text-secondary: #a0aec0;
    --text-muted: #718096;
    --success: #48bb78;
    --warning: #ed8936;
    --danger: #f56565;
    --border: #2d3748;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 4px 20px rgba(0,0,0,0.3);
}

/* === 全局重置 === */
* { margin: 0; padding: 0; box-sizing: border-box; }

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

a { color: var(--primary); text-decoration: none; }
img { max-width: 100%; height: auto; }

/* === 布局容器 === */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

/* === 导航栏 === */
.navbar {
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.navbar-brand {
    font-size: 18px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.navbar-nav {
    display: flex;
    gap: 16px;
    list-style: none;
}

.navbar-nav a {
    color: var(--text-secondary);
    font-size: 14px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    transition: all 0.3s;
}

.navbar-nav a:hover, .navbar-nav a.active {
    color: var(--text-primary);
    background: rgba(102, 126, 234, 0.1);
}

/* 手机端导航汉堡菜单 */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 24px;
    cursor: pointer;
}

/* === 卡片 === */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 20px;
    transition: transform 0.3s, box-shadow 0.3s;
}

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

.card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.card-icon {
    font-size: 32px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: var(--radius-sm);
}

.card-title {
    font-size: 16px;
    font-weight: 600;
}

.card-desc {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
}

/* === 按钮 === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    min-height: 44px; /* 触摸友好 */
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
}

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

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

.btn-outline:hover {
    background: rgba(102, 126, 234, 0.1);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-block {
    width: 100%;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

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

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

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    transition: border-color 0.3s;
    min-height: 44px;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--primary);
}

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

/* === 标签/Badge === */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.badge-success { background: rgba(72, 187, 120, 0.2); color: var(--success); }
.badge-warning { background: rgba(237, 137, 54, 0.2); color: var(--warning); }
.badge-danger { background: rgba(245, 101, 101, 0.2); color: var(--danger); }
.badge-info { background: rgba(102, 126, 234, 0.2); color: var(--primary); }

/* === 网格系统 === */
.grid {
    display: grid;
    gap: 16px;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* === 统计数字 === */
.stat-card {
    text-align: center;
    padding: 20px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-label {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* === 进度条 === */
.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-input);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 4px;
    transition: width 0.5s ease;
}

/* === 步骤条 === */
.steps {
    display: flex;
    justify-content: space-between;
    margin: 20px 0;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.step-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    background: var(--bg-input);
    border: 2px solid var(--border);
    color: var(--text-muted);
}

.step.active .step-icon {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.step.done .step-icon {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

.step-text {
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
}

.step.active .step-text { color: var(--primary); }
.step.done .step-text { color: var(--success); }

/* === 表格 === */
.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.table th, .table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.table th {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 12px;
    text-transform: uppercase;
}

/* === 图片上传区域 === */
.upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.upload-area:hover, .upload-area.dragover {
    border-color: var(--primary);
    background: rgba(102, 126, 234, 0.05);
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

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

.upload-hint {
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 8px;
}

/* 图片预览网格 */
.preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 8px;
    margin-top: 16px;
}

.preview-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-item .remove-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(0,0,0,0.6);
    color: white;
    border: none;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* === 套餐卡片 === */
.plan-card {
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    transition: all 0.3s;
}

.plan-card:hover, .plan-card.selected {
    border-color: var(--primary);
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.2);
}

.plan-name {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.plan-price {
    font-size: 32px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 12px 0;
}

.plan-price small {
    font-size: 14px;
    -webkit-text-fill-color: var(--text-muted);
}

.plan-desc {
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 16px;
}

/* === 页面区块 === */
.section {
    padding: 40px 0;
}

.section-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
}

.section-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 24px;
}

/* === Hero区域 === */
.hero {
    text-align: center;
    padding: 60px 0 40px;
    background: linear-gradient(135deg, rgba(102,126,234,0.1), rgba(118,75,162,0.1));
}

.hero-title {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 12px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    color: var(--text-secondary);
    font-size: 16px;
    max-width: 600px;
    margin: 0 auto 24px;
}

/* === 底部 === */
.footer {
    text-align: center;
    padding: 24px 0;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 12px;
}

/* === Toast提示 === */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    z-index: 9999;
    transition: transform 0.3s ease;
    max-width: 90%;
}

.toast.show { transform: translateX(-50%) translateY(0); }
.toast.success { background: var(--success); color: white; }
.toast.error { background: var(--danger); color: white; }
.toast.info { background: var(--primary); color: white; }

/* === Loading === */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

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

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

/* ========================================
   响应式断点
   ======================================== */

/* 手机 (< 768px) - 默认样式就是手机端 */
@media (max-width: 767px) {
    .nav-toggle { display: block; }
    .navbar-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-card);
        flex-direction: column;
        padding: 16px;
        border-bottom: 1px solid var(--border);
    }
    .navbar-nav.show { display: flex; }

    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }

    .hero-title { font-size: 22px; }
    .hero { padding: 40px 0 24px; }
    .section { padding: 24px 0; }
    .stat-value { font-size: 22px; }
}

/* 平板 (768px - 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
    .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .hero-title { font-size: 32px; }
}

/* 桌面 (> 1024px) */
@media (min-width: 1025px) {
    .container { padding: 0 24px; }
    .hero-title { font-size: 40px; }
    .hero { padding: 80px 0 60px; }
}
