/* ===== CSS Variables ===== */
:root {
    --color-primary: #FF7FAA;
    --color-primary-dark: #E85A8A;
    --color-primary-light: #FFA8C4;
    --color-secondary-purple: #E8B4F8;
    --color-secondary-green: #87E8C6;
    --color-warning: #FF6B6B;
    --color-success: #4CAF50;
    --color-text: #333333;
    --color-text-light: #666666;
    --color-text-muted: #999999;
    --color-bg: #FFF9FB;
    --color-bg-light: #FFFFFF;
    --color-card: #FFFFFF;
    --color-border: #F0E0E8;
    --shadow-sm: 0 2px 8px rgba(255, 127, 170, 0.1);
    --shadow-md: 0 4px 16px rgba(255, 127, 170, 0.15);
    --shadow-lg: 0 8px 32px rgba(255, 127, 170, 0.2);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--color-primary-dark);
}

img {
    max-width: 100%;
    height: auto;
}

ul, ol {
    list-style: none;
}

/* ===== Layout ===== */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.main-content {
    flex: 1;
    padding: 20px 0 40px;
}

/* ===== Navbar ===== */
.navbar {
    background: var(--color-bg-light);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    height: 60px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-text);
}

.logo-emoji {
    font-size: 1.5rem;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.hamburger {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--color-text);
    position: relative;
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 2px;
    background: var(--color-text);
    left: 0;
}

.hamburger::before {
    top: -6px;
}

.hamburger::after {
    bottom: -6px;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-item {
    position: relative;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    color: var(--color-text);
    font-size: 0.95rem;
    border-radius: var(--radius-sm);
    transition: background 0.2s;
}

.nav-link:hover {
    background: var(--color-bg);
    color: var(--color-primary);
}

.nav-item.active > .nav-link {
    color: var(--color-primary);
}

.nav-emoji {
    font-size: 1.1rem;
}

.dropdown-arrow {
    transition: transform 0.2s;
}

.nav-item:hover .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--color-bg-light);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    min-width: 180px;
    padding: 8px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s;
}

.nav-item:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-link {
    display: block;
    padding: 10px 16px;
    color: var(--color-text);
    font-size: 0.9rem;
}

.dropdown-link:hover {
    background: var(--color-bg);
    color: var(--color-primary);
}

.dropdown-link.active {
    color: var(--color-primary);
    background: rgba(255, 127, 170, 0.1);
}

/* ===== Hero Section ===== */
.hero {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
    padding: 60px 0;
    margin-bottom: 40px;
}

.hero-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    text-align: center;
}

.hero-content {
    color: white;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.hero-emoji {
    font-size: 3rem;
    display: block;
    margin-bottom: 8px;
}

.hero-slogan {
    font-size: 1.2rem;
    opacity: 0.95;
    margin-bottom: 24px;
}

.hero-features {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 32px;
}

.feature-tag {
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
}

.hero-cta {
    display: inline-block;
    background: white;
    color: var(--color-primary);
    padding: 14px 32px;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
}

.hero-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    color: var(--color-primary-dark);
}

/* ===== Section Styles ===== */
.section {
    padding: 40px 0;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 24px;
    text-align: center;
}

/* ===== Tools Grid ===== */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.tool-card {
    background: var(--color-card);
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
    display: block;
    color: var(--color-text);
}

.tool-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    color: var(--color-text);
}

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

.tool-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.tool-desc {
    font-size: 0.9rem;
    color: var(--color-text-light);
}

/* ===== Category Block ===== */
.category-block {
    margin-bottom: 32px;
}

.category-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.category-logo {
    font-size: 1.4rem;
}

.tools-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tool-item {
    display: flex;
    align-items: center;
    padding: 16px;
    background: var(--color-card);
    border-radius: var(--radius-sm);
    transition: background 0.2s;
    color: var(--color-text);
}

.tool-item:hover {
    background: var(--color-bg);
    color: var(--color-text);
}

.tool-item-name {
    font-weight: 500;
    min-width: 140px;
}

.tool-item-desc {
    flex: 1;
    color: var(--color-text-light);
    font-size: 0.9rem;
}

.tool-item-arrow {
    color: var(--color-primary);
    font-size: 1.2rem;
}

/* ===== Features Grid ===== */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
}

.feature-card {
    background: var(--color-card);
    border-radius: var(--radius-md);
    padding: 24px;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.feature-card .feature-icon {
    font-size: 2.5rem;
    margin-bottom: 16px;
}

.feature-card h3 {
    font-size: 1.1rem;
    margin-bottom: 12px;
}

.feature-card p {
    font-size: 0.9rem;
    color: var(--color-text-light);
}

/* ===== FAQ Section ===== */
.faq-list {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    background: var(--color-card);
    border-radius: var(--radius-md);
    padding: 20px 24px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
}

.faq-question {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.faq-answer {
    font-size: 0.9rem;
    color: var(--color-text-light);
    line-height: 1.7;
}

/* ===== Footer ===== */
.footer {
    background: var(--color-text);
    color: white;
    padding: 48px 0 24px;
    margin-top: auto;
}

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

.footer-main {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    margin-bottom: 32px;
}

.footer-brand {
    flex: 1;
    min-width: 220px;
    max-width: 280px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.footer-slogan {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-bottom: 16px;
}

.footer-contact {
    margin-top: 16px;
}

.footer-contact p {
    font-size: 0.85rem;
    opacity: 0.8;
    margin-bottom: 8px;
}

.footer-contact a {
    color: rgba(255, 255, 255, 0.9);
}

.footer-contact a:hover {
    color: var(--color-primary-light);
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 32px;
    flex: 2;
}

.footer-section {
    min-width: 120px;
}

.footer-section h4 {
    font-size: 0.95rem;
    margin-bottom: 16px;
    font-weight: 600;
}

.footer-section ul {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-section a {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    transition: color 0.2s;
}

.footer-section a:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 24px;
    text-align: center;
}

.footer-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

.privacy-note {
    font-size: 0.85rem;
    opacity: 0.9;
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 16px;
    border-radius: 20px;
    display: inline-block;
}

.copyright {
    font-size: 0.85rem;
    opacity: 0.7;
}

.icp {
    font-size: 0.8rem;
    opacity: 0.6;
    margin-top: 4px;
}

.icp a {
    color: rgba(255, 255, 255, 0.6);
}

.icp a:hover {
    color: white;
}

/* ===== Static Pages ===== */
.static-page {
    max-width: 800px;
    margin: 0 auto;
}

.page-title {
    font-size: 2rem;
    text-align: center;
    margin-bottom: 32px;
}

.page-content {
    background: var(--color-card);
    border-radius: var(--radius-md);
    padding: 32px;
    box-shadow: var(--shadow-sm);
}

.content-section {
    margin-bottom: 24px;
}

.content-section:last-child {
    margin-bottom: 0;
}

.content-section h2 {
    font-size: 1.2rem;
    margin-bottom: 12px;
    color: var(--color-primary);
}

.content-section p {
    margin-bottom: 12px;
    line-height: 1.8;
}

.content-section ul {
    padding-left: 20px;
    list-style: disc;
}

.content-section li {
    margin-bottom: 8px;
    line-height: 1.7;
}

.highlight-box {
    background: rgba(255, 127, 170, 0.1);
    border-left: 4px solid var(--color-primary);
    padding: 16px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    margin-bottom: 16px;
}

/* ===== Error Page ===== */
.error-page {
    text-align: center;
    padding: 80px 20px;
}

.error-icon {
    font-size: 4rem;
    margin-bottom: 16px;
}

.error-title {
    font-size: 4rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 16px;
}

.error-desc {
    font-size: 1.2rem;
    color: var(--color-text-light);
    margin-bottom: 32px;
}

.error-btn {
    display: inline-block;
    background: var(--color-primary);
    color: white;
    padding: 12px 32px;
    border-radius: 30px;
    font-weight: 500;
    transition: background 0.2s;
}

.error-btn:hover {
    background: var(--color-primary-dark);
    color: white;
}

/* ===== Privacy Notice ===== */
.privacy-notice {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(255, 127, 170, 0.1);
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    margin-top: 32px;
    font-size: 0.9rem;
    color: var(--color-text-light);
}

.privacy-icon {
    font-size: 1.2rem;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .nav-toggle {
        display: block;
    }

    .nav-menu {
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        background: var(--color-bg-light);
        flex-direction: column;
        padding: 20px;
        box-shadow: var(--shadow-md);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s;
    }

    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .nav-item {
        width: 100%;
    }

    .nav-link {
        width: 100%;
        justify-content: space-between;
    }

    .dropdown-menu {
        position: static;
        box-shadow: none;
        opacity: 1;
        visibility: visible;
        transform: none;
        display: none;
        padding-left: 20px;
    }

    .nav-item.active .dropdown-menu {
        display: block;
    }

    .hero-title {
        font-size: 1.8rem;
    }

    .hero-emoji {
        font-size: 2.5rem;
    }

    .hero-features {
        gap: 8px;
    }

    .feature-tag {
        font-size: 0.8rem;
        padding: 6px 12px;
    }

    .footer-main {
        flex-direction: column;
        gap: 24px;
    }

    .footer-links {
        flex-direction: column;
        gap: 24px;
    }

    .tool-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .tool-item-name {
        min-width: auto;
    }
}

/* ===== Toast 提示 ===== */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(51, 51, 51, 0.9);
    color: white;
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 0.9rem;
    z-index: 10000;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* ===== 收藏按钮 ===== */
.favorite-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    border: 1px solid var(--color-border);
    border-radius: 20px;
    background: var(--color-card);
    color: var(--color-text-light);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.favorite-btn:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.favorite-btn.favorited {
    border-color: var(--color-primary);
    background: rgba(255, 127, 170, 0.1);
    color: var(--color-primary);
}

/* ===== 加载动画 ===== */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--color-border);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ===== 骨架屏 ===== */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--radius-sm);
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* ===== PWA 安装提示 ===== */
.pwa-install-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--color-card);
    padding: 16px 20px;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    z-index: 9999;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.pwa-install-banner.show {
    transform: translateY(0);
}

.pwa-install-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pwa-install-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
}

.pwa-install-text h4 {
    font-size: 1rem;
    margin-bottom: 4px;
}

.pwa-install-text p {
    font-size: 0.85rem;
    color: var(--color-text-light);
}

.pwa-install-actions {
    display: flex;
    gap: 8px;
}

.pwa-install-btn {
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    border: none;
}

.pwa-install-btn.primary {
    background: var(--color-primary);
    color: white;
}

.pwa-install-btn.secondary {
    background: transparent;
    color: var(--color-text-light);
}

/* ===== 图片懒加载 ===== */
img[data-src] {
    opacity: 0;
    transition: opacity 0.3s;
}

img[data-src].loaded {
    opacity: 1;
}

/* ===== 打印样式 ===== */
@media print {
    .navbar,
    .footer,
    .favorite-btn,
    .pwa-install-banner {
        display: none !important;
    }

    body {
        background: white;
    }

    .tool-card,
    .page-content {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
