/* ===================================================
   次元口袋（实用工具箱） — 页面美化与对齐增强样式
   =================================================== */

:root {
    --nav-h: 60px;
    --bg: #f8fafc;
    --card: #ffffff;
    --border: #e2e8f0;
    --border-hover: #cbd5e1;
    --text: #0f172a;
    --text-muted: #64748b;
    --primary: #6366f1;
    --primary-light: #eef2ff;
    --primary-dark: #4338ca;
    --radius-md: 10px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.01);
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== 页面骨架 ===== */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
    background-color: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

.toolkit-main {
    flex: 1 0 auto;
    padding-top: var(--nav-h);
    display: flex;
    flex-direction: column;
}

/* ===== 顶栏 ===== */
.toolkit-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: var(--nav-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    box-sizing: border-box;
}

.toolkit-topbar .back-home {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    transition: color var(--transition);
}

.toolkit-topbar .back-home:hover {
    color: var(--primary);
}

.toolkit-topbar .back-home svg {
    width: 18px;
    height: 18px;
}

.toolkit-topbar .topbar-brand {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: .02em;
}

.toolkit-topbar .topbar-brand .accent {
    color: var(--primary);
    margin-right: 2px;
}

/* ===== Hero 区域 ===== */
.toolkit-hero {
    text-align: center;
    padding: 56px 24px 36px;
}

.toolkit-hero .hero-icon {
    font-size: 48px;
    line-height: 1;
    margin-bottom: 16px;
    display: inline-block;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.06));
}

.toolkit-hero h1 {
    font-size: clamp(1.75rem, 3.5vw, 2.25rem);
    font-weight: 700;
    color: var(--text);
    margin: 0 0 10px 0;
    letter-spacing: -0.02em;
}

.toolkit-hero p {
    font-size: 15px;
    color: var(--text-muted);
    max-width: 520px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ===== 网格容器 ===== */
.tool-grid-wrapper {
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    padding: 0 24px 60px;
    box-sizing: border-box;
}

.tool-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}

/* ===== 工具卡片通用样式 ===== */
.tool-card {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 24px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    color: inherit;
    text-decoration: none;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
    box-sizing: border-box;
}

a.tool-card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}

/* 不可用/未上线卡片 */
.tool-card.is-disabled {
    opacity: 0.65;
    background: rgba(255, 255, 255, 0.6);
    cursor: not-allowed;
    user-select: none;
}

.tool-card.is-disabled .arrow {
    color: #cbd5e1;
}

/* ===== 卡片头部 ===== */
.tool-card-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 12px;
}

/* 图标基础样式 */
.tool-card-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    line-height: 1;
    background: #f1f5f9;
}

.tool-card-icon.ezbot {
    background: #f3e8ff;
    color: #9333ea;
}

.tool-card-icon.coming {
    background: #f1f5f9;
    color: #94a3b8;
}

/* 图片类型图标 */
.tool-card-icon.has-img {
    padding: 0;
    overflow: hidden;
    background: #1e293b;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.tool-card-icon.has-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* 卡片头部信息 */
.tool-card-info {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tool-card h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 标签样式 */
.tool-tag {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0.03em;
    background: var(--primary-light);
    color: var(--primary-dark);
}

.tool-tag.soon {
    background: #f1f5f9;
    color: #64748b;
}

/* ===== 卡片描述 ===== */
.tool-card p {
    margin: 0 0 16px 0;
    flex: 1;
    font-size: 13.5px;
    color: var(--text-muted);
    line-height: 1.6;
}

/* ===== 卡片底栏 ===== */
.tool-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 14px;
    border-top: 1px solid #f1f5f9;
    font-size: 12px;
    color: var(--text-muted);
}

.tool-card-footer .footer-text {
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tool-card-footer .arrow {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    color: var(--primary);
    transition: transform var(--transition);
}

.tool-card-footer .arrow svg {
    width: 16px;
    height: 16px;
}

a.tool-card:hover .tool-card-footer .arrow {
    transform: translateX(4px);
}

/* ===== 无脚本提示 ===== */
.tool-noscript {
    max-width: 960px;
    margin: 0 auto;
    padding: 24px;
    text-align: center;
    font-size: 14px;
    color: var(--text-muted);
}

/* ===== 响应式适配 ===== */
@media (max-width: 768px) {
    .toolkit-topbar {
        padding: 0 16px;
    }

    .toolkit-hero {
        padding: 40px 16px 28px;
    }

    .tool-grid-wrapper {
        padding: 0 16px 40px;
    }

    .tool-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .tool-card {
        padding: 20px;
    }
}