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

        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            background: #f5f5f5;
            min-height: 100vh;
        }

        /* Main Container */
        .container {
            max-width: 1400px;
            margin: 20px auto;
            padding: 0 20px;
        }

        /* Page Header */
        .page-header {
            background: white;
            border-radius: 10px;
            padding: 25px;
            margin-bottom: 20px;
            box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        }

        .page-title {
            font-size: 24px;
            font-weight: 700;
            color: #333;
            margin-bottom: 12px;
        }

        .page-description {
            font-size: 14px;
            color: #666;
            line-height: 1.6;
            margin-bottom: 15px;
        }

        .intro-section {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
            gap: 15px;
            margin-top: 15px;
        }

        .intro-card {
            background: #f8f9fa;
            padding: 15px;
            border-radius: 8px;
            border-left: 3px solid #667eea;
        }

        .intro-card-title {
            font-size: 14px;
            font-weight: 600;
            color: #667eea;
            margin-bottom: 8px;
        }

        .intro-card-text {
            font-size: 13px;
            color: #666;
            line-height: 1.5;
        }

        /* Control Section */
        .control-section {
            background: white;
            border-radius: 10px;
            padding: 20px;
            margin-bottom: 20px;
            box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        }

        .control-row {
            display: flex;
            gap: 15px;
            align-items: center;
            flex-wrap: wrap;
            margin-bottom: 15px;
        }

        .control-row:last-child {
            margin-bottom: 0;
        }

        .control-label {
            font-size: 14px;
            font-weight: 600;
            color: #333;
            min-width: 100px;
        }

        .control-buttons {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            flex: 1;
        }

        .control-btn {
            padding: 6px 14px;
            border: 2px solid #667eea;
            background: white;
            color: #667eea;
            border-radius: 6px;
            cursor: pointer;
            font-weight: 600;
            font-size: 13px;
            transition: all 0.3s;
        }

        .control-btn:hover {
            background: #667eea;
            color: white;
        }

        .control-btn.active {
            background: #667eea;
            color: white;
        }

        .back-to-generator-btn {
            padding: 10px 20px;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            border: none;
            border-radius: 8px;
            cursor: pointer;
            font-weight: 600;
            font-size: 14px;
            transition: all 0.3s;
            box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
        }

        .back-to-generator-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
        }

        /* Surnames Grid */
        .surnames-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
            gap: 15px;
            margin-bottom: 25px;
        }

        .surname-card {
            background: white;
            border-radius: 10px;
            padding: 18px;
            box-shadow: 0 2px 10px rgba(0,0,0,0.1);
            transition: all 0.3s;
            cursor: pointer;
        }

        .surname-card:hover {
            transform: translateY(-3px);
            box-shadow: 0 5px 20px rgba(0,0,0,0.15);
        }

        .surname-header {
            display: flex;
            align-items: center;
            gap: 12px;
            margin-bottom: 12px;
            padding-bottom: 12px;
            border-bottom: 2px solid #f0f0f0;
        }

        .surname-character {
            font-size: 40px;
            font-weight: 700;
            color: #667eea;
        }

        .surname-info {
            flex: 1;
        }

        .surname-pinyin {
            font-size: 16px;
            font-weight: 600;
            color: #333;
            margin-bottom: 4px;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .pronunciation-btn {
            background: #667eea;
            color: white;
            border: none;
            border-radius: 50%;
            width: 26px;
            height: 26px;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            font-size: 14px;
            transition: all 0.3s;
        }

        .pronunciation-btn:hover {
            background: #764ba2;
            transform: scale(1.1);
        }

        .surname-initial {
            font-size: 12px;
            color: #999;
            font-weight: 500;
        }

        .surname-meaning {
            font-size: 13px;
            color: #666;
            line-height: 1.5;
            margin-bottom: 12px;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }

        .surname-scores {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 6px;
        }

        .score-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            font-size: 12px;
            padding: 3px 0;
        }

        .score-label {
            color: #666;
            font-weight: 500;
        }

        .score-value {
            font-weight: 700;
            color: #667eea;
            font-size: 13px;
        }

        /* Modal */
        .modal {
            display: none;
            position: fixed;
            z-index: 1000;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0,0,0,0.5);
            animation: fadeIn 0.3s;
        }

        .modal.show {
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .modal-content {
            background: white;
            border-radius: 15px;
            padding: 30px;
            max-width: 600px;
            width: 90%;
            max-height: 80vh;
            overflow-y: auto;
            position: relative;
            animation: slideUp 0.3s;
        }

        @keyframes fadeIn {
            from { opacity: 0; }
            to { opacity: 1; }
        }

        @keyframes slideUp {
            from { transform: translateY(50px); opacity: 0; }
            to { transform: translateY(0); opacity: 1; }
        }

        .modal-close {
            position: absolute;
            right: 20px;
            top: 20px;
            font-size: 28px;
            font-weight: bold;
            color: #999;
            cursor: pointer;
            transition: all 0.3s;
        }

        .modal-close:hover {
            color: #333;
        }

        .modal-header {
            display: flex;
            align-items: center;
            gap: 20px;
            margin-bottom: 20px;
            padding-bottom: 20px;
            border-bottom: 2px solid #f0f0f0;
        }

        .modal-character {
            font-size: 64px;
            font-weight: 700;
            color: #667eea;
        }

        .modal-info {
            flex: 1;
        }

        .modal-pinyin {
            font-size: 24px;
            font-weight: 600;
            color: #333;
            margin-bottom: 8px;
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .modal-initial {
            font-size: 14px;
            color: #999;
            font-weight: 500;
        }

        .modal-section {
            margin-bottom: 20px;
        }

        .modal-section-title {
            font-size: 16px;
            font-weight: 600;
            color: #333;
            margin-bottom: 10px;
        }

        .modal-meaning {
            font-size: 14px;
            color: #666;
            line-height: 1.7;
        }

        .modal-scores {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 12px;
        }

        .modal-score-item {
            background: #f8f9fa;
            padding: 12px;
            border-radius: 8px;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .modal-score-label {
            font-size: 14px;
            color: #666;
            font-weight: 500;
        }

        .modal-score-value {
            font-size: 18px;
            font-weight: 700;
            color: #667eea;
        }

        /* Pagination */
        .pagination-section {
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 15px;
            margin: 25px 0;
        }

        .pagination-btn {
            padding: 8px 18px;
            background: white;
            color: #667eea;
            border: 2px solid #667eea;
            border-radius: 8px;
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s;
        }

        .pagination-btn:hover:not(:disabled) {
            background: #667eea;
            color: white;
        }

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

        .pagination-info {
            font-size: 14px;
            color: #666;
            font-weight: 500;
        }

        /* Loading Spinner */
        .loading {
            text-align: center;
            padding: 40px;
            color: #667eea;
            font-size: 14px;
        }

        .spinner {
            border: 3px solid #f3f3f3;
            border-top: 3px solid #667eea;
            border-radius: 50%;
            width: 40px;
            height: 40px;
            animation: spin 1s linear infinite;
            margin: 20px auto;
        }

        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }

        /* No Results */
        .no-results {
            text-align: center;
            padding: 50px 20px;
            background: white;
            border-radius: 10px;
            box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        }

        .no-results-icon {
            font-size: 48px;
            margin-bottom: 15px;
        }

        .no-results-text {
            font-size: 16px;
            color: #666;
            margin-bottom: 8px;
        }

        .no-results-hint {
            font-size: 13px;
            color: #999;
        }

        /* Responsive */
        @media (max-width: 768px) {
            .surnames-grid {
                grid-template-columns: 1fr;
            }

            .control-row {
                flex-direction: column;
                align-items: flex-start;
            }

            .control-label {
                min-width: auto;
            }

            .page-title {
                font-size: 20px;
            }

            .modal-content {
                padding: 20px;
            }

            .modal-character {
                font-size: 48px;
            }

            .modal-pinyin {
                font-size: 20px;
            }
        }
    </style>
