

        :root {
            --bg: #f8f9fc;
            --bg-card: #ffffff;
            --bg-header: #ffffff;
            --text: #1a1a2e;
            --text-secondary: #6b7280;
            --text-muted: #9ca3af;
            --border: #e5e7eb;
            --primary: #4f46e5;
            --primary-light: #eef2ff;
            --primary-dark: #4338ca;
            --accent: #f59e0b;
            --accent-light: #fef3c7;
            --green: #10b981;
            --green-light: #d1fae5;
            --red: #ef4444;
            --red-light: #fee2e2;
            --purple: #8b5cf6;
            --purple-light: #ede9fe;
            --blue: #3b82f6;
            --blue-light: #dbeafe;
            --orange: #f97316;
            --orange-light: #ffedd5;
            --teal: #14b8a6;
            --teal-light: #ccfbf1;
            --pink: #ec4899;
            --pink-light: #fce7f3;
            --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
            --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
            --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
            --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
            --shadow-xl: 0 20px 25px rgba(0,0,0,0.1), 0 10px 10px rgba(0,0,0,0.04);
            --radius-sm: 8px;
            --radius: 12px;
            --radius-lg: 16px;
            --radius-xl: 20px;
            --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
        }

        * { margin: 0; padding: 0; box-sizing: border-box; }

        body {
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", sans-serif;
            background: var(--bg);
            color: var(--text);
            line-height: 1.6;
            min-height: 100vh;
        }

        /* Header */
        .header {
            background: var(--bg-header);
            border-bottom: 1px solid var(--border);
            position: sticky;
            top: 0;
            z-index: 100;
            backdrop-filter: blur(12px);
            background: rgba(255,255,255,0.92);
        }

        .header-inner {
            max-width: 1280px;
            margin: 0 auto;
            padding: 16px 24px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 24px;
        }

        .logo {
            display: flex;
            align-items: center;
            gap: 10px;
            text-decoration: none;
            flex-shrink: 0;
        }

        .logo-icon {
            width: 40px;
            height: 40px;
            background: linear-gradient(135deg, var(--primary), #7c3aed);
            border-radius: var(--radius-sm);
            display: flex;
            align-items: center;
            justify-content: center;
            color: #fff;
            font-size: 22px;
            font-weight: 700;
        }

        .logo-text {
            font-size: 20px;
            font-weight: 700;
            color: var(--text);
            letter-spacing: -0.5px;
        }

        .logo-text span {
            background: linear-gradient(135deg, var(--primary), #7c3aed);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }

        /* Search */
        .search-wrapper {
            flex: 1;
            max-width: 480px;
            position: relative;
        }

        .search-input {
            width: 100%;
            padding: 12px 44px 12px 16px;
            border: 2px solid var(--border);
            border-radius: 50px;
            font-size: 15px;
            outline: none;
            transition: var(--transition);
            background: var(--bg);
            color: var(--text);
        }

        .search-input:focus {
            border-color: var(--primary);
            box-shadow: 0 0 0 4px var(--primary-light);
        }

        .search-input::placeholder { color: var(--text-muted); }

        .search-icon {
            position: absolute;
            right: 16px;
            top: 50%;
            transform: translateY(-50%);
            color: var(--text-muted);
            font-size: 18px;
            pointer-events: none;
        }

        /* Stats bar */
        .stats-bar {
            display: flex;
            align-items: center;
            gap: 8px;
            flex-shrink: 0;
        }

        .stat-item {
            display: flex;
            align-items: center;
            gap: 6px;
            font-size: 13px;
            color: var(--text-secondary);
            padding: 6px 12px;
            background: var(--bg);
            border-radius: 50px;
            cursor: default;
        }

        .stat-dot {
            width: 6px;
            height: 6px;
            border-radius: 50%;
            background: var(--green);
            animation: pulse 2s infinite;
        }

        @keyframes pulse {
            0%, 100% { opacity: 1; }
            50% { opacity: 0.5; }
        }

        /* AI tools dropdown */
        .dropdown {
            position: relative;
            flex-shrink: 0;
        }

        .dropdown-trigger {
            display: flex;
            align-items: center;
            gap: 6px;
            font-size: 13px;
            font-weight: 600;
            color: #fff;
            padding: 8px 16px;
            background: linear-gradient(135deg, var(--primary), #7c3aed);
            border: none;
            border-radius: 50px;
            cursor: pointer;
            transition: var(--transition);
            font-family: inherit;
        }

        .dropdown-trigger:hover {
            box-shadow: var(--shadow-md);
            transform: translateY(-1px);
        }

        .ranking-btn {
            display: flex;
            align-items: center;
            gap: 6px;
            font-size: 13px;
            font-weight: 600;
            color: #fff;
            text-decoration: none;
            padding: 8px 16px;
            background: linear-gradient(135deg, var(--primary), #7c3aed);
            border: none;
            border-radius: 50px;
            cursor: pointer;
            transition: var(--transition);
            font-family: inherit;
        }

        .ranking-btn:hover {
            box-shadow: var(--shadow-md);
            transform: translateY(-1px);
            color: #fff;
        }

        .dropdown-arrow {
            font-size: 10px;
            transition: transform 0.2s;
        }

        .dropdown:hover .dropdown-arrow {
            transform: rotate(180deg);
        }

        .dropdown-menu {
            position: absolute;
            top: calc(100% + 8px);
            right: 0;
            min-width: 190px;
            background: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: var(--radius);
            box-shadow: var(--shadow-lg);
            padding: 8px;
            opacity: 0;
            visibility: hidden;
            transform: translateY(-6px);
            transition: var(--transition);
            z-index: 200;
        }

        .dropdown:hover .dropdown-menu {
            opacity: 1;
            visibility: visible;
            transform: translateY(0);
        }

        .dropdown-item {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 10px 14px;
            border-radius: var(--radius-sm);
            font-size: 14px;
            font-weight: 500;
            color: var(--text);
            text-decoration: none;
            transition: var(--transition);
        }

        .dropdown-item:hover {
            background: var(--primary-light);
            color: var(--primary);
        }

        .dropdown-item .item-icon {
            width: 28px;
            height: 28px;
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 15px;
            flex-shrink: 0;
        }

        /* Difficulty filter */
        .diff-filter {
            display: flex;
            gap: 6px;
            flex-shrink: 0;
        }
        .diff-btn {
            padding: 5px 12px;
            border-radius: 50px;
            border: 1.5px solid var(--border);
            background: var(--bg);
            font-size: 12px;
            color: var(--text-secondary);
            cursor: pointer;
            transition: all 0.2s;
        }
        .diff-btn:hover { border-color: var(--primary); color: var(--primary); }
        .diff-btn.active {
            border-color: var(--primary);
            background: var(--primary-light);
            color: var(--primary);
            font-weight: 600;
        }

        /* Main */
        .main {
            max-width: 1280px;
            margin: 0 auto;
            padding: 24px;
        }

        /* Hero */
        .hero {
            text-align: center;
            padding: 48px 24px 32px;
        }

        .hero-title {
            font-size: 40px;
            font-weight: 800;
            letter-spacing: -1px;
            margin-bottom: 12px;
            line-height: 1.2;
        }

        .hero-gradient {
            background: linear-gradient(135deg, var(--primary), #7c3aed, #db2777);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }

        .hero-subtitle {
            font-size: 17px;
            color: var(--text-secondary);
            max-width: 500px;
            margin: 0 auto 32px;
        }

        .hero-search {
            flex: none;
            max-width: 560px;
            width: 100%;
            margin: 0 auto;
            box-shadow: var(--shadow-lg);
            border-radius: 50px;
        }

        .hero-search .search-input {
            padding: 16px 48px 16px 20px;
            font-size: 16px;
            box-shadow: none;
        }

        .hero-search .search-icon {
            right: 18px;
            font-size: 20px;
        }

        /* Category tabs */
        .categories {
            display: flex;
            gap: 8px;
            flex-wrap: wrap;
            margin-bottom: 32px;
            justify-content: center;
        }

        .cat-btn {
            padding: 10px 20px;
            border: 2px solid var(--border);
            border-radius: 50px;
            background: var(--bg-card);
            color: var(--text-secondary);
            font-size: 14px;
            font-weight: 500;
            cursor: pointer;
            transition: var(--transition);
            white-space: nowrap;
            display: flex;
            align-items: center;
            gap: 6px;
        }

        .cat-btn:hover {
            border-color: var(--primary);
            color: var(--primary);
            background: var(--primary-light);
        }

        .cat-btn.active {
            background: var(--primary);
            color: #fff;
            border-color: var(--primary);
        }

        .cat-emoji { font-size: 16px; }

        .cat-count {
            font-size: 12px;
            opacity: 0.7;
        }

        /* Subcategory tabs */
        .subcategories {
            display: flex;
            gap: 8px;
            flex-wrap: wrap;
            margin-bottom: 28px;
            justify-content: center;
            padding: 16px 20px;
            background: var(--primary-light);
            border-radius: var(--radius);
            border: 1px solid var(--primary);
            border-opacity: 0.15;
        }

        .subcat-btn {
            padding: 8px 18px;
            border: 2px solid transparent;
            border-radius: 50px;
            background: var(--bg-card);
            color: var(--text-secondary);
            font-size: 13px;
            font-weight: 500;
            cursor: pointer;
            transition: var(--transition);
            white-space: nowrap;
            display: flex;
            align-items: center;
            gap: 5px;
        }

        .subcat-btn:hover {
            border-color: var(--primary);
            color: var(--primary);
        }

        .subcat-btn.active {
            background: var(--primary);
            color: #fff;
            border-color: var(--primary);
        }

        .subcat-emoji { font-size: 15px; }

        .subcat-count {
            font-size: 11px;
            opacity: 0.7;
        }

        /* Results header */
        .results-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 20px;
        }

        .results-count {
            font-size: 14px;
            color: var(--text-secondary);
        }

        .results-count strong {
            color: var(--primary);
            font-weight: 700;
        }

        /* Prompt grid */
        .prompts-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
            gap: 20px;
        }

        /* Prompt card */
        .prompt-card {
            background: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: var(--radius-lg);
            padding: 24px;
            transition: var(--transition);
            cursor: pointer;
            position: relative;
            overflow: hidden;
            display: flex;
            flex-direction: column;
        }

        .prompt-card::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 3px;
            background: linear-gradient(90deg, var(--primary), #7c3aed);
            opacity: 0;
            transition: var(--transition);
        }

        .prompt-card:hover {
            box-shadow: var(--shadow-lg);
            border-color: var(--primary);
            transform: translateY(-2px);
        }

        .prompt-card:hover::before {
            opacity: 1;
        }

        .card-header {
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            margin-bottom: 12px;
            gap: 12px;
        }

        .card-icon {
            width: 42px;
            height: 42px;
            border-radius: var(--radius-sm);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 20px;
            flex-shrink: 0;
        }

        .card-title {
            flex: 1;
            font-size: 17px;
            font-weight: 700;
            color: var(--text);
            line-height: 1.3;
        }

        .card-badge {
            padding: 3px 8px;
            border-radius: 50px;
            font-size: 11px;
            font-weight: 600;
            white-space: nowrap;
        }

        .badge-easy { background: var(--green-light); color: #065f46; }
        .badge-medium { background: var(--accent-light); color: #92400e; }
        .badge-hard { background: var(--red-light); color: #991b1b; }

        .card-desc {
            font-size: 14px;
            color: var(--text-secondary);
            margin-bottom: 16px;
            flex: 1;
        }

        .card-tags {
            display: flex;
            flex-wrap: wrap;
            gap: 6px;
            margin-bottom: 16px;
        }

        .tag {
            padding: 4px 10px;
            background: var(--bg);
            border-radius: 6px;
            font-size: 12px;
            color: var(--text-secondary);
            border: 1px solid transparent;
            transition: var(--transition);
        }

        .tag:hover {
            border-color: var(--primary);
            color: var(--primary);
        }

        .card-actions {
            display: flex;
            gap: 8px;
            margin-top: auto;
        }

        .btn {
            padding: 10px 18px;
            border-radius: 50px;
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
            transition: var(--transition);
            border: none;
            display: flex;
            align-items: center;
            gap: 6px;
            font-family: inherit;
        }

        .btn-primary {
            background: var(--primary);
            color: #fff;
            flex: 1;
            justify-content: center;
        }

        .btn-primary:hover {
            background: var(--primary-dark);
            box-shadow: 0 4px 12px rgba(79,70,229,0.3);
        }

        .btn-outline {
            background: transparent;
            border: 2px solid var(--border);
            color: var(--text-secondary);
            padding: 10px;
        }

        .btn-outline:hover {
            border-color: var(--primary);
            color: var(--primary);
        }

        .btn-copied {
            background: var(--green) !important;
            color: #fff !important;
            border-color: var(--green) !important;
        }

        /* Empty state */
        .empty-state {
            text-align: center;
            padding: 72px 24px;
            grid-column: 1 / -1;
        }

        .empty-icon {
            font-size: 64px;
            margin-bottom: 16px;
            opacity: 0.5;
        }

        .empty-title {
            font-size: 20px;
            font-weight: 700;
            margin-bottom: 8px;
            color: var(--text);
        }

        .empty-desc {
            color: var(--text-secondary);
            font-size: 15px;
        }

        /* Modal */
        .modal-overlay {
            position: fixed;
            inset: 0;
            background: rgba(0,0,0,0.5);
            z-index: 200;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 24px;
            animation: fadeIn 0.2s ease;
            backdrop-filter: blur(4px);
        }

        @keyframes fadeIn {
            from { opacity: 0; }
            to { opacity: 1; }
        }

        .modal {
            background: var(--bg-card);
            border-radius: var(--radius-xl);
            max-width: 680px;
            width: 100%;
            max-height: 85vh;
            overflow-y: auto;
            box-shadow: var(--shadow-xl);
            animation: slideUp 0.3s ease;
        }

        @keyframes slideUp {
            from { opacity: 0; transform: translateY(20px); }
            to { opacity: 1; transform: translateY(0); }
        }

        .modal-header {
            padding: 24px 28px 0;
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
        }

        .modal-meta {
            display: flex;
            gap: 8px;
            flex-wrap: wrap;
        }

        .modal-close {
            width: 36px;
            height: 36px;
            border-radius: 50%;
            border: none;
            background: var(--bg);
            cursor: pointer;
            font-size: 18px;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: var(--transition);
            flex-shrink: 0;
        }

        .modal-close:hover {
            background: #f3f4f6;
            color: var(--red);
        }

        .modal-body {
            padding: 20px 28px;
        }

        .modal-title {
            font-size: 22px;
            font-weight: 700;
            margin-bottom: 8px;
        }

        .modal-desc {
            color: var(--text-secondary);
            font-size: 15px;
            margin-bottom: 20px;
            line-height: 1.7;
        }

        .modal-prompt-box {
            background: #1e1e2e;
            color: #e2e8f0;
            border-radius: var(--radius);
            padding: 20px 24px;
            font-size: 14px;
            line-height: 1.8;
            white-space: pre-wrap;
            word-break: break-word;
            font-family: "SF Mono", "Fira Code", "Cascadia Code", "Consolas", monospace;
            position: relative;
            max-height: 350px;
            overflow-y: auto;
        }

        .modal-prompt-box::-webkit-scrollbar {
            width: 6px;
        }

        .modal-prompt-box::-webkit-scrollbar-track {
            background: transparent;
        }

        .modal-prompt-box::-webkit-scrollbar-thumb {
            background: #4a4a5a;
            border-radius: 3px;
        }

        .modal-footer {
            padding: 0 28px 28px;
            display: flex;
            gap: 10px;
        }

        /* Example section */
        .example-label {
            font-size: 12px;
            font-weight: 700;
            color: #8b5cf6;
            margin-top: 16px;
            margin-bottom: 8px;
            display: flex;
            align-items: center;
            gap: 4px;
        }

        .example-box {
            background: #f5f3ff;
            border: 1px solid #e0d9ff;
            border-radius: var(--radius);
            padding: 14px 16px;
            font-size: 13px;
            line-height: 1.7;
            color: #4c1d95;
            white-space: pre-wrap;
            word-break: break-word;
            max-height: 160px;
            overflow-y: auto;
            font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
        }

        .example-box::-webkit-scrollbar {
            width: 4px;
        }

        .example-box::-webkit-scrollbar-thumb {
            background: #c4b5fd;
            border-radius: 2px;
        }

        .card-example-toggle {
            font-size: 11px;
            color: #8b5cf6;
            cursor: pointer;
            user-select: none;
            margin-top: 8px;
            display: inline-flex;
            align-items: center;
            gap: 4px;
            padding: 3px 10px;
            border-radius: 50px;
            background: #f5f3ff;
            border: 1px solid #e0d9ff;
            transition: var(--transition);
        }

        .card-example-toggle:hover {
            background: #ede9fe;
        }

        .card-example-preview {
            display: none;
            background: #f5f3ff;
            border: 1px solid #e0d9ff;
            border-radius: var(--radius-sm);
            padding: 10px 14px;
            font-size: 12px;
            line-height: 1.6;
            color: #4c1d95;
            margin-top: 8px;
            white-space: pre-wrap;
            word-break: break-word;
            max-height: 100px;
            overflow-y: auto;
        }

        .card-example-preview.show {
            display: block;
        }

        /* Toast */
        .toast {
            position: fixed;
            bottom: 32px;
            left: 50%;
            transform: translateX(-50%) translateY(100px);
            background: #1e1e2e;
            color: #fff;
            padding: 12px 24px;
            border-radius: 50px;
            font-size: 14px;
            font-weight: 600;
            z-index: 300;
            display: flex;
            align-items: center;
            gap: 8px;
            box-shadow: var(--shadow-lg);
            transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
            pointer-events: none;
        }

        .toast.show {
            transform: translateX(-50%) translateY(0);
        }

        /* Footer */
        .footer {
            text-align: center;
            padding: 40px 24px;
            border-top: 1px solid var(--border);
            color: var(--text-muted);
            font-size: 13px;
            margin-top: 48px;
        }

        /* Responsive */
        @media (max-width: 768px) {
            .header-inner {
                flex-direction: column;
                gap: 12px;
                padding: 12px 16px;
            }

            .hero-search {
                max-width: 100%;
            }

            .hero-title {
                font-size: 28px;
            }

            .hero {
                padding: 32px 16px 24px;
            }

            .prompts-grid {
                grid-template-columns: 1fr;
            }

            .categories {
                gap: 6px;
            }

            .cat-btn {
                padding: 8px 14px;
                font-size: 13px;
            }

            .modal {
                max-height: 90vh;
            }
        }

        @media (min-width: 1400px) {
            .prompts-grid {
                grid-template-columns: repeat(3, 1fr);
            }
        }
        /* Back to top */
        .back-to-top {
            position: fixed;
            bottom: 30px;
            right: 30px;
            width: 48px;
            height: 48px;
            border-radius: 50%;
            background: var(--primary);
            color: #fff;
            border: none;
            cursor: pointer;
            font-size: 22px;
            opacity: 0;
            visibility: hidden;
            transition: all 0.3s;
            box-shadow: 0 4px 16px rgba(79,70,229,0.4);
            z-index: 999;
        }
        .back-to-top.show { opacity: 1; visibility: visible; }
        .back-to-top:hover { background: var(--primary-dark); transform: translateY(-3px); box-shadow: 0 6px 20px rgba(79,70,229,0.5); }

    
/* === 加载状态 === */
        .loading-state { text-align:center; padding:90px 20px; }
        .loading-spinner {
            width:42px; height:42px; margin:0 auto 18px;
            border:3px solid var(--border);
            border-top-color:var(--primary);
            border-radius:50%;
            animation:spin 0.8s linear infinite;
        }
        @keyframes spin { to { transform:rotate(360deg); } }
        .loading-text { color:var(--text-muted); font-size:14px; }
        #loadMoreSentinel { min-height:64px; }
    