:root {
    --primary-color: #4a90e2;
    --secondary-color: #6c5ce7;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    margin: 0;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.container {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    width: 90%;
    max-width: 600px;
    margin-top: 2rem;
}

h1 {
    color: var(--secondary-color);
    margin-bottom: 2rem;
}

.stats {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    text-align: center;
}

.stats span {
    color: var(--primary-color);
    font-weight: bold;
}

.input-group {
    margin: 1rem 0;
}

input {
    width: 70%;
    padding: 0.8rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

/* 编号输入框特殊样式 */
input[type="number"] {
    -moz-appearance: textfield;
}
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input:focus {
    outline: none;
    border-color: var(--primary-color);
}

button {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.2s, opacity 0.2s;
    margin: 0.5rem;
}

button:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

#output {
    margin-top: 2rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 10px;
    position: relative;
}

.result-item {
    margin: 1rem 0;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.warning {
    color: #e74c3c;
    font-size: 0.9rem;
    margin-top: 0.5rem;
    display: none;
}

.copy-btn {
    background: #2ecc71;
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    margin-left: 1rem;
}

.alert {
    background: #e74c3c;
    color: white;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    text-align: center;
}

.loading {
    text-align: center;
    color: #666;
    padding: 1rem;
}

@media (max-width: 480px) {
    .container {
        padding: 1rem;
    }
    input {
        width: 100%;
    }
}

/* 弹窗基础样式 */
.popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease-out;
}

.popup-content {
    background: white;
    width: 90%;
    max-width: 500px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.3);
    transform: translateY(20px);
    animation: slideUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.popup-header {
    background: linear-gradient(135deg, #3498db, #2c3e50);
    color: white;
    padding: 20px;
    position: relative;
    text-align: center;
}

.popup-title {
    font-size: 1.8rem;
    margin: 0;
    font-weight: 600;
}

.popup-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 1.8rem;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    transition: transform 0.3s;
    line-height: 1;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.popup-close:hover {
    background: rgba(255,255,255,0.2);
    transform: rotate(90deg);
}

.popup-body {
    padding: 25px;
    max-height: 60vh;
    overflow-y: auto;
}

.popup-message {
    font-size: 1.1rem;
    line-height: 1.7;
    color: #444;
    margin-bottom: 20px;
}

.popup-highlight {
    background: linear-gradient(120deg, rgba(52, 152, 219, 0.1), transparent);
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
    border-left: 4px solid #3498db;
}

.popup-list {
    padding-left: 20px;
    margin-bottom: 20px;
}

.popup-list li {
    margin-bottom: 10px;
    line-height: 1.6;
}

.popup-footer {
    padding: 20px;
    background: #f8f9fa;
    text-align: center;
    border-top: 1px solid #eee;
}

.popup-btn {
    background: linear-gradient(to right, #3498db, #2c3e50);
    color: white;
    border: none;
    padding: 12px 35px;
    font-size: 1.1rem;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.popup-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 7px 20px rgba(0, 0, 0, 0.2);
}

.popup-btn:active {
    transform: translateY(1px);
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* 响应式调整 */
@media (max-width: 600px) {
    .popup-content {
        width: 95%;
    }
    
    .popup-body {
        padding: 20px 15px;
    }
    
    .popup-title {
        font-size: 1.5rem;
    }
}