/* 全局变量与主题 */
:root {
    --background-color: #eef2ff;
    --surface-color: #ffffff;
    --surface-elevated-color: rgba(255, 255, 255, 0.92);
    --primary-color: #4f46e5;
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 40%, #22d3ee 100%);
    --primary-strong: #4338ca;
    --text-primary-color: #1f2937;
    --text-secondary-color: #4b5563;
    --text-tertiary-color: #6b7280;
    --border-color: rgba(79, 70, 229, 0.12);
    --divider-color: rgba(79, 70, 229, 0.08);
    --shadow-soft: 0 18px 40px rgba(79, 70, 229, 0.12);
    --shadow-floating: 0 30px 60px rgba(79, 70, 229, 0.2);
    --card-radius: 18px;
    --transition-base: 220ms ease;
    --chip-background: rgba(79, 70, 229, 0.08);
    --chip-active-background: rgba(79, 70, 229, 0.18);
    --chip-text-color: var(--primary-strong);
    --mark-background: rgba(79, 70, 229, 0.16);
}

[data-theme="dark"] {
    --background-color: #0f172a;
    --surface-color: rgba(15, 23, 42, 0.88);
    --surface-elevated-color: rgba(30, 41, 59, 0.88);
    --primary-color: #818cf8;
    --primary-gradient: linear-gradient(135deg, #4f46e5 0%, #22d3ee 100%);
    --primary-strong: #6366f1;
    --text-primary-color: #f8fafc;
    --text-secondary-color: #cbd5f5;
    --text-tertiary-color: #94a3b8;
    --border-color: rgba(148, 163, 184, 0.16);
    --divider-color: rgba(148, 163, 184, 0.1);
    --shadow-soft: 0 25px 45px rgba(14, 19, 35, 0.45);
    --shadow-floating: 0 30px 60px rgba(79, 70, 229, 0.32);
    --chip-background: rgba(129, 140, 248, 0.18);
    --chip-active-background: rgba(129, 140, 248, 0.28);
    --chip-text-color: #e0e7ff;
    --mark-background: rgba(129, 140, 248, 0.35);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    font-family: "Segoe UI", "HarmonyOS Sans", "PingFang SC", "Microsoft YaHei", sans-serif;
    background-color: var(--background-color);
    color: var(--text-primary-color);
    min-height: 100%;
}

body {
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color var(--transition-base), color var(--transition-base);
}

body::before,
body::after {
    content: "";
    position: fixed;
    width: 480px;
    height: 480px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.18) 0%, transparent 70%);
    z-index: -2;
    transition: opacity var(--transition-base);
}

body::before {
    top: -220px;
    right: -160px;
}

body::after {
    bottom: -240px;
    left: -120px;
}

a {
    color: inherit;
    text-decoration: none;
}

ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

img {
    max-width: 100%;
}

.page-shell {
    max-width: 1280px;
    margin: 0 auto;
    padding: 36px 28px 80px;
    position: relative;
}

.page-shell::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: calc(var(--card-radius) + 26px);
    background: rgba(255, 255, 255, 0.65);
    box-shadow: 0 25px 60px rgba(79, 70, 229, 0.12);
    backdrop-filter: blur(18px);
    z-index: -1;
}

/* 顶部导航 */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--surface-elevated-color);
    box-shadow: var(--shadow-soft);
    border-radius: calc(var(--card-radius) + 4px);
    border: 1px solid var(--border-color);
    padding: 22px 28px;
    /* position: sticky; */
    top: 24px;
    z-index: 20;
    backdrop-filter: blur(22px);
}

.brand {
    display: flex;
    align-items: center;
    gap: 16px;
}

.brand-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    border-radius: 16px;
    background: var(--primary-gradient);
    color: #ffffff;
    font-size: 1.6rem;
    box-shadow: var(--shadow-floating);
}

.brand-text h1 {
    font-size: 1.7rem;
    font-weight: 700;
    margin: 0;
}

.brand-text p {
    margin: 4px 0 0;
    color: var(--text-tertiary-color);
    font-size: 0.95rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 18px;
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: var(--surface-color);
    color: var(--text-secondary-color);
    font-size: 0.95rem;
    cursor: pointer;
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.theme-toggle:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-soft);
}

.theme-toggle span {
    font-size: 1.1rem;
}

.primary-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 22px;
    border-radius: 999px;
    background: var(--primary-gradient);
    color: #ffffff;
    font-weight: 600;
    box-shadow: var(--shadow-floating);
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.primary-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 22px 45px rgba(79, 70, 229, 0.28);
}

/* 头图区域 */
.hero {
    margin-top: 42px;
    padding: 48px;
    border-radius: calc(var(--card-radius) + 2px);
    background: var(--primary-gradient);
    color: #ffffff;
    box-shadow: var(--shadow-floating);
    position: relative;
    overflow: hidden;
}

.hero::after {
    content: "";
    position: absolute;
    inset: -60px -160px auto auto;
    width: 360px;
    height: 360px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.28) 0%, transparent 65%);
    transform: rotate(-15deg);
    pointer-events: none;
}

.hero h2 {
    font-size: 2.8rem;
    font-weight: 700;
    text-align: center;
    margin: 0 auto 16px;
    max-width: 1000px;
    line-height: 1.25;
}

.hero p {
    margin: 0 auto;
    text-align: center;
    max-width: 1000px;
    font-size: 1.08rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.86);
}

.hero-actions {
    margin-top: 32px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.hero-actions .action-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    color: #ffffff;
    font-size: 0.95rem;
    border: 1px solid rgba(255, 255, 255, 0.24);
    backdrop-filter: blur(10px);
}

.hero-actions .action-chip span {
    font-size: 1.2rem;
}

/* 快速搜索和统计 */
.utility-bar {
    margin-top: 36px;
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
}

.search-input {
    flex: 1 1 340px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: var(--surface-elevated-color);
    border-radius: var(--card-radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-soft);
    transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.search-input:focus-within {
    border-color: rgba(79, 70, 229, 0.5);
    box-shadow: 0 18px 38px rgba(79, 70, 229, 0.18);
}

.search-input input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1.05rem;
    background: transparent;
    color: var(--text-primary-color);
}

.search-input span {
    font-size: 1.2rem;
    color: var(--text-tertiary-color);
}

.stats-card {
    flex: 1 1 240px;
    background: var(--surface-elevated-color);
    border-radius: var(--card-radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-soft);
    padding: 18px 24px;
    display: flex;
    align-items: center;
    gap: 18px;
}

.search-helpers {
    margin-top: 22px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.search-summary {
    margin: 0;
    color: var(--text-secondary-color);
    font-size: 0.98rem;
}

.filter-chips {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border-radius: 999px;
    border: 1px solid transparent;
    background: var(--chip-background);
    color: var(--chip-text-color);
    font-size: 0.92rem;
    font-weight: 500;
    cursor: pointer;
    transition: transform var(--transition-base), box-shadow var(--transition-base), background var(--transition-base), border-color var(--transition-base);
}

.filter-chip:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(79, 70, 229, 0.15);
}

.filter-chip.is-active {
    background: var(--chip-active-background);
    border-color: rgba(79, 70, 229, 0.35);
    box-shadow: 0 12px 24px rgba(79, 70, 229, 0.16);
}

.stats-card span {
    display: inline-flex;
    width: 42px;
    height: 42px;
    border-radius: 14px;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    background: rgba(79, 70, 229, 0.12);
    color: var(--primary-strong);
}

.stats-card strong {
    font-size: 1.6rem;
    display: block;
}

.stats-card p {
    margin: 0;
    color: var(--text-secondary-color);
    font-size: 0.95rem;
}

/* 工具分区与卡片 */
.tool-section {
    margin-top: 54px;
}

.section-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 16px;
}

.section-header h3 {
    margin: 0;
    font-size: 1.8rem;
}

.section-header p {
    margin: 6px 0 0;
    color: var(--text-tertiary-color);
    max-width: 520px;
}

.section-header .section-meta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(79, 70, 229, 0.12);
    color: var(--primary-strong);
    font-size: 0.9rem;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.tool-card {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 26px 26px 24px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(245, 247, 255, 0.92) 100%);
    border-radius: var(--card-radius);
    transition: transform var(--transition-base), box-shadow var(--transition-base), border var(--transition-base);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.tool-card:hover {
    transform: translateY(-6px);
    border-color: rgba(79, 70, 229, 0.35);
    box-shadow: 0 20px 45px rgba(79, 70, 229, 0.18);
}

.tool-card::after {
    content: attr(data-badge);
    position: absolute;
    top: 18px;
    right: 18px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(79, 70, 229, 0.16);
    color: var(--primary-strong);
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity var(--transition-base), transform var(--transition-base);
}

.tool-card[data-badge]:hover::after {
    opacity: 1;
    transform: translateY(0);
}

.tool-card-header {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.tool-icon {
    display: inline-flex;
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: rgba(79, 70, 229, 0.14);
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: var(--primary-strong);
}

.tool-card h4 {
    margin: 0;
    font-size: 1.26rem;
    font-weight: 600;
}

.tool-card p {
    margin: 8px 0 0;
    color: var(--text-secondary-color);
    font-size: 0.98rem;
}

.tool-features {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tool-features li {
    display: inline-flex;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(79, 70, 229, 0.1);
    color: var(--primary-strong);
    font-size: 0.85rem;
    font-weight: 500;
}

mark {
    background: var(--mark-background);
    color: inherit;
    padding: 0 2px;
    border-radius: 4px;
}

/* 页脚 */
.page-footer {
    margin-top: 68px;
    padding: 42px;
    border-radius: calc(var(--card-radius) + 2px);
    background: var(--surface-elevated-color);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-soft);
    color: var(--text-secondary-color);
}

.page-footer h2 {
    margin: 0 0 16px;
    color: var(--text-primary-color);
    font-size: 1.4rem;
}

.page-footer p {
    margin: 14px 0;
    line-height: 1.8;
}

.page-footer hr {
    border: none;
    border-top: 1px solid var(--divider-color);
    margin: 24px 0;
}

.page-footer small {
    color: var(--text-tertiary-color);
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-tertiary-color);
    display: none;
}

.empty-state.active {
    display: block;
}

/* 响应式 */
@media (max-width: 1024px) {
    .app-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 24px;
    }

    .header-actions {
        width: 100%;
        justify-content: space-between;
    }

    .hero {
        padding: 40px 32px;
    }

    .hero h2 {
        font-size: 2.4rem;
    }

    .search-helpers {
        align-items: flex-start;
    }
}

@media (max-width: 768px) {
    .page-shell {
        padding: 20px 16px 60px;
    }

    .hero {
        padding: 32px 24px;
    }

    .hero h2 {
        font-size: 2rem;
    }

    .utility-bar {
        flex-direction: column;
    }

    .search-input,
    .stats-card {
        width: 100%;
    }

    .card-grid {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    }

    .tool-card {
        padding: 24px 22px;
    }
}

@media (max-width: 520px) {
    .brand {
        gap: 12px;
    }

    .brand-logo {
        width: 48px;
        height: 48px;
        font-size: 1.4rem;
    }

    .brand-text h1 {
        font-size: 1.4rem;
    }

    .hero-actions {
        flex-direction: column;
        align-items: flex-start;
    }

    .hero-actions .action-chip,
    .primary-link,
    .theme-toggle {
        width: 100%;
        justify-content: center;
    }

    .search-helpers {
        flex-direction: column;
        align-items: flex-start;
    }

    .search-summary {
        width: 100%;
    }
}

