/*
 * Webtool 基座样式
 *
 * 为所有在线工具箱页面提供统一的 CSS 变量和基础布局样式。
 * 新工具可直接引用 --wt-* 变量，无需重复定义。
 *
 * @package onenavsub
 */

/* ===== CSS 变量 ===== */
.io-webtool-root {
    --wt-accent: var(--theme-color, #f1404b);
    --wt-bg: var(--body-bg-color, #f2f4f7);
    --wt-card-bg: var(--main-bg-color, #fff);
    --wt-text: var(--main-color, #1e293b);
    --wt-text-muted: var(--muted-color, #64748b);
    --wt-border: var(--muted-bg-a-color, rgba(136, 136, 136, 0.12));
    --wt-shadow: var(--main-shadow, rgba(0, 0, 0, 0.06));
    --wt-radius: var(--main-radius, 12px);
    --wt-blur-bg: var(--main-blur-bg-color, rgba(245, 245, 245, 0.75));
    font-family: inherit;
    color: var(--wt-text);
}

/* ===== 暗色模式适配 ===== */
.io-black-mode .io-webtool-root {
    --wt-card-bg: var(--main-bg-color, #2d2e2f);
    --wt-blur-bg: var(--main-blur-bg-color, rgba(46, 46, 46, 0.65));
}

/* ===== 公共工具容器 ===== */
.io-webtool-root .wt-wrap {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 15px;
}

.io-webtool-root .wt-wrap-sm {
    max-width: 700px;
    margin: 0 auto;
    padding: 0 15px;
}

/* ===== 公共卡片 ===== */
.io-webtool-root .wt-card {
    background: var(--wt-card-bg);
    border-radius: var(--wt-radius);
    box-shadow: 0 2px 12px var(--wt-shadow);
    padding: 20px 24px;
    margin-bottom: 16px;
    transition: box-shadow 0.2s;
    border: 1px solid var(--wt-border);
}

.io-webtool-root .wt-card:hover {
    box-shadow: 0 4px 16px var(--wt-shadow);
}

.io-webtool-root .wt-card-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--wt-text);
}

/* ===== 公共按钮 ===== */
.io-webtool-root .wt-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}

.io-webtool-root .wt-btn-primary {
    background: var(--wt-accent);
    color: #fff;
}

.io-webtool-root .wt-btn-primary:hover {
    filter: brightness(0.9);
}

.io-webtool-root .wt-btn-outline {
    background: transparent;
    border: 1.5px solid var(--wt-border);
    color: var(--wt-text-muted);
}

.io-webtool-root .wt-btn-outline:hover {
    border-color: var(--wt-accent);
    color: var(--wt-accent);
}

/* ===== Toast 提示 ===== */
.io-webtool-root .wt-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 22px;
    background: var(--wt-text);
    color: var(--wt-card-bg);
    border-radius: 10px;
    font-size: 14px;
    opacity: 0;
    transform: translateY(-8px);
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
    pointer-events: none;
}

.io-webtool-root .wt-toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* ===== 加载状态 ===== */
.io-webtool-root .wt-loading {
    text-align: center;
    padding: 60px 0;
    color: var(--wt-text-muted);
}

.io-webtool-root .wt-spinner {
    display: inline-block;
    width: 28px;
    height: 28px;
    border: 3px solid var(--wt-border);
    border-top-color: var(--wt-accent);
    border-radius: 50%;
    animation: wt-spin 0.7s linear infinite;
    margin-bottom: 8px;
}

@keyframes wt-spin {
    to { transform: rotate(360deg); }
}

/* ===== 页面标题 ===== */
.io-webtool-root .wt-page-header {
    text-align: center;
    margin-bottom: 28px;
    padding: 28px 24px 24px;
}

.io-webtool-root .wt-page-header h1 {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--wt-text);
}

.io-webtool-root .wt-page-header h1 span {
    color: var(--wt-accent);
}

.io-webtool-root .wt-page-header p {
    color: var(--wt-text-muted);
    font-size: 14px;
    margin-bottom: 0;
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .io-webtool-root .wt-wrap,
    .io-webtool-root .wt-wrap-sm {
        padding: 0 12px;
    }
    .io-webtool-root .wt-card {
        padding: 14px 16px;
    }
    .io-webtool-root .wt-page-header h1 {
        font-size: 20px;
    }
}
