/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    padding: 40px;
    max-width: 500px;
    width: 100%;
    animation: slideUp 0.6s ease-out;
}

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

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 头部样式 */
header {
    text-align: center;
    margin-bottom: 40px;
}

header h1 {
    color: #333;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.subtitle {
    color: #666;
    font-size: 1.1rem;
}

/* 输入区域样式 */
.input-section {
    margin-bottom: 20px;
}

.input-group {
    margin-bottom: 18px;
    position: relative;
}

.input-group label {
    display: block;
    margin-bottom: 6px;
    color: #333;
    font-weight: 600;
    font-size: 0.95rem;
}

.input-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.input-group input:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.unit {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    font-weight: 500;
    pointer-events: none;
}

/* 时间输入组样式 */
.time-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f8f9fa;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    padding: 12px 16px;
    transition: all 0.3s ease;
}

.time-input-group:focus-within {
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.time-input-group input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 1rem;
    text-align: center;
    padding: 0;
    outline: none;
}

.time-input-group input:focus {
    box-shadow: none;
}

.time-separator {
    color: #666;
    font-weight: 600;
    font-size: 1.1rem;
    user-select: none;
}

.calculate-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 8px;
}

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

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

.calculate-btn.secondary {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.calculate-btn.secondary:hover {
    box-shadow: 0 10px 25px rgba(40, 167, 69, 0.3);
}

/* 手动计算区域样式 */
.manual-calc-section {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 18px;
    margin-top: 15px;
    border: 1px solid #e9ecef;
}

.manual-calc-section h3 {
    color: #333;
    font-size: 1.1rem;
    margin-bottom: 8px;
    text-align: center;
}

.manual-desc {
    color: #666;
    font-size: 0.85rem;
    text-align: center;
    margin-bottom: 15px;
}

/* 手动计算结果区域 */
.manual-result-section {
    background: #e8f5e8;
    border-radius: 12px;
    padding: 18px;
    margin-top: 15px;
    border: 1px solid #28a745;
    animation: fadeIn 0.5s ease-out;
}

.manual-result-section h3 {
    color: #155724;
    font-size: 1.2rem;
    margin-bottom: 15px;
    text-align: center;
}

/* 设置区域样式 */
.settings-section {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
    border: 1px solid #ffc107;
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.1);
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.settings-section h3 {
    color: #856404;
    font-size: 1.1rem;
    margin: 0;
    font-weight: 600;
}

.settings-row {
    display: flex;
    gap: 15px;
    align-items: end;
}

.setting-item {
    flex: 1;
    position: relative;
}

.setting-item label {
    display: block;
    margin-bottom: 4px;
    color: #856404;
    font-weight: 500;
    font-size: 0.85rem;
}

.setting-item input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ffc107;
    border-radius: 8px;
    font-size: 0.9rem;
    background: white;
    transition: all 0.2s ease;
}

.setting-item input:focus {
    outline: none;
    border-color: #fd7e14;
    box-shadow: 0 0 0 2px rgba(253, 126, 20, 0.2);
}

.setting-item .unit {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #856404;
    font-size: 0.8rem;
    font-weight: 500;
    pointer-events: none;
}

.time-input-compact {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 8px 12px;
    transition: all 0.2s ease;
}

.time-input-compact:focus-within {
    border-color: #fd7e14;
    box-shadow: 0 0 0 2px rgba(253, 126, 20, 0.2);
}

.time-input-compact input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 0.9rem;
    text-align: center;
    padding: 0;
    outline: none;
}

.time-input-compact .time-separator {
    color: #856404;
    font-weight: 600;
    font-size: 0.9rem;
    user-select: none;
}

.settings-btn {
    padding: 8px 16px;
    background: linear-gradient(135deg, #ffc107 0%, #fd7e14 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.settings-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.3);
}

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

/* 结果区域样式 */
.result-section {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 18px;
    margin-top: 20px;
    animation: fadeIn 0.5s ease-out;
}

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

.result-section h3 {
    color: #333;
    font-size: 1.2rem;
    margin-bottom: 15px;
    text-align: center;
}

.result-grid {
    display: grid;
    gap: 12px;
    margin-bottom: 15px;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease;
}

.result-item:hover {
    transform: translateY(-2px);
}

.result-item.highlight {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.result-item .label {
    font-weight: 600;
    font-size: 0.9rem;
}

.result-item .value {
    font-weight: 700;
    font-size: 1.1rem;
}

.status {
    text-align: center;
    padding: 12px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
}

.status.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status.warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.status.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* 底部信息 */
footer {
    margin-top: 20px;
    text-align: center;
}

.info {
    background: #e9ecef;
    padding: 12px;
    border-radius: 8px;
    color: #666;
    font-size: 0.85rem;
}

/* 响应式设计 */
@media (max-width: 600px) {
    .container {
        padding: 30px 20px;
        margin: 10px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .input-group input {
        padding: 12px 15px;
        font-size: 1rem;
    }
    
    .calculate-btn {
        padding: 15px;
        font-size: 1.1rem;
    }
    
    .result-item {
        padding: 12px 15px;
    }
    
    .result-item .label {
        font-size: 0.9rem;
    }
    
    .result-item .value {
        font-size: 1.1rem;
    }
    
    .settings-row {
        flex-direction: column;
        gap: 12px;
    }
    
    .settings-header {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    
    .settings-btn {
        width: 100%;
    }
}

/* 错误状态样式 */
.input-group.error input {
    border-color: #dc3545;
    background: #f8d7da;
}

.error-message {
    color: #dc3545;
    font-size: 0.9rem;
    margin-top: 5px;
    display: block;
}
