* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #0ea5e9;
    --secondary-color: #06b6d4;
    --accent-color: #14b8a6;
    --text-color: #0f172a;
    --text-light: #64748b;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.12);
    --gradient-start: #0ea5e9;
    --gradient-end: #06b6d4;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 50%, #14b8a6 100%);
    background-attachment: fixed;
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
}

/* 加载动画 */
.loader-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 50%, #14b8a6 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loader-wrapper.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader {
    text-align: center;
}

.loader-circle {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

.loader-text {
    color: #ffffff;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 2px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 容器 */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.container.visible {
    opacity: 1;
}

/* 头部 */
.header {
    background: var(--card-bg);
    padding: 20px 40px;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo h1 {
    font-size: 28px;
    color: var(--primary-color);
    font-weight: 700;
}

.nav {
    display: flex;
    gap: 20px;
}

.nav-link {
    text-decoration: none;
    color: var(--text-light);
    font-weight: 500;
    padding: 8px 20px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
    background: rgba(14, 165, 233, 0.1);
}

/* 主内容 */
.main {
    min-height: calc(100vh - 300px);
}

/* 欢迎区域 */
.welcome-section {
    background: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 50%, #14b8a6 100%);
    padding: 80px 40px;
    border-radius: 20px;
    text-align: center;
    margin-bottom: 60px;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.welcome-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: float 15s infinite ease-in-out;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(20px, 20px); }
}

.welcome-content {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.welcome-title {
    font-size: 48px;
    color: #ffffff;
    font-weight: 700;
    margin-bottom: 20px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.welcome-subtitle {
    font-size: 20px;
    color: rgba(255, 255, 255, 0.95);
    font-weight: 400;
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.15);
}

/* 工具网格 */
.tools-section {
    padding: 0 20px;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.tool-card {
    background: var(--card-bg);
    padding: 40px 30px;
    border-radius: 20px;
    text-decoration: none;
    color: var(--text-color);
    box-shadow: var(--shadow);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(14, 165, 233, 0.1);
}

.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color), var(--accent-color));
    transform: scaleX(0);
    transition: transform 0.4s ease;
}

.tool-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 20px;
    padding: 2px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color), var(--accent-color));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.tool-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px rgba(14, 165, 233, 0.25);
    border-color: transparent;
}

.tool-card:hover::before {
    transform: scaleX(1);
}

.tool-card:hover::after {
    opacity: 1;
}

.tool-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color), var(--accent-color));
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(14, 165, 233, 0.3);
}

.tool-card:hover .tool-icon {
    transform: scale(1.15) rotate(8deg);
    box-shadow: 0 8px 25px rgba(14, 165, 233, 0.5);
}

.tool-icon svg {
    width: 40px;
    height: 40px;
}

.tool-title {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-color);
}

.tool-desc {
    font-size: 14px;
    color: var(--text-light);
    line-height: 1.6;
}

/* 页面内容区域 */
.page-header {
    background: var(--card-bg);
    padding: 30px 40px;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 30px;
    text-align: center;
}

.page-title {
    font-size: 32px;
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 10px;
}

.page-subtitle {
    font-size: 16px;
    color: var(--text-light);
}

.content-card {
    background: var(--card-bg);
    padding: 40px;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 30px;
}

/* 表单样式 */
.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.15);
}

.btn {
    padding: 14px 32px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color), var(--accent-color));
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(14, 165, 233, 0.3);
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(14, 165, 233, 0.5);
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* 结果显示 */
.result-box {
    background: #f3f4f6;
    padding: 20px;
    border-radius: 10px;
    margin-top: 20px;
    display: none;
}

.result-box.show {
    display: block;
    animation: fadeInUp 0.5s ease;
}

.result-item {
    padding: 12px 0;
    border-bottom: 1px solid #e5e7eb;
}

.result-item:last-child {
    border-bottom: none;
}

.result-label {
    font-weight: 600;
    color: var(--text-color);
    margin-right: 10px;
}

.result-value {
    color: var(--text-light);
}

/* 加载状态 */
.loading {
    text-align: center;
    padding: 20px;
    color: var(--text-light);
}

.loading::after {
    content: '...';
    animation: dots 1.5s infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

/* 错误提示 */
.error-box {
    background: #fef2f2;
    border: 2px solid #ef4444;
    color: #dc2626;
    padding: 16px;
    border-radius: 10px;
    margin-top: 20px;
    display: none;
}

.error-box.show {
    display: block;
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

/* 底部 */
.footer {
    background: var(--card-bg);
    padding: 30px 40px;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    margin-top: 60px;
    text-align: center;
}

.footer-content p {
    color: var(--text-light);
    font-size: 14px;
    margin: 8px 0;
}

.beian-link {
    color: var(--text-light);
    text-decoration: none;
    transition: color 0.3s ease;
}

.beian-link:hover {
    color: var(--primary-color);
}

/* 动画 */
.fade-in {
    animation: fadeIn 1s ease;
}

.slide-up {
    animation: slideUp 0.6s ease backwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 响应式 */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 20px;
        padding: 20px;
    }

    .welcome-title {
        font-size: 32px;
    }

    .welcome-subtitle {
        font-size: 16px;
    }

    .tools-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .content-card {
        padding: 24px;
    }
}
