/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    background-attachment: fixed;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.97);
    border-radius: 25px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.container:hover {
    transform: translateY(-5px);
    box-shadow: 0 35px 70px rgba(0, 0, 0, 0.2);
}

/* 头部样式 */
header {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: white;
    padding: 45px 30px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

header::before {
    content: "✨";
    position: absolute;
    top: 20px;
    left: 30px;
    font-size: 1.8rem;
    opacity: 0.8;
    animation: float 3s infinite ease-in-out;
}

header::after {
    content: "✨";
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 1.8rem;
    opacity: 0.8;
    animation: float 3s infinite ease-in-out 1.5s;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

header h1 {
    font-size: 2.8rem;
    margin-bottom: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.theme-intro {
    margin-top: 20px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.theme-intro p {
    text-align: center;
    font-size: 1.2rem;
    line-height: 1.6;
    color: #f0f0f0;
    margin: 0;
    padding: 0 20px;
}

.time-comparison {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin: 15px 0;
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.time-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.time-label {
    font-size: 0.9rem;
    color: #e0e0e0;
    margin-bottom: 5px;
}

.time-value {
    font-size: 1.4rem;
    font-weight: bold;
    color: #fff;
    font-family: monospace;
    background: rgba(0, 0, 0, 0.25);
    padding: 8px 18px;
    border-radius: 25px;
    min-width: 110px;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.time-value:hover {
    transform: scale(1.1);
    background: rgba(0, 0, 0, 0.3);
}

.time-separator {
    font-size: 1.5rem;
    color: #ccc;
    font-weight: bold;
}

.translation-section {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 15px;
    padding: 20px;
    margin: 20px 0;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.translation-section h3 {
    color: #fff;
    text-align: center;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.translation-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.translation-controls select {
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
}

#swap-languages {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

#swap-languages:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.translation-inputs {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.translation-inputs textarea {
    flex: 1;
    min-height: 100px;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.95);
    font-size: 1rem;
    resize: vertical;
    font-family: inherit;
}

.translation-inputs textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.translation-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.translation-actions button {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

#translate-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

#translate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

#clear-translation {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

#clear-translation:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* 主体内容样式 */
main {
    padding: 30px;
    position: relative;
}

.decorative-elements {
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    height: 40px;
    pointer-events: none;
}

.element-left {
    position: absolute;
    left: 30px;
    font-size: 2rem;
    opacity: 0.7;
}

.element-right {
    position: absolute;
    right: 30px;
    font-size: 2rem;
    opacity: 0.7;
}

.calculator-section {
    max-width: 1000px;
    margin: 0 auto;
}

.input-group h2 {
    color: #2c3e50;
    margin-bottom: 25px;
    font-size: 1.8rem;
    text-align: center;
}

.form-row {
    display: flex;
    gap: 30px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.form-item {
    flex: 1;
    min-width: 250px;
}

.form-item {
    flex: 1;
    min-width: 250px;
}

.form-item label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
    font-size: 1.1rem;
}

.form-item input {
    width: 100%;
    padding: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    background: #ffffff;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.05);
}

.form-item input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.2), inset 0 2px 5px rgba(0, 0, 0, 0.05);
    background: white;
}

/* 按钮容器 */
.calculate-btn-container {
    text-align: center;
    margin: 30px 0;
}

#calculateBtn, #resetBtn {
    padding: 15px 30px;
    margin: 0 10px;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

#calculateBtn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

#calculateBtn:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 30px rgba(102, 126, 234, 0.4);
}

#resetBtn {
    background: #e74c3c;
    color: white;
}

#resetBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(231, 76, 60, 0.3);
}

/* 结果区域样式 */
.results-section h2 {
    color: #2c3e50;
    margin: 40px 0 25px 0;
    font-size: 1.8rem;
    text-align: center;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 40px;
}

.result-card {
    background: linear-gradient(135deg, #ffffff, #f8f9fa);
    padding: 32px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    transition: all 0.4s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

.result-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, #667eea, #764ba2);
}

.result-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 18px 35px rgba(102, 126, 234, 0.2);
    border: 1px solid rgba(102, 126, 234, 0.2);
}

.result-card h3 {
    color: #555;
    font-size: 1.1rem;
    margin-bottom: 15px;
    font-weight: 600;
}

.result-value {
    font-size: 2rem;
    font-weight: 700;
    color: #43a047;
    margin-bottom: 10px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.result-desc {
    color: #6c757d;
    font-size: 0.9rem;
}

/* 价格构成明细 */
.breakdown-section h2 {
    color: #2c3e50;
    margin: 40px 0 25px 0;
    font-size: 1.8rem;
    text-align: center;
}

.breakdown-list {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 12px;
    border-left: 5px solid #667eea;
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #dee2e6;
}

.breakdown-item:last-child {
    border-bottom: none;
}

.breakdown-item strong {
    color: #495057;
}

.breakdown-amount {
    font-weight: 600;
}

.total-breakdown {
    font-weight: 700;
    font-size: 1.2rem;
    color: #28a745;
    padding-top: 15px;
    margin-top: 15px;
    border-top: 2px solid #dee2e6;
}

/* 底部样式 */
footer {
    background: linear-gradient(to right, #2c3e50, #34495e);
    color: white;
    text-align: center;
    padding: 25px;
    font-size: 0.95rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.about-section {
    background: linear-gradient(135deg, #f5f5f5, #e8eaf6);
    padding: 40px 30px;
    margin: 30px 30px 0;
    border-radius: 16px;
    border: 1px solid #d1c4e9;
}

.about-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.about-content h3 {
    color: #4527a0;
    font-size: 1.8rem;
    margin-bottom: 20px;
}

.about-content p {
    color: #5e35b1;
    font-size: 1.1rem;
    line-height: 1.8;
    margin: 0;
    text-align: justify;
}

/* 响应式设计 */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    main {
        padding: 20px;
    }
    
    .form-row {
        flex-direction: column;
        gap: 20px;
    }
    
    .form-item {
        min-width: auto;
    }
    
    .results-grid {
        grid-template-columns: 1fr;
    }
    
    .result-value {
        font-size: 1.8rem;
    }
    
    .calculate-btn-container {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
    
    #calculateBtn, #resetBtn {
        margin: 5px 0;
    }
    
    /* 翻译功能响应式设计 */
    .translation-inputs {
        flex-direction: column;
    }
    
    .translation-controls {
        flex-wrap: wrap;
    }
    
    .translation-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .translation-actions button {
        width: 100%;
    }
}

/* 错误提示样式 */
.error {
    border-color: #e74c3c !important;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1) !important;
}

.error-message {
    color: #e74c3c;
    font-size: 0.9rem;
    margin-top: 5px;
    display: block;
}