        /* ═══════════════ RESET & BASE ═══════════════ */
        * { margin: 0; padding: 0; box-sizing: border-box; }
        body {
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            min-height: 100vh;
            padding: 20px;
            color: #333;
        }
        .container { max-width: 1100px; margin: 0 auto; }

        /* ═══════════════ HEADER ═══════════════ */
        .header { text-align: center; color: white; margin-bottom: 28px; }
        .header h1 { font-size: 2.4em; margin-bottom: 6px; text-shadow: 0 2px 10px rgba(0,0,0,0.15); }
        .header .subtitle { font-size: 1.15em; opacity: 0.92; letter-spacing: 0.5px; }
        .header .version-badge {
            display: inline-block; background: rgba(255,255,255,0.2);
            padding: 3px 12px; border-radius: 20px; font-size: 12px;
            margin-top: 8px; backdrop-filter: blur(5px);
        }

        /* ═══════════════ PROGRESS BAR ═══════════════ */
        .progress-wrapper { margin-bottom: 28px; }
        .progress-steps {
            display: flex; justify-content: space-between; align-items: center;
            margin-bottom: 10px; position: relative;
        }
        .progress-steps::before {
            content: ''; position: absolute; top: 50%; left: 10%;
            right: 10%; height: 3px; background: rgba(255,255,255,0.3);
            transform: translateY(-50%); z-index: 0;
        }
        .progress-step {
            display: flex; flex-direction: column; align-items: center;
            z-index: 1; flex: 1;
        }
        .step-circle {
            width: 40px; height: 40px; border-radius: 50%;
            display: flex; align-items: center; justify-content: center;
            font-weight: bold; font-size: 15px; transition: all 0.4s;
            background: rgba(255,255,255,0.25); color: rgba(255,255,255,0.7);
            border: 2px solid rgba(255,255,255,0.3);
        }
        .step-circle.active {
            background: linear-gradient(135deg, #fff 0%, #f0f0ff 100%);
            color: #667eea; border-color: white;
            box-shadow: 0 4px 15px rgba(255,255,255,0.4);
        }
        .step-circle.done {
            background: #48bb78; color: white;
            border-color: #48bb78; box-shadow: 0 4px 12px rgba(72,187,120,0.4);
            cursor: pointer; transition: all 0.3s;
        }
        .step-circle.done:hover {
            transform: scale(1.1); box-shadow: 0 6px 18px rgba(72,187,120,0.6);
        }
        .step-label {
            font-size: 12px; color: rgba(255,255,255,0.6);
            margin-top: 6px; transition: color 0.3s;
        }
        .step-label.active { color: white; font-weight: 600; }
        .step-label.done { color: #9ae6b4; }
        .progress-bar {
            width: 100%; height: 5px; background: rgba(255,255,255,0.2);
            border-radius: 3px; overflow: hidden;
        }
        .progress-fill {
            height: 100%; background: linear-gradient(90deg, #48bb78, #38b2ac, #667eea);
            transition: width 0.5s ease; border-radius: 3px; width: 0%;
        }

        /* ═══════════════ CARD ═══════════════ */
        .card {
            background: white; border-radius: 16px; padding: 32px;
            margin-bottom: 20px; box-shadow: 0 12px 48px rgba(0,0,0,0.12);
            animation: fadeInUp 0.4s ease;
        }
        @keyframes fadeInUp {
            from { opacity: 0; transform: translateY(20px); }
            to { opacity: 1; transform: translateY(0); }
        }
        .card-header { display: flex; align-items: center; margin-bottom: 24px; }
        .card-header .step-num {
            width: 38px; height: 38px; border-radius: 50%;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white; display: flex; align-items: center; justify-content: center;
            font-weight: bold; font-size: 16px; margin-right: 14px; flex-shrink: 0;
        }
        .card-header .step-title { font-size: 1.35em; color: #333; font-weight: 600; }
        .card-header .step-desc { font-size: 13px; color: #888; margin-top: 2px; }

        /* ═══════════════ FORM ELEMENTS ═══════════════ */
        .form-group { margin-bottom: 20px; }
        .form-group label {
            display: block; margin-bottom: 8px; color: #555;
            font-weight: 500; font-size: 14px;
        }
        .form-group input[type="text"] {
            width: 100%; padding: 14px 16px; border: 2px solid #e8e8e8;
            border-radius: 10px; font-size: 16px; transition: all 0.3s;
            background: #fafafa;
        }
        .form-group input[type="text"]:focus {
            outline: none; border-color: #667eea; background: white;
            box-shadow: 0 0 0 4px rgba(102,126,234,0.1);
        }

        /* ═══════════════ FILE UPLOAD ═══════════════ */
        .file-upload {
            border: 2px dashed #d0d0d0; border-radius: 12px;
            padding: 40px 20px; text-align: center; cursor: pointer;
            transition: all 0.3s; background: #fafafa;
        }
        .file-upload:hover { border-color: #667eea; background: #f5f7ff; }
        .file-upload.dragover { border-color: #667eea; background: #eef1ff; transform: scale(1.01); }
        .file-upload.has-file { border-color: #48bb78; background: #f0fff4; border-style: solid; }
        .file-upload-icon { font-size: 3em; margin-bottom: 10px; }
        .file-upload-text { color: #666; font-size: 15px; }
        .file-upload-hint { font-size: 13px; color: #999; margin-top: 8px; }
        .file-name {
            margin-top: 12px; color: #48bb78; font-weight: 600;
            display: flex; align-items: center; justify-content: center; gap: 6px;
        }

        /* ═══════════════ BUTTONS ═══════════════ */
        .btn {
            padding: 14px 32px; border: none; border-radius: 10px;
            font-size: 15px; font-weight: 600; cursor: pointer;
            transition: all 0.3s; display: inline-flex; align-items: center; gap: 8px;
        }
        .btn-primary {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white; box-shadow: 0 4px 15px rgba(102,126,234,0.3);
        }
        .btn-primary:hover:not(:disabled) {
            transform: translateY(-2px); box-shadow: 0 8px 25px rgba(102,126,234,0.4);
        }
        .btn-success {
            background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
            color: white; box-shadow: 0 4px 15px rgba(72,187,120,0.3);
        }
        .btn-success:hover:not(:disabled) {
            transform: translateY(-2px); box-shadow: 0 8px 25px rgba(72,187,120,0.4);
        }
        .btn-outline {
            background: white; color: #667eea; border: 2px solid #667eea;
        }
        .btn-outline:hover:not(:disabled) {
            background: #f5f7ff; transform: translateY(-2px);
        }
        .btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }
        .btn-lg { padding: 16px 48px; font-size: 17px; border-radius: 12px; }
        .btn-group { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 20px; }

        /* ═══════════════ STEP PANELS ═══════════════ */
        .step-panel { display: none; }
        .step-panel.active { display: block; }

        /* ═══════════════ DIRECTION CARDS ═══════════════ */
        .directions-grid {
            display: grid; grid-template-columns: repeat(3, 1fr);
            gap: 18px; margin-bottom: 24px;
        }
        @media (max-width: 768px) {
            .directions-grid { grid-template-columns: 1fr; }
        }
        .direction-card {
            border: 2px solid #e8e8e8; border-radius: 14px;
            padding: 22px; cursor: pointer; transition: all 0.3s;
            position: relative; overflow: hidden;
        }
        .direction-card:hover { transform: translateY(-3px); box-shadow: 0 8px 25px rgba(0,0,0,0.08); }
        .direction-card.selected-a { border-color: #4299e1; background: #ebf8ff; box-shadow: 0 4px 20px rgba(66,153,225,0.2); }
        .direction-card.selected-b { border-color: #48bb78; background: #f0fff4; box-shadow: 0 4px 20px rgba(72,187,120,0.2); }
        .direction-card.selected-c { border-color: #ed8936; background: #fffaf0; box-shadow: 0 4px 20px rgba(237,137,54,0.2); }
        .direction-card .check-mark {
            position: absolute; top: 12px; right: 12px; width: 26px; height: 26px;
            border-radius: 50%; display: none; align-items: center; justify-content: center;
            font-size: 14px; color: white; font-weight: bold;
        }
        .direction-card.selected-a .check-mark { display: flex; background: #4299e1; }
        .direction-card.selected-b .check-mark { display: flex; background: #48bb78; }
        .direction-card.selected-c .check-mark { display: flex; background: #ed8936; }
        .dir-icon { font-size: 2.2em; margin-bottom: 10px; }
        .dir-name { font-size: 1.1em; font-weight: 700; margin-bottom: 4px; }
        .dir-header { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
        .dir-header .dir-icon { font-size: 1.8em; margin-bottom: 0; flex-shrink: 0; }
        .dir-title { font-size: 1.15em; font-weight: 700; color: #333; }
        .dir-outline-preview { margin-top: 12px; padding-top: 12px; border-top: 1px dashed #e0e0e0; }
        /* 方向质量评分 */
        .dir-quality-badge {
            position: absolute; top: 8px; left: 12px;
            font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 10px;
            white-space: nowrap;
        }
        .dir-quality-badge.grade-A { background: #c6f6d5; color: #22543d; }
        .dir-quality-badge.grade-B { background: #fefcbf; color: #744210; }
        .dir-quality-badge.grade-C { background: #fed7d7; color: #822727; }
        .dir-quality-badge.grade-NA { background: #e2e8f0; color: #718096; }
        .dir-quality-detail {
            font-size: 10px; color: #999; margin-top: 4px; display: flex; gap: 8px; flex-wrap: wrap;
        }
        .dir-quality-detail span { white-space: nowrap; }

        /* ── 风格选择卡片 ── */
        .style-section { margin-top: 28px; }
        .style-section-title { font-size: 1.05em; font-weight: 700; color: #333; margin-bottom: 16px; }
        .styles-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
        @media (max-width: 900px) { .styles-grid { grid-template-columns: 1fr; } }
        .style-card {
            border: 2px solid #e8e8e8; border-radius: 14px;
            padding: 18px; cursor: pointer; transition: all 0.3s;
            text-align: center; position: relative; overflow: hidden;
        }
        .style-card:hover { transform: translateY(-3px); box-shadow: 0 8px 25px rgba(0,0,0,0.1); }
        .style-card.selected { border-width: 3px; box-shadow: 0 4px 20px rgba(66,153,225,0.25); }
        .style-card .style-check {
            position: absolute; top: 10px; right: 10px; width: 24px; height: 24px;
            border-radius: 50%; display: none; align-items: center; justify-content: center;
            font-size: 12px; color: white; font-weight: bold; background: #4299e1;
        }
        .style-card.selected .style-check { display: flex; }
        .style-preview {
            width: 100%; height: 70px; border-radius: 8px; margin-bottom: 12px;
            display: flex; align-items: center; justify-content: center;
            font-size: 14px; font-weight: 700; color: white;
            position: relative; overflow: hidden;
        }
        .style-preview .swatch-accent {
            position: absolute; bottom: 0; left: 0; right: 0; height: 6px;
        }
        .style-font-info {
            font-size: 12px; color: #888; margin-top: 6px;
            display: flex; justify-content: center; gap: 12px;
        }
        .style-font-info span {
            background: #f0f0f0; padding: 2px 10px; border-radius: 10px;
            font-size: 11px;
        }
        .style-desc { font-size: 13px; color: #666; margin-top: 6px; line-height: 1.4; }

        /* ── 生成按钮 ── */
        .btn-generate-wrapper { margin-top: 28px; text-align: center; }
        .btn-generate-wrapper .hint-text {
            font-size: 13px; color: #999; margin-bottom: 10px;
        }
        .dir-outline-title { font-size: 13px; font-weight: 600; color: #555; margin-bottom: 8px; }
        .dir-positioning { font-size: 13px; color: #666; margin-bottom: 12px; line-height: 1.5; }
        .outline-meta { display: flex; gap: 24px; margin-bottom: 18px; padding: 14px; background: white; border-radius: 8px; border: 1px solid #eee; }
        .outline-meta-item { display: flex; align-items: center; gap: 6px; }
        .outline-meta-label { font-size: 13px; color: #888; }
        .outline-meta-value { font-size: 15px; font-weight: 600; color: #667eea; }
        .outline-section-title .pages { font-size: 12px; color: #38b2ac; background: rgba(56,178,172,0.1); padding: 2px 8px; border-radius: 4px; }
        .dir-audience { margin-bottom: 12px; }
        .dir-audience .tag {
            display: inline-block; padding: 3px 10px; border-radius: 20px;
            font-size: 11px; margin: 2px; font-weight: 500;
        }
        .dir-audience .tag-a { background: #ebf8ff; color: #2b6cb0; }
        .dir-audience .tag-b { background: #f0fff4; color: #276749; }
        .dir-audience .tag-c { background: #fffaf0; color: #c05621; }
        .dir-selling-points { list-style: none; margin-bottom: 14px; }
        .dir-selling-points li {
            font-size: 13px; padding: 4px 0; color: #555;
            display: flex; align-items: flex-start; gap: 6px;
        }
        .dir-selling-points li::before { content: '✦'; color: #667eea; flex-shrink: 0; }
        .dir-outline-toggle {
            font-size: 12px; color: #667eea; cursor: pointer;
            display: inline-flex; align-items: center; gap: 4px;
            padding: 4px 0; border: none; background: none; font-weight: 500;
        }
        .dir-outline-toggle:hover { text-decoration: underline; }
        .dir-outline {
            display: none; margin-top: 10px; padding: 12px;
            background: rgba(0,0,0,0.02); border-radius: 8px;
            font-size: 12px; line-height: 1.8; color: #555;
            max-height: 200px; overflow-y: auto;
        }
        .dir-outline.open { display: block; }
        .dir-outline-item {
            padding: 3px 0; border-bottom: 1px solid #f0f0f0;
            display: flex; justify-content: space-between;
        }
        .dir-outline-item:last-child { border-bottom: none; }
        .dir-outline-duration {
            font-size: 11px; color: #999; background: #f5f5f5;
            padding: 1px 6px; border-radius: 4px;
        }

        /* ═══════════════ OUTLINE PREVIEW ═══════════════ */
        .outline-preview {
            background: #f8f9fa; border-radius: 10px; padding: 22px;
            line-height: 1.8; font-size: 14px; max-height: 600px;
            overflow-y: auto; margin: 20px 0;
        }
        .outline-section {
            margin-bottom: 16px; padding-bottom: 16px;
            border-bottom: 1px solid #e9ecef;
        }
        .outline-section:last-child { border-bottom: none; }
        .outline-section-title {
            font-size: 16px; font-weight: 600; color: #333;
            margin-bottom: 8px; display: flex; align-items: center; gap: 8px;
        }
        .outline-section-title .duration {
            font-size: 12px; font-weight: 500; color: #667eea;
            background: rgba(102,126,234,0.1); padding: 2px 8px;
            border-radius: 4px;
        }
        .outline-kp {
            margin-left: 12px; padding: 8px 12px;
            background: white; border-radius: 6px; margin-top: 6px;
            border-left: 3px solid #667eea;
        }
        .outline-kp-title { font-weight: 500; color: #444; margin-bottom: 4px; }
        .outline-kp-desc { font-size: 13px; color: #666; line-height: 1.6; }
        .outline-preview-header {
            display: flex; justify-content: space-between; align-items: center;
            margin-bottom: 16px; padding-bottom: 12px; border-bottom: 2px solid #667eea;
        }
        .outline-preview-title {
            font-size: 18px; font-weight: 600; color: #333;
        }
        .outline-preview-actions { display: flex; gap: 10px; }

        /* ═══════════════ TABS ═══════════════ */
        .tabs-nav {
            display: flex; gap: 6px; margin-bottom: 20px;
            overflow-x: auto; padding-bottom: 4px;
        }
        .tab-btn {
            padding: 10px 20px; border: none; border-radius: 25px;
            font-size: 14px; font-weight: 500; cursor: pointer;
            transition: all 0.3s; white-space: nowrap;
            background: #f0f0f0; color: #666;
        }
        .tab-btn:hover { background: #e8e8e8; }
        .tab-btn.active {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white; box-shadow: 0 3px 10px rgba(102,126,234,0.3);
        }
        .tab-panel { display: none; animation: fadeInUp 0.3s ease; }
        .tab-panel.active { display: block; }

        /* ═══════════════ PREVIEW CONTENT ═══════════════ */
        .preview-block {
            background: #f8f9fa; border-radius: 10px; padding: 22px;
            line-height: 1.8; font-size: 14px; max-height: 500px;
            overflow-y: auto; color: #333; white-space: pre-wrap;
            border: 1px solid #eee;
        }
        .preview-block h4 {
            color: #667eea; margin-bottom: 12px; font-size: 16px;
            padding-bottom: 8px; border-bottom: 2px solid #f0f0f0;
        }
        .preview-section {
            margin-bottom: 18px; padding: 16px;
            background: white; border-radius: 8px; border: 1px solid #eee;
        }
        .preview-section h5 {
            color: #764ba2; font-size: 14px; margin-bottom: 8px;
            display: flex; align-items: center; gap: 6px;
        }
        .preview-section .meta { font-size: 12px; color: #999; margin-bottom: 6px; }

        /* ═══════════════ PPT PREVIEW ═══════════════ */
        .ppt-summary {
            display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
            gap: 12px; margin-bottom: 20px;
        }
        .ppt-stat {
            background: white; border: 1px solid #eee; border-radius: 10px;
            padding: 16px; text-align: center;
        }
        .ppt-stat .num { font-size: 2em; font-weight: 700; color: #667eea; }
        .ppt-stat .label { font-size: 12px; color: #888; margin-top: 4px; }

        /* ═══════════════ EXERCISE TIERS ═══════════════ */
        .tier-card {
            background: white; border: 1px solid #eee; border-radius: 10px;
            padding: 18px; margin-bottom: 14px;
        }
        .tier-header {
            display: flex; justify-content: space-between; align-items: center;
            margin-bottom: 10px;
        }
        .tier-badge {
            padding: 4px 12px; border-radius: 6px; font-size: 12px;
            font-weight: 700; color: white;
        }
        .tier-badge.tier-1 { background: linear-gradient(135deg, #48bb78, #38a169); }
        .tier-badge.tier-2 { background: linear-gradient(135deg, #ed8936, #dd6b20); }
        .tier-badge.tier-3 { background: linear-gradient(135deg, #e53e3e, #c53030); }
        .tier-count { font-size: 13px; color: #888; }
        .tier-questions { list-style: none; }
        .tier-questions li {
            padding: 6px 0; border-bottom: 1px solid #f5f5f5;
            font-size: 13px; color: #555;
        }
        .tier-questions li:last-child { border-bottom: none; }

        /* ═══════════════ CASE CARDS ═══════════════ */
        .case-card {
            background: white; border: 1px solid #eee; border-radius: 10px;
            padding: 18px; margin-bottom: 14px; transition: box-shadow 0.3s;
        }
        .case-card:hover { box-shadow: 0 4px 15px rgba(0,0,0,0.06); }
        .case-card-header {
            display: flex; justify-content: space-between; align-items: flex-start;
            margin-bottom: 10px;
        }
        .case-card-title { font-size: 15px; font-weight: 600; color: #333; }
        .case-card-chapter { font-size: 12px; color: #888; margin-top: 2px; }
        .case-difficulty { display: flex; gap: 2px; }
        .case-difficulty .star { color: #ffd700; font-size: 16px; }
        .case-difficulty .star.empty { color: #e0e0e0; }
        .case-card-body { font-size: 13px; color: #555; line-height: 1.7; }
        .case-card-body .star-label {
            display: inline-block; padding: 2px 8px; border-radius: 4px;
            font-size: 11px; font-weight: 700; margin-right: 6px; color: white;
        }
        .star-s { background: #3182ce; }
        .star-t { background: #e53e3e; }
        .star-a { background: #dd6b20; }
        .star-r { background: #38a169; }

        /* ═══════════════ SUCCESS / DOWNLOAD ═══════════════ */
        .success-container { text-align: center; padding: 30px 0; }
        .success-icon {
            font-size: 4em; margin-bottom: 16px;
            animation: bounceIn 0.6s ease;
        }
        @keyframes bounceIn {
            0% { transform: scale(0); }
            50% { transform: scale(1.2); }
            100% { transform: scale(1); }
        }
        .success-title { font-size: 1.5em; color: #48bb78; margin-bottom: 8px; font-weight: 700; }
        .success-desc { color: #666; margin-bottom: 24px; }
        .file-list {
            display: inline-block; text-align: left; margin: 16px auto;
            list-style: none;
        }
        .file-list li {
            padding: 8px 16px; margin: 6px 0; background: #f0fff4;
            border-radius: 8px; font-size: 14px; color: #276749;
            display: flex; align-items: center; gap: 8px;
            border: 1px solid #c6f6d5;
        }
        .file-list li .file-icon { color: #48bb78; font-weight: bold; }

        /* ═══════════════ LOADING SPINNER ═══════════════ */
        .loading {
            display: inline-block; width: 18px; height: 18px;
            border: 2px solid rgba(255,255,255,0.3); border-radius: 50%;
            border-top-color: white; animation: spin 0.7s linear infinite;
        }
        @keyframes spin { to { transform: rotate(360deg); } }
        .loading-overlay {
            display: none; position: fixed; inset: 0;
            background: rgba(0,0,0,0.5); z-index: 1000;
            align-items: center; justify-content: center;
            backdrop-filter: blur(3px);
        }
        .loading-overlay.active { display: flex; }
        .loading-box {
            background: white; border-radius: 16px; padding: 40px 50px;
            text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,0.2);
        }
        .loading-box .spinner {
            width: 48px; height: 48px; margin: 0 auto 16px;
            border: 4px solid #f0f0f0; border-radius: 50%;
            border-top-color: #667eea; animation: spin 0.8s linear infinite;
        }
        .loading-box p { color: #555; font-size: 15px; }

        /* ═══════════════ ERROR TOAST ═══════════════ */
        .toast {
            position: fixed; top: 20px; right: 20px; z-index: 2000;
            padding: 14px 22px; border-radius: 10px; color: white;
            font-size: 14px; max-width: 480px; transform: translateX(120%);
            transition: transform 0.4s ease; box-shadow: 0 8px 25px rgba(0,0,0,0.15);
            white-space: pre-line; line-height: 1.5;
        }
        .toast.show { transform: translateX(0); }
        .toast-error { background: linear-gradient(135deg, #e53e3e, #c53030); }
        .toast-success { background: linear-gradient(135deg, #48bb78, #38a169); }
        .toast-warning { background: linear-gradient(135deg, #ed8936, #dd6b20); }
        .toast-info { background: linear-gradient(135deg, #4299e1, #3182ce); }

        /* ═══════════════ RESPONSIVE ═══════════════ */
        @media (max-width: 600px) {
            body { padding: 12px; }
            .card { padding: 20px; border-radius: 12px; }
            .header h1 { font-size: 1.8em; }
            .btn { padding: 12px 24px; font-size: 14px; }
            .tabs-nav { gap: 4px; }
            .tab-btn { padding: 8px 14px; font-size: 13px; }
            .ppt-summary { grid-template-columns: repeat(2, 1fr); }
            .progress-steps { gap: 2px; }
            .step-label { font-size: 10px; }
        }

        /* ═══════════════ SCROLLBAR ═══════════════ */
        .preview-block::-webkit-scrollbar,
        .dir-outline::-webkit-scrollbar { width: 6px; }
        .preview-block::-webkit-scrollbar-track,
        .dir-outline::-webkit-scrollbar-track { background: #f5f5f5; border-radius: 3px; }
        .preview-block::-webkit-scrollbar-thumb,
        .dir-outline::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }
        .preview-block::-webkit-scrollbar-thumb:hover,
        .dir-outline::-webkit-scrollbar-thumb:hover { background: #aaa; }
