/* ========== 语言切换器 ========== */
.lang-switcher {
    position: absolute;
    top: 16px;
    right: 24px;
}

.lang-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #fff;
    font-size: 0.9rem;
    padding: 6px 14px;
    border-radius: 8px;
    background: rgba(255,255,255,0.15);
    transition: background 0.2s;
    white-space: nowrap;
}

.lang-link:hover {
    background: rgba(255,255,255,0.25);
}

/* 移动端语言切换器 */
@media (max-width: 640px) {
    header {
        position: relative;
        padding: 20px 0 16px;
    }
    .lang-switcher {
        position: static;
        text-align: center;
        margin-top: 12px;
    }
    .lang-link {
        display: inline-flex;
        font-size: 0.85rem;
        padding: 5px 12px;
    }
}

/* ========== 全局重置 & 基础 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: #f0f2f5;
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { text-decoration: none; color: inherit; }

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ========== 头部 ========== */
header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    text-align: center;
    padding: 40px 0 30px;
    position: relative;
}

.logo a {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.logo-icon { font-size: 2.5rem; }

.logo-text {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: 1px;
}

.subtitle {
    margin-top: 8px;
    font-size: 1rem;
    opacity: 0.9;
    letter-spacing: 4px;
}

/* ========== 工具卡片网格 ========== */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    padding: 40px 0;
}

.tool-card {
    background: #fff;
    border-radius: 16px;
    padding: 28px 24px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.tool-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.10);
}

.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0;
    transition: opacity 0.2s;
}

.tool-card:hover::before { opacity: 1; }

.tool-icon {
    font-size: 2.2rem;
    margin-bottom: 12px;
}

.tool-card h2 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: #222;
}

.tool-card p {
    font-size: 0.9rem;
    color: #666;
    flex: 1;
    margin-bottom: 12px;
}

.tool-tag {
    display: inline-block;
    background: #e8f5e9;
    color: #2e7d32;
    font-size: 0.75rem;
    padding: 2px 10px;
    border-radius: 10px;
    align-self: flex-start;
}

/* ========== 广告位 ========== */
.ad-placeholder {
    background: #fff;
    border: 2px dashed #ddd;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    color: #999;
    margin-bottom: 30px;
    font-size: 0.9rem;
}

/* ========== 介绍区 ========== */
.intro-section {
    background: #fff;
    border-radius: 16px;
    padding: 32px;
    margin-bottom: 40px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}

.intro-section h2 {
    font-size: 1.3rem;
    margin-bottom: 12px;
    color: #222;
}

.intro-section p {
    color: #555;
    margin-bottom: 8px;
}

/* ========== 页脚 ========== */
footer {
    background: #222;
    color: #aaa;
    text-align: center;
    padding: 24px 0;
    margin-top: auto;
    font-size: 0.85rem;
}

.footer-links {
    margin-bottom: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 0;
}

.footer-links a {
    color: #ccc;
    transition: color 0.2s;
    padding: 4px 0;
}

.footer-links a:hover {
    color: #fff;
    text-decoration: underline;
}

.footer-sep {
    margin: 0 10px;
    color: #555;
}

/* ========== 工具页面通用 ========== */
.tool-page {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    margin: 30px 0 40px;
    padding: 32px;
}

.tool-page h1 {
    font-size: 1.6rem;
    margin-bottom: 6px;
    color: #222;
}

.tool-page .tool-desc {
    color: #777;
    font-size: 0.95rem;
    margin-bottom: 24px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #667eea;
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.back-link:hover { text-decoration: underline; }

/* ========== 表单控件 ========== */
.form-group {
    margin-bottom: 20px;
}

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

.form-group textarea,
.form-group input[type="text"],
.form-group input[type="url"],
.form-group input[type="file"],
.form-group input[type="color"] {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid #d9d9d9;
    border-radius: 10px;
    font-size: 0.95rem;
    transition: border-color 0.2s;
    outline: none;
    font-family: inherit;
}

.form-group textarea:focus,
.form-group input[type="text"]:focus,
.form-group input[type="url"]:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102,126,234,0.12);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

/* ========== 按钮 ========== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 24px;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
}

.btn-primary:hover { opacity: 0.9; }

.btn-secondary {
    background: #f0f0f0;
    color: #444;
}

.btn-secondary:hover { background: #e0e0e0; }

.btn-success {
    background: #4caf50;
    color: #fff;
}

.btn-success:hover { background: #43a047; }

.btn-block {
    display: flex;
    width: 100%;
    justify-content: center;
}

.btn-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 16px;
}

/* ========== 结果输出 ========== */
.result-area {
    margin-top: 20px;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 1px solid #eee;
    min-height: 40px;
}

.result-area img {
    max-width: 100%;
    display: block;
}

.result-area textarea {
    width: 100%;
    border: none;
    background: transparent;
    resize: vertical;
    min-height: 60px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: #333;
    outline: none;
}

.help-section {
    margin-top: 20px;
    background: #f8f9fa;
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 14px 18px;
}
.help-section summary {
    cursor: pointer;
    font-weight: 600;
    color: #667eea;
    outline: none;
}
.help-section summary:hover {
    opacity: 0.8;
}

.error-message {
    color: #d32f2f;
    font-size: 0.9rem;
    margin-top: 6px;
}

.success-message {
    color: #2e7d32;
    font-size: 0.9rem;
    margin-top: 6px;
}

/* ========== 加载动画 ========== */
.loading {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid #e0e0e0;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ========== 独立页面（隐私/关于/联系） ========== */
.page-content {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    margin: 30px 0 40px;
    padding: 40px;
}

.page-content h1 {
    font-size: 1.8rem;
    margin-bottom: 8px;
    color: #222;
}

.page-content .last-updated {
    color: #999;
    font-size: 0.85rem;
    margin-bottom: 30px;
}

.page-content section {
    margin-bottom: 28px;
}

.page-content section h2 {
    font-size: 1.2rem;
    color: #444;
    margin-bottom: 12px;
    padding-bottom: 6px;
    border-bottom: 2px solid #f0f0f0;
}

.page-content section h3 {
    font-size: 1.05rem;
    color: #555;
    margin: 16px 0 8px;
}

.page-content p {
    color: #555;
    margin-bottom: 8px;
    line-height: 1.7;
}

.page-content ul {
    margin: 8px 0 12px 20px;
    color: #555;
}

.page-content ul li {
    margin-bottom: 4px;
    line-height: 1.6;
}

.page-content a {
    color: #667eea;
}

.page-content a:hover {
    text-decoration: underline;
}

/* ========== 联系方式卡片 ========== */
.contact-methods {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.contact-card {
    background: #f8f9fa;
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 24px;
    transition: box-shadow 0.2s;
}

.contact-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}

.contact-card h3 {
    font-size: 1.05rem;
    margin-bottom: 12px;
    color: #333;
    border-bottom: none !important;
    padding-bottom: 0 !important;
}

.contact-card p {
    color: #555;
    margin-bottom: 6px;
}

.contact-card ul {
    margin: 8px 0 8px 16px;
    color: #555;
}

.contact-link {
    font-size: 1.1rem;
    font-weight: 600;
    word-break: break-all;
}

.contact-note {
    font-size: 0.85rem;
    color: #999 !important;
    margin-top: 8px;
}

/* ========== FAQ ========== */
.faq-item {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f0f0f0;
}

.faq-item:last-child {
    border-bottom: none;
}

.faq-item h3 {
    font-size: 1rem;
    color: #444;
    margin-bottom: 6px;
    border-bottom: none !important;
    padding-bottom: 0 !important;
}

.faq-item p {
    color: #666;
    margin-bottom: 0;
}

/* ========== 响应式 ========== */
@media (max-width: 768px) {
    header { padding: 28px 0 20px; }
    .logo-text { font-size: 1.4rem; }
    .tools-grid { grid-template-columns: 1fr; gap: 16px; padding: 24px 0; }
    .tool-card { padding: 20px; }
    .tool-page { padding: 20px; margin: 16px 0 24px; }
    .tool-page h1 { font-size: 1.3rem; }
    .page-content { padding: 24px; margin: 16px 0 24px; }
    .page-content h1 { font-size: 1.4rem; }
    .contact-methods { grid-template-columns: 1fr; }
    .footer-sep { margin: 0 8px; }
}

@media (max-width: 480px) {
    .container { padding: 0 12px; }
    .tools-grid { padding: 16px 0; }
    .page-content { padding: 16px; }
}
