        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
            background-color: #f9fafb;
            min-height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 10px;
        }

        .container {
            background: white;
            border-radius: 16px;
            box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
            padding: 24px;
            width: 100%;
            max-width: 400px;
        }

        h1 {
            text-align: center;
            font-size: 24px;
            font-weight: bold;
            color: #1f2937;
            margin-bottom: 20px;
        }

        .input-grid {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 12px;
            margin-bottom: 20px;
        }

        .input-box {
            height: 50px;
            border: 2px solid #d1d5db;
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 24px;
            font-weight: bold;
            color: #1f2937;
            background: white;
        }

        .number-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 10px;
            justify-items: center;
            margin-bottom: 20px;
        }

        .number-btn {
            width: 64px;
            height: 64px;
            border: 2px solid #1f2937;
            border-radius: 50%;
            background: white;
            font-size: 24px;
            font-weight: bold;
            color: #1f2937;
            cursor: pointer;
            transition: all 0.2s;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .number-btn:hover {
            background: #1f2937;
            color: white;
        }

        .number-btn:active {
            transform: scale(0.95);
        }

        .icon-btn {
            padding: 0;
        }

        .icon-btn svg {
            width: 24px;
            height: 24px;
        }

        .confirm-btn {
            width: 100%;
            height: 48px;
            background: #1f2937;
            color: white;
            border: none;
            border-radius: 24px;
            font-size: 18px;
            font-weight: bold;
            cursor: pointer;
            transition: all 0.2s;
        }

        .confirm-btn:hover {
            background: #111827;
        }

        .confirm-btn:active {
            transform: scale(0.98);
        }

        /* 结果页面样式 */
        .results-container {
            background: white;
            border-radius: 16px;
            box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
            padding: 24px;
            width: 100%;
            max-width: 800px;
            /* display: none; removed for multi-page */
        }

        /* .results-container.active { display: block; } removed */

        .back-btn {
            display: flex;
            align-items: center;
            gap: 8px;
            background: none;
            border: none;
            color: #1f2937;
            font-size: 16px;
            font-weight: 600;
            cursor: pointer;
            margin-bottom: 24px;
            transition: color 0.2s;
        }

        .back-btn:hover {
            color: #4b5563;
        }

        .back-btn svg {
            width: 20px;
            height: 20px;
        }

        .result-title {
            text-align: center;
            font-size: 24px;
            font-weight: bold;
            color: #1f2937;
            margin-bottom: 20px;
        }

        .number-display {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            margin-bottom: 24px;
        }

        .result-header-group {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 12px;
            flex-wrap: wrap;
            width: 100%;
        }

        .result-label {
            color: #6b7280;
            font-weight: 500;
            white-space: nowrap;
        }

        .number-badges-container {
            display: flex;
            align-items: center;
            justify-content: center;
            flex-wrap: wrap;
        }
        
        .number-badges-container > div {
            display: flex;
            align-items: center;
        }

        .number-badges-container span.comma {
            margin: 0 4px;
        }

        .number-badge {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 40px;
            height: 40px;
            background: #1f2937;
            color: white;
            border-radius: 8px;
            font-size: 18px;
            font-weight: bold;
        }

        .comma {
            color: #9ca3af;
            margin: 0 4px;
        }

        .status-box {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 12px;
            padding: 16px;
            border-radius: 12px;
            margin-bottom: 32px;
        }

        .status-box.success {
            background: #f0fdf4;
            border: 2px solid #86efac;
        }

        .status-box.error {
            background: #fef2f2;
            border: 2px solid #fca5a5;
        }

        .status-icon {
            width: 32px;
            height: 32px;
        }

        .status-text h3 {
            font-size: 18px;
            font-weight: bold;
            margin-bottom: 4px;
        }

        .status-text p {
            font-size: 14px;
        }

        .success .status-icon,
        .success h3 {
            color: #16a34a;
        }

        .success p {
            color: #15803d;
        }

        .error .status-icon,
        .error h3 {
            color: #dc2626;
        }

        .error p {
            color: #b91c1c;
        }

        .solutions-section h2 {
            font-size: 20px;
            font-weight: bold;
            color: #1f2937;
            margin-bottom: 16px;
        }

        .solutions-list {
            max-height: 350px;
            overflow-y: auto;
        }

        .solution-item {
            background: #f9fafb;
            border: 2px solid #e5e7eb;
            border-radius: 12px;
            padding: 16px;
            margin-bottom: 12px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            transition: border-color 0.2s;
        }

        .solution-item:hover {
            border-color: #1f2937;
        }

        .solution-number {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 32px;
            height: 32px;
            background: #1f2937;
            color: white;
            border-radius: 50%;
            font-size: 14px;
            font-weight: bold;
            margin-right: 12px;
            flex-shrink: 0;
        }

        .solution-expression {
            flex: 1;
            font-size: 18px;
            font-family: 'Courier New', monospace;
            font-weight: 500;
            color: #1f2937;
            white-space: nowrap;
            overflow-x: auto;
            scrollbar-width: none;
        }
        
        .solution-expression::-webkit-scrollbar {
            display: none;
        }

        .solution-result {
            padding: 4px 16px;
            background: #1f2937;
            color: white;
            border-radius: 20px;
            font-weight: bold;
            margin-left: 12px;
            flex-shrink: 0;
        }

        .retry-btn {
            display: block;
            margin: 32px auto 0;
            padding: 12px 40px;
            background: #1f2937;
            color: white;
            border: none;
            border-radius: 28px;
            font-size: 18px;
            font-weight: bold;
            cursor: pointer;
            transition: all 0.2s;
        }

        .retry-btn:hover {
            background: #111827;
        }

        .retry-btn:active {
            transform: scale(0.98);
        }

        .hidden {
            display: none;
        }

        @media (max-width: 480px) {
            body {
                padding: 0;
                background-color: white;
                align-items: flex-start;
            }

            .container, .results-container {
                padding: 20px;
                width: 100%;
                max-width: 100%;
                min-height: 100vh;
                border-radius: 0;
                box-shadow: none;
                display: flex;
                flex-direction: column;
            }
            
            /* 输入页面专属：内容垂直居中 */
            #inputPage {
                justify-content: center;
            }

            /* 输入页面布局优化 */
            #inputPage h1 {
                margin-top: 0;
                margin-bottom: 24px;
            }

            #inputPage .input-grid {
                margin-bottom: 32px;
            }

            #inputPage .number-grid {
                margin-top: 0;
                margin-bottom: 24px;
            }

            #inputPage .confirm-btn {
                flex-shrink: 0;
                margin-bottom: 0;
            }
            
            /* 结果页面布局优化 */
            .results-container {
                display: flex;
            }

            .number-display {
                gap: 8px;
            }
            
            .result-header-group {
                flex-direction: column;
                gap: 8px;
            }
            
            .solution-item {
                padding: 10px;
            }
            
            .solution-number {
                width: 24px;
                height: 24px;
                font-size: 12px;
                margin-right: 8px;
            }
            
            .solution-expression {
                font-size: 14px;
            }
            
            .solution-result {
                padding: 2px 10px;
                font-size: 14px;
                margin-left: 8px;
            }

            .number-badge {
                width: 36px;
                height: 36px;
                font-size: 16px;
            }

            /* 让结果列表占据剩余空间并可滚动 */
            #solutionsSection {
                flex: 1;
                overflow-y: auto;
                min-height: 0; /* 允许 flex item 收缩 */
            }

            .solutions-list {
                max-height: none;
                overflow-y: visible;
            }

            .retry-btn {
                margin-top: 20px;
                flex-shrink: 0;
            }

            .hidden {
                display: none !important;
            }
        }