/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    --secondary-hover: #475569;
    --success-color: #10b981;
    --error-color: #ef4444;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --background: #ffffff;
    --input-bg: #f8fafc;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 
                 'Microsoft YaHei', sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    width: 100%;
}

/* 头部样式 */
header {
    margin-bottom: 50px;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 25px;
}

.logo {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    animation: logoRotate 20s linear infinite;
}

@keyframes logoRotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.header-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 5px;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 400;
    line-height: 1.4;
}

/* 主要内容区域 */
main {
    background: var(--background);
    border-radius: 16px;
    padding: 40px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}

/* 转换器网格 */
.converter-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    margin-bottom: 40px;
}

/* 输入组样式 */
.input-group {
    display: flex;
    flex-direction: column;
}

.input-group label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-weight: 500;
}

.label-title {
    font-size: 1rem;
    color: var(--text-primary);
}

.label-hint {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 400;
}

.input-group input {
    width: 100%;
    padding: 14px 16px;
    font-size: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    background: var(--input-bg);
    color: var(--text-primary);
    transition: all 0.3s ease;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--background);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.input-group input::placeholder {
    color: #cbd5e1;
}

.input-group input.error {
    border-color: var(--error-color);
    background: #fef2f2;
}

.input-group input.success {
    border-color: var(--success-color);
}

.error-message {
    min-height: 20px;
    font-size: 0.85rem;
    color: var(--error-color);
    margin-top: 6px;
    display: block;
}

/* 按钮组 */
.button-group {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 40px;
}

.btn {
    padding: 12px 32px;
    font-size: 1rem;
    font-weight: 500;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--background);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--input-bg);
    border-color: var(--secondary-color);
}

/* 信息区域 */
.info-section {
    background: var(--input-bg);
    border-radius: 12px;
    padding: 30px;
    border-left: 4px solid var(--primary-color);
}

.info-section h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.info-section ul {
    list-style: none;
    padding-left: 0;
}

.info-section ul li {
    padding: 8px 0;
    color: var(--text-secondary);
    position: relative;
    padding-left: 25px;
}

.info-section ul li::before {
    content: "•";
    position: absolute;
    left: 8px;
    color: var(--primary-color);
    font-weight: bold;
    font-size: 1.2rem;
}

/* 页脚 */
footer {
    text-align: center;
    margin-top: 50px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Toast 提示 */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--text-primary);
    color: white;
    padding: 16px 24px;
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 1000;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.toast.success {
    background: var(--success-color);
}

.toast.error {
    background: var(--error-color);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 20px 15px;
    }

    .header-content {
        gap: 20px;
    }

    .logo {
        width: 65px;
        height: 65px;
    }

    header h1 {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 0.95rem;
    }

    main {
        padding: 25px;
    }

    .converter-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }

    .button-group {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .info-section {
        padding: 20px;
    }

    .toast {
        right: 15px;
        bottom: 15px;
        left: 15px;
    }
}

@media (max-width: 480px) {
    .header-content {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .header-text {
        align-items: center;
    }

    .logo {
        width: 60px;
        height: 60px;
    }

    header h1 {
        font-size: 1.75rem;
    }

    .subtitle {
        font-size: 0.85rem;
    }

    main {
        padding: 20px;
    }

    .input-group input {
        padding: 12px 14px;
        font-size: 0.95rem;
    }

    .btn {
        padding: 10px 24px;
        font-size: 0.95rem;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.input-group {
    animation: fadeIn 0.5s ease;
}

.input-group:nth-child(1) { animation-delay: 0.1s; }
.input-group:nth-child(2) { animation-delay: 0.2s; }
.input-group:nth-child(3) { animation-delay: 0.3s; }
.input-group:nth-child(4) { animation-delay: 0.4s; }

