/* ========================================
   KeyGoto 工具页面专属样式
   仅用于工具操作区：按钮、输入框、卡片、状态栏等
   头部统一样式已移至 style.css
   ======================================== */

/* ---------- 页面容器 ---------- */
.tool-page {
    width: 100%;
    min-height: 100%;
    padding: 1.5rem 1.5rem 2rem;
}

@media (min-width: 1440px) {
    .tool-page {
        padding: 1.5rem 2rem 2rem;
    }
}

@media (min-width: 1920px) {
    .tool-page {
        max-width: 1600px;
        margin: 0 auto;
        padding: 1.5rem 2rem 2rem;
    }
}

/* ---------- 主操作卡片 ---------- */
.tool-root {
    background: #FFFFFF;
    border-radius: 20px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03), 0 1px 1px rgba(0, 0, 0, 0.02);
    padding: 1.75rem;
    margin-bottom: 2rem;
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #EFF0F2;
    transition: box-shadow 0.2s ease;
}

.tool-root:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03), 0 1px 1px rgba(0, 0, 0, 0.02);
}

/* ---------- 状态消息 ---------- */
.status-message {
    text-align: center;
    font-size: 0.8125rem;
    color: #6B7280;
    margin-top: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 40px;
    background: #F9FAFB;
    display: inline-block;
    width: auto;
    font-weight: 400;
}

.status-message.success {
    background: #ECFDF5;
    color: #059669;
}

.status-message.error {
    background: #FEF2F2;
    color: #DC2626;
}

.status-message.warning {
    background: #FFFBEB;
    color: #D97706;
}

/* ---------- 按钮 ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    border-radius: 40px;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    font-size: 0.875rem;
    line-height: 1.5;
}

.btn-primary {
    background: #111827;
    color: white;
    box-shadow: none;
}

.btn-primary:hover {
    background: #1F2937;
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-outline {
    background: transparent;
    border: 1px solid #E5E7EB;
    color: #374151;
}

.btn-outline:hover {
    background: #F9FAFB;
    border-color: #D1D5DB;
    transform: translateY(-1px);
}

.btn-sm {
    padding: 0.35rem 1rem;
    font-size: 0.75rem;
}

/* ---------- 输入框 ---------- */
.tool-root textarea,
.tool-root input[type="text"],
.tool-root input[type="email"],
.tool-root input[type="password"],
.tool-root input[type="number"],
.tool-root select {
    /* width: 100%; */  /* 注释掉这行 */
    box-sizing: border-box;
    border-radius: 12px;
    border: 1px solid #E5E7EB;
    padding: 0.7rem 1rem;
    font-size: 0.875rem;
    transition: all 0.15s ease;
    background: #FFFFFF;
    font-family: inherit;
}

.tool-root textarea:focus,
.tool-root input:focus,
.tool-root select:focus {
    outline: none;
    border-color: #111827;
    box-shadow: 0 0 0 2px rgba(17, 24, 39, 0.05);
}

.tool-root textarea {
    resize: vertical;
    min-height: 120px;
}

/* ---------- 文件上传区域 ---------- */
.file-drop-zone {
    border: 1.5px dashed #D1D5DB;
    border-radius: 20px;
    padding: 2.5rem;
    text-align: center;
    background: #FAFBFC;
    transition: all 0.2s ease;
    cursor: pointer;
}

.file-drop-zone:hover {
    border-color: #9CA3AF;
    background: #F9FAFB;
}

/* ---------- 网格布局 ---------- */
.tool-root .grid-cols-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}

@media (max-width: 768px) {
    .tool-root .grid-cols-2 {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* ---------- 滑块 ---------- */
.tool-root input[type="range"] {
    width: 100%;
    height: 4px;
    -webkit-appearance: none;
    background: #E5E7EB;
    border-radius: 2px;
    outline: none;
}

.tool-root input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: #111827;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.1s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.tool-root input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

/* ---------- 复制按钮 ---------- */
.copy-icon {
    background: none;
    border: none;
    color: #9CA3AF;
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.copy-icon:hover {
    color: #111827;
    background: #F3F4F6;
}

/* ---------- 相关工具区块（旧样式，保留兼容） ---------- */
.related-tools {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #EFF0F2;
}

.related-tools h3 {
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 1rem;
    color: #6B7280;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: -0.01em;
}

.related-tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
}

.related-tool-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: transparent;
    border-radius: 12px;
    padding: 0.7rem 0.875rem;
    text-decoration: none;
    transition: all 0.15s ease;
    border: 1px solid #EFF0F2;
}

.related-tool-card:hover {
    background: #FAFBFC;
    border-color: #E5E7EB;
    transform: translateY(-1px);
}

.related-tool-card .rel-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #F5F7FA;
    border-radius: 10px;
    color: #4F6EF7;
    font-size: 1rem;
}

.related-tool-card .rel-name {
    font-weight: 500;
    font-size: 0.8125rem;
    color: #1F2937;
}

.related-tool-card .rel-desc {
    font-size: 0.6875rem;
    color: #9CA3AF;
    margin-top: 1px;
}

/* ========================================
   精选推荐工具卡片样式（与首页一致）
   ======================================== */

/* 标题栏 */
.section-title-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e2e8f0;
}

.section-title-bar h2 {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-title-bar .view-all {
    font-size: 0.875rem;
    color: #4F6EF7;
    transition: color 0.2s;
    text-decoration: none;
}

.section-title-bar .view-all:hover {
    color: #3B5DE7;
    text-decoration: underline;
}

/* 工具卡片网格 */
.tools-card-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

@media (max-width: 1024px) {
    .tools-card-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .tools-card-grid {
        grid-template-columns: 1fr;
    }
}

/* 增强版工具卡片 */
.tool-card-enhanced {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.2s ease;
    text-decoration: none;
    position: relative;
}

.tool-card-enhanced:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    border-color: #cbd5e1;
}

/* 图标包装器 */
.card-icon-wrap {
    width: 48px;
    height: 48px;
    background: #EEF2FF;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.card-icon-wrap i,
.card-icon-wrap svg {
    width: 28px;
    height: 28px;
    color: #4F6EF7;
}

/* 工具信息 */
.card-info {
    flex: 1;
}

.card-info h3 {
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.25rem;
}

.card-info p {
    font-size: 0.75rem;
    color: #64748b;
    line-height: 1.4;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* 热门/新增徽章 */
.card-badge-hot,
.card-badge-new {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 0.625rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
}

.card-badge-hot {
    background: #FEF3C7;
    color: #D97706;
}

.card-badge-new {
    background: #DCFCE7;
    color: #16A34A;
}

/* 相关工具区块容器 */
.home-tools-section {
    margin-bottom: 1.5rem;
}

.home-tools-section.mt-8 {
    margin-top: 2rem;
}

/* ---------- 移动端适配 ---------- */
@media (max-width: 1024px) {
    .tool-page {
        padding: 1.5rem;
    }
    .tool-root {
        padding: 1.5rem;
    }
}

@media (max-width: 768px) {
    .tool-page {
        padding: 1rem;
    }
    .tool-root {
        padding: 1.25rem;
        border-radius: 16px;
    }
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.8125rem;
    }
    .related-tools-grid {
        grid-template-columns: 1fr;
    }
}

/* ---------- 淡入动画 ---------- */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tool-root {
    animation: fadeIn 0.25s ease-out;
}