
.back-link {
    display: block;
    text-align: left;
    margin-bottom: 20px;
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.back-link:hover {
    color: var(--primary);
}

.container {
    background: var(--card-bg);
    padding: 40px;
    border-radius: 24px;
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 550px;
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

header {
    text-align: center;
    margin-bottom: 30px;
}

h1 {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

p.desc {
    color: var(--text-light);
    font-size: 0.95rem;
}

.input-row {
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin-bottom: 25px;
}

.num-input {
    width: 100%;
    height: 64px;
    border: 2px solid #cbd5e1;
    border-radius: 16px;
    font-size: 28px;
    text-align: center;
    font-weight: 700;
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.9);
    transition: all 0.2s ease;
    outline: none;
}

.num-input:focus {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.15);
}

input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* --- 按钮组样式 --- */
.btn-group {
    display: flex;
    gap: 12px;
}

.btn-calc {
    flex: 2;
    padding: 18px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 16px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 6px rgba(14, 165, 233, 0.2);
}

.btn-calc:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-calc:active {
    transform: scale(0.98);
}

.btn-clear {
    flex: 1;
    padding: 18px;
    background: #f1f5f9;
    color: #64748b;
    border: none;
    border-radius: 16px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-clear:hover {
    background: #e2e8f0;
    color: #334155;
    transform: translateY(-1px);
}

.btn-clear:active {
    transform: scale(0.98);
}


/* --- 结果区域样式 --- */
.result-section {
    margin-top: 30px;
    border-top: 2px dashed #e2e8f0;
    padding-top: 20px;
    display: none;
}

.status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-size: 0.9rem;
    color: var(--text-light);
}

.count-badge {
    background: #e0f2fe;
    color: var(--primary);
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: bold;
}

/* Flex 布局让卡片自适应 */
.solutions-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    max-height: 350px;
    overflow-y: auto;
    padding: 10px;
}

.solutions-grid::-webkit-scrollbar {
    width: 6px;
}

.solutions-grid::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 10px;
}

.card {
    background: #fff;
    border: 1px solid #f1f5f9;
    height: 48px;
    padding: 0 20px;
    min-width: 120px;
    border-radius: 24px;
    /* 胶囊形状 */

    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: 0.5px;

    display: flex;
    align-items: center;
    justify-content: center;

    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
    cursor: default;
    user-select: all;

    animation: popIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    transition: all 0.2s ease;
}

.card:hover {
    transform: translateY(-3px) scale(1.02);
    border-color: var(--primary);
    background-color: #f0f9ff;
    color: var(--primary);
    box-shadow: 0 8px 15px -3px rgba(14, 165, 233, 0.2);
    z-index: 10;
}

.no-solution {
    text-align: center;
    padding: 20px;
    color: #ef4444;
    font-weight: 500;
}

@keyframes popIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@media (max-width: 480px) {
    .container {
        padding: 25px;
    }

    .num-input {
        height: 55px;
        font-size: 22px;
    }

    .card {
        padding: 0 12px;
        font-size: 1rem;
        height: 42px;
    }
}
