/* 基础变量定义 */
:root {
    --primary-color: #1a365d;        /* 主色调-深蓝 */
    --secondary-color: #4a5568;      /* 辅助色-灰蓝 */
    --accent-color: #4299e1;         /* 强调色-亮蓝 */
    --text-color: #2d3748;           /* 主要文字色 */
    --bg-color: #f7fafc;             /* 背景色-浅蓝灰 */
    --card-bg: #ffffff;              /* 卡片背景 */
    --hover-transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1); /* 过渡动画 */
}

/* 基础重置 */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', 'Helvetica Neue', system-ui, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    -webkit-font-smoothing: antialiased;
}

/* 页眉样式 */
.header {
    text-align: center;
    padding: 2.5rem 1rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, #2c5282 100%);
    color: white;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
}

.header h1 {
    font-size: 2.2rem;
    letter-spacing: -0.05em;
}

.subtitle {
    color: #cbd5e0;
    font-size: 1.1rem;
    margin-top: 0.8rem;
    font-weight: 300;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* 主内容区 */
.container {
    max-width: 1280px;
    margin: 3rem auto;
    padding: 0 1.5rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

/* 工具卡片 */
.tool-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.8rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 
                0 2px 4px -1px rgba(0, 0, 0, 0.03);
    transition: var(--hover-transition);
    min-height: 380px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 
                0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* 卡片图片 */
.tool-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 1.2rem;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

/* 卡片文字内容 */
.tool-title {
    font-size: 1.3rem;
    margin-bottom: 0.6rem;
    color: var(--primary-color);
    font-weight: 600;
}

.tool-description {
    font-size: 0.92rem;
    color: #4a5568;
    line-height: 1.7;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

/* 操作按钮 */
.tool-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.65rem 1.4rem;
    background: var(--accent-color);
    color: white !important;
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    transition: var(--hover-transition);
    margin-top: auto;
    width: fit-content;
    align-self: flex-end;
    border: 2px solid transparent;
}

.tool-button:hover {
    background: #3182ce;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(66, 153, 225, 0.3);
}

.tool-button:focus {
    outline: none;
    border-color: rgba(66, 153, 225, 0.5);
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.2);
}

/* 页脚样式 */
.footer {
    text-align: center;
    padding: 2.5rem 1rem;
    background: var(--primary-color);
    color: white;
    margin-top: 4rem;
}

.footer-links {
    margin-bottom: 1rem;
}

.footer-links a {
    color: #cbd5e0;
    text-decoration: none;
    transition: color 0.2s;
    font-size: 0.9rem;
    display: inline-block;
    padding: 0.3rem 0.5rem;
}

.footer-links a:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

.divider {
    color: #718096;
    margin: 0 0.5rem;
    font-size: 0.9em;
}

.footer p {
    font-size: 0.9rem;
    color: #a0aec0;
    margin-top: 0.8rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header {
        padding: 2rem 1rem;
    }

    .header h1 {
        font-size: 1.8rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        margin: 2rem auto;
    }

    .tool-card {
        min-height: auto;
        padding: 1.4rem;
    }

    .tool-image {
        height: 160px;
    }
}

@media (max-width: 480px) {
    .footer-links {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }

    .divider {
        display: none;
    }

    .tool-button {
        width: 100%;
        justify-content: center;
    }
}

/* 无障碍优化 */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .tool-card,
    .tool-button {
        transition: none;
    }
}

[aria-hidden="true"] {
    display: none;
}