/* 重置和基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

/* 容器样式 */
.container {
    max-width: 800px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    animation: slideUp 0.6s ease-out;
}

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

/* 头部样式 */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px 30px;
    text-align: center;
}

.title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    background: linear-gradient(45deg, #fff, #f0f0f0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 300;
}

/* 主要内容区域 */
.main {
    padding: 40px 30px;
}

/* 输入区域样式 */
.input-section {
    background: #f8fafc;
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 30px;
    border: 1px solid #e2e8f0;
}

.input-group {
    margin-bottom: 25px;
}

.input-label {
    display: block;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
    font-size: 1rem;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    transition: all 0.3s ease;
    overflow: hidden;
}

.input-wrapper:focus-within {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

.currency-symbol {
    background: #667eea;
    color: white;
    padding: 16px 20px;
    font-weight: 600;
    font-size: 1.2rem;
    border-radius: 10px 0 0 10px;
}

.dollar-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 16px 20px;
    font-size: 1.1rem;
    font-weight: 500;
    color: #374151;
    background: transparent;
}

.dollar-input::placeholder {
    color: #9ca3af;
}

.input-hint {
    display: block;
    margin-top: 8px;
    color: #6b7280;
    font-size: 0.875rem;
}

/* 转换按钮样式 */
.convert-btn {
    width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 16px 24px;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.convert-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

.convert-btn:active {
    transform: translateY(0);
}

.convert-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* 结果区域样式 */
.result-section {
    background: white;
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 30px;
    border: 1px solid #e2e8f0;
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.result-title {
    color: #374151;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 20px;
    text-align: center;
}

.total-cents {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 25px;
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.2);
}

.total-label {
    font-size: 1rem;
    opacity: 0.9;
}

.total-value {
    font-size: 2rem;
    font-weight: 700;
    margin: 0 8px;
}

.cents-symbol {
    font-size: 1.5rem;
    opacity: 0.9;
}

/* 硬币分配样式 */
.breakdown-title {
    color: #374151;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 20px;
    text-align: center;
}

.coins-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.coin-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.coin-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border-color: #667eea;
}

.coin-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2);
}

.coin-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
    display: block;
}

.coin-name {
    display: block;
    font-weight: 600;
    color: #374151;
    margin-bottom: 5px;
    font-size: 1rem;
}

.coin-value {
    display: block;
    color: #6b7280;
    font-size: 0.875rem;
    margin-bottom: 10px;
}

.coin-count {
    display: inline-block;
    background: #667eea;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 1.1rem;
    min-width: 40px;
}

/* 总结区域样式 */
.summary {
    background: #f1f5f9;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
}

.summary-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.summary-label {
    color: #64748b;
    font-weight: 500;
}

.summary-value {
    color: #667eea;
    font-weight: 700;
    font-size: 1.2rem;
}

.summary-unit {
    color: #64748b;
    font-size: 0.875rem;
}

/* 说明区域样式 */
.info-section {
    background: #f8fafc;
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 30px;
    border: 1px solid #e2e8f0;
}

.info-title {
    color: #374151;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 15px;
    text-align: center;
}

.info-list {
    list-style: none;
    padding: 0;
}

.info-list li {
    color: #6b7280;
    padding: 8px 0;
    position: relative;
    padding-left: 25px;
}

.info-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #10b981;
    font-weight: bold;
    font-size: 1.1rem;
}

/* 页脚样式 */
.footer {
    background: #f8fafc;
    text-align: center;
    padding: 20px 30px;
    color: #6b7280;
    border-top: 1px solid #e2e8f0;
    font-size: 0.875rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .container {
        border-radius: 16px;
    }
    
    .header {
        padding: 30px 20px;
    }
    
    .title {
        font-size: 2rem;
    }
    
    .main {
        padding: 30px 20px;
    }
    
    .input-section,
    .result-section,
    .info-section {
        padding: 20px;
    }
    
    .coins-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .total-value {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .title {
        font-size: 1.8rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .input-wrapper {
        flex-direction: column;
    }
    
    .currency-symbol {
        border-radius: 10px 10px 0 0;
        padding: 12px 20px;
    }
    
    .dollar-input {
        border-radius: 0 0 10px 10px;
        padding: 12px 20px;
    }
}

/* 加载动画 */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* 错误状态样式 */
.error {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

.error-message {
    color: #ef4444;
    font-size: 0.875rem;
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* 成功状态样式 */
.success {
    border-color: #10b981 !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1) !important;
}
