/* 工具页面样式 */

/* 容器 */
.tools-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 16px 0;
}

/* 页面头部 */
.page-header {
    text-align: center;
    margin-bottom: 24px;
}

.page-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-color);
    margin: 0 0 6px 0;
    background: linear-gradient(135deg, var(--primary-color) 20%, var(--secondary-color) 80%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-subtitle {
    font-size: 13px;
    color: var(--text-tertiary);
    margin: 0;
}

/* 工具卡片网格 */
.tools-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ================== 工具卡片 ================== */
.tool-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: var(--card-background);
    border-radius: var(--radius-md);
    box-shadow: 0 2px 10px var(--shadow-color);
    border: 1px solid var(--border-color);
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    position: relative;
    overflow: hidden;
}

/* 左侧装饰条 */
.tool-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    border-radius: 4px 0 0 4px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tool-card:nth-child(1)::before {
    background: linear-gradient(180deg, #5BA3C5, #7ABBD7);
}

.tool-card:nth-child(2)::before {
    background: linear-gradient(180deg, #F4C467, #FFD489);
}

.tool-card:nth-child(3)::before {
    background: linear-gradient(180deg, #06b6d4, #22d3ee);
}

.tool-card:nth-child(4)::before {
    background: linear-gradient(180deg, #A78BFA, #C4B5FD);
}

.tool-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px var(--shadow-hover);
    border-color: transparent;
}

.tool-card:hover::before {
    opacity: 1;
}

.tool-card:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px var(--shadow-color);
}

/* 工具图标 */
.tool-icon {
    width: 48px;
    height: 48px;
    border-radius: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

.tool-icon svg {
    width: 24px;
    height: 24px;
    fill: white;
}

.tool-icon-blue {
    background: linear-gradient(145deg, #5BA3C5, #7ABBD7);
    box-shadow: 0 3px 12px rgba(91, 163, 197, 0.3);
}

.tool-icon-gold {
    background: linear-gradient(145deg, #F4C467, #FFCE70);
    box-shadow: 0 3px 12px rgba(244, 196, 103, 0.3);
}

.tool-icon-cyan {
    background: linear-gradient(145deg, #06b6d4, #22d3ee);
    box-shadow: 0 3px 12px rgba(6, 182, 212, 0.3);
}

.tool-icon-purple {
    background: linear-gradient(145deg, #A78BFA, #C4B5FD);
    box-shadow: 0 3px 12px rgba(167, 139, 250, 0.3);
}

.tool-card:hover .tool-icon {
    transform: scale(1.06);
}

/* 工具内容 */
.tool-content {
    flex: 1;
    min-width: 0;
}

.tool-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color);
    margin: 0 0 3px 0;
}

.tool-desc {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 工具操作区域 */
.tool-action {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}

.action-text {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-tertiary);
    white-space: nowrap;
    transition: color 0.25s ease;
}

.action-arrow {
    width: 16px;
    height: 16px;
    fill: var(--text-tertiary);
    transition: all 0.25s ease;
    opacity: 0;
}

.tool-card:hover .action-text {
    color: var(--primary-color);
}

.tool-card:hover .action-arrow {
    fill: var(--primary-color);
    transform: translateX(3px);
    opacity: 1;
}

/* ================== 深色模式 ================== */
@media (prefers-color-scheme: dark) {
    .tool-card {
        background: var(--card-background);
        border-color: var(--border-color);
    }
    
    .tool-card:hover {
        border-color: rgba(107, 175, 209, 0.25);
    }
    
    .tool-icon-blue {
        background: linear-gradient(145deg, #5A9ABD, #73B5D3);
    }
    
    .tool-icon-gold {
        background: linear-gradient(145deg, #E8B85A, #F4C467);
    }
    
    .tool-icon-purple {
        background: linear-gradient(145deg, #9B7EF0, #B89BFA);
    }

    .tool-icon-cyan {
        background: linear-gradient(145deg, #0EA5C9, #38BFD8);
    }
}

/* ================== 响应式设计 ================== */

/* 平板及以上 */
@media (min-width: 600px) {
    .tools-container {
        padding: 24px 0;
    }
    
    .page-header {
        margin-bottom: 28px;
    }
    
    .page-title {
        font-size: 26px;
    }
    
    .page-subtitle {
        font-size: 14px;
    }
    
    .tools-grid {
        gap: 12px;
    }
    
    .tool-card {
        padding: 18px 20px;
        gap: 16px;
    }
    
    .tool-icon {
        width: 54px;
        height: 54px;
    }
    
    .tool-icon svg {
        width: 26px;
        height: 26px;
    }
    
    .tool-title {
        font-size: 17px;
        margin-bottom: 4px;
    }
    
    .tool-desc {
        font-size: 13px;
    }
    
    .action-text {
        font-size: 13px;
    }
}

/* 桌面端 - 网格布局 */
@media (min-width: 768px) {
    .tools-container {
        padding: 32px 0;
    }
    
    .page-header {
        margin-bottom: 36px;
    }
    
    .page-title {
        font-size: 28px;
    }
    
    .tools-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }
    
    .tool-card {
        flex-direction: column;
        text-align: center;
        padding: 28px 20px 22px;
        gap: 0;
    }
    
    /* 桌面端装饰条改为顶部 */
    .tool-card::before {
        left: 0;
        right: 0;
        top: 0;
        bottom: auto;
        width: auto;
        height: 3px;
        border-radius: var(--radius-md) var(--radius-md) 0 0;
    }
    
    .tool-icon {
        width: 64px;
        height: 64px;
        border-radius: 16px;
        margin-bottom: 16px;
    }
    
    .tool-icon svg {
        width: 30px;
        height: 30px;
    }
    
    .tool-content {
        margin-bottom: 16px;
    }
    
    .tool-title {
        font-size: 18px;
        margin-bottom: 6px;
    }
    
    .tool-desc {
        font-size: 13px;
        -webkit-line-clamp: 3;
    }
    
    .tool-action {
        width: 100%;
        justify-content: center;
        padding: 10px 14px;
        background: var(--background-secondary);
        border: 1px solid var(--border-color);
        border-radius: var(--radius-sm);
        transition: all 0.25s ease;
    }
    
    .tool-card:hover .tool-action {
        background: var(--primary-pale);
        border-color: transparent;
    }
    
    .action-arrow {
        opacity: 0;
    }
    
    .tool-card:hover .action-arrow {
        opacity: 1;
    }
}

/* 大屏幕 */
@media (min-width: 1024px) {
    .tools-grid {
        gap: 16px;
    }
    
    .tool-card {
        padding: 32px 24px 24px;
        border-radius: var(--radius-lg);
    }
    
    .tool-icon {
        width: 72px;
        height: 72px;
        border-radius: 18px;
        margin-bottom: 20px;
    }
    
    .tool-icon svg {
        width: 34px;
        height: 34px;
    }
    
    .tool-title {
        font-size: 19px;
    }
    
    .tool-desc {
        font-size: 14px;
    }
}

/* ================== 触摸设备优化 ================== */
@media (hover: none) {
    .tool-card:hover {
        transform: none;
        box-shadow: 0 2px 10px var(--shadow-color);
        border-color: var(--border-color);
    }
    
    .tool-card:hover::before {
        opacity: 0;
    }
    
    .tool-card:hover .tool-icon {
        transform: none;
    }
    
    .tool-card:hover .action-arrow {
        transform: none;
        opacity: 0;
    }
    
    .tool-card:hover .action-text {
        color: var(--text-tertiary);
    }
    
    .tool-card:active {
        transform: scale(0.98);
        background: var(--background-secondary);
    }
    
    @media (min-width: 768px) {
        .tool-card:hover .tool-action {
            background: var(--background-secondary);
            border-color: var(--border-color);
        }
    }
}