* { margin: 0; padding: 0; box-sizing: border-box; font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif; }
body {
    background: #16181d;
    color: #e2e8f0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ================= 整体两栏布局 ================= */
.toolbox-page {
    flex: 1;
    background: #16181d;
    min-height: calc(100vh - 60px);
    padding: 0;
    margin: 0;
}
.toolbox-layout {
    display: flex;
    width: 100%;
    max-width: 100%;
    margin: 0;
    min-height: calc(100vh - 60px);
}

/* ================= 左侧侧边栏 ================= */
.sidebar {
    width: 240px;
    flex-shrink: 0;
    background: #282b35;
    border-right: 1px solid rgba(148, 163, 184, 0.08);
    padding: 24px 14px;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    left: 0;
    height: calc(100vh - 60px);
    overflow-y: auto;
}
.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 8px 24px;
    margin-bottom: 8px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.08);
}
.sidebar-logo-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}
.sidebar-logo-title {
    font-size: 17px;
    font-weight: 700;
    color: #f1f5f9;
    line-height: 1.2;
}
.sidebar-logo-sub {
    font-size: 11.5px;
    color: #64748b;
    margin-top: 2px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}
.sidebar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: 10px;
    color: #94a3b8;
    font-size: 14.5px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}
.sidebar-item:hover {
    background: rgba(59, 130, 246, 0.08);
    color: #cbd5e1;
}
.sidebar-item.active {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: #fff;
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.35);
}
.sidebar-icon {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    flex-shrink: 0;
}

/* ================= 右侧主内容 ================= */
.main-content {
    flex: 1;
    padding: 32px 40px 40px;
    min-width: 0;
    margin: 0 auto;
    max-width: 1560px;
    width: 100%;
}
.main-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    gap: 24px;
}
.main-title {
    font-size: 26px;
    font-weight: 700;
    color: #f8fafc;
    line-height: 1.3;
}
.main-sub {
    font-size: 13.5px;
    color: #64748b;
    margin-top: 5px;
}

/* 搜索框 */
.tool-search-wrap {
    width: 340px;
    flex-shrink: 0;
    position: relative;
}
.tool-search {
    width: 100%;
    padding: 12px 16px 12px 44px;
    background: #282b35;
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 12px;
    color: #f1f5f9;
    font-size: 13.5px;
    outline: none;
    transition: all 0.25s ease;
}
.tool-search:focus {
    border-color: rgba(99, 102, 241, 0.6);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}
.tool-search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    pointer-events: none;
    width: 17px;
    height: 17px;
}
.tool-search::placeholder { color: #64748b; }

/* ================= 工具分类区块 ================= */
.tool-section {
    margin-bottom: 56px;
}
.section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 700;
    color: #e2e8f0;
    margin-bottom: 14px;
    padding-left: 12px;
    position: relative;
}
.section-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 16px;
    border-radius: 2px;
    background: linear-gradient(180deg, #6366f1 0%, #8b5cf6 100%);
}
.section-title .count {
    font-size: 11px;
    font-weight: 500;
    color: #64748b;
    background: rgba(100, 116, 139, 0.15);
    padding: 2px 9px;
    border-radius: 999px;
}

/* ================= 工具卡片网格 ================= */
.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    row-gap: 24px;
    column-gap: 40px;
    align-items: stretch;
}
.tool-card {
    position: relative;
    padding: 22px 24px;
    background: #282b35;
    border: 1px solid rgba(148, 163, 184, 0.1);
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.25s ease;
    text-decoration: none;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    overflow: hidden;
    min-height: 104px;
}
.tool-card:hover {
    border-color: rgba(99, 102, 241, 0.35);
    background: #212c42;
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
}
.tool-card.disabled {
    cursor: not-allowed;
    opacity: 0.55;
}
.tool-card.disabled:hover {
    transform: none;
    border-color: rgba(148, 163, 184, 0.1);
    background: #282b35;
    box-shadow: none;
}
.tool-icon {
    width: 54px;
    height: 54px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    line-height: 1;
}
.tool-icon svg {
    display: block;
    width: 26px;
    height: 26px;
}
.tool-name-wrap {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 6px;
    padding-top: 1px;
}
.tool-card .tool-name {
    font-size: 18px;
    font-weight: 600;
    color: #f8fafc;
    margin: 0;
    padding: 0;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tool-card .tool-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    min-height: 0;
    max-height: 42px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.tool-tag-row { display: none !important; }
.tool-tag { display: none !important; }

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #64748b;
}
.empty-state svg { margin-bottom: 12px; opacity: 0.5; width: 52px; height: 52px; }
.empty-state p { font-size: 13.5px; }

/* ================= 工具模态框 ================= */
.modal-mask {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(6px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal-mask.show { display: flex; }
.modal-box {
    width: 100%;
    max-width: 720px;
    max-height: 85vh;
    background: #282b35;
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}
.modal-head {
    padding: 18px 24px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}
.modal-title {
    font-size: 17px;
    font-weight: 600;
    color: #f1f5f9;
}
.modal-close {
    width: 34px;
    height: 34px;
    border: none;
    background: rgba(148, 163, 184, 0.1);
    color: #94a3b8;
    border-radius: 8px;
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
    transition: all 0.2s ease;
}
.modal-close:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
}
.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

/* toast */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    padding: 10px 20px;
    background: rgba(30, 41, 59, 0.95);
    color: #f1f5f9;
    border-radius: 10px;
    font-size: 13.5px;
    z-index: 2000;
    transition: transform 0.3s ease;
    border: 1px solid rgba(148, 163, 184, 0.15);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* ============== 通用工具模块样式 ============== */
.tool-row { margin-bottom: 18px; }
.tool-row-title {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #cbd5e1;
    margin-bottom: 8px;
}
.tool-textarea, .tool-input, .tool-select {
    width: 100%;
    padding: 11px 14px;
    background: #16181d;
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 10px;
    color: #f1f5f9;
    font-size: 13.5px;
    outline: none;
    transition: all 0.2s ease;
    font-family: inherit;
}
.tool-textarea {
    resize: vertical;
    min-height: 140px;
    line-height: 1.6;
}
.tool-textarea:focus, .tool-input:focus, .tool-select:focus {
    border-color: rgba(99, 102, 241, 0.6);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}
.tool-btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0; }
.tool-btn {
    padding: 9px 18px;
    border: none;
    border-radius: 9px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: #fff;
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}
.tool-btn:hover { filter: brightness(1.1); transform: translateY(-1px); }
.tool-btn.secondary { background: rgba(148, 163, 184, 0.15); color: #cbd5e1; }
.tool-btn.secondary:hover { background: rgba(148, 163, 184, 0.22); }
.tool-btn.danger { background: linear-gradient(135deg, #ef4444 0%, #f97316 100%); }
.tool-result {
    margin-top: 10px;
    padding: 14px 16px;
    background: #16181d;
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 10px;
    font-size: 13px;
    color: #e2e8f0;
    word-break: break-all;
    line-height: 1.65;
    max-height: 320px;
    overflow-y: auto;
}
.tool-inline-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.tool-inline-row .tool-input { flex: 1; min-width: 120px; }

/* 时间戳 */
.ts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 18px; }
.ts-now {
    padding: 16px 18px;
    background: linear-gradient(135deg, rgba(99,102,241,0.12) 0%, rgba(139,92,246,0.1) 100%);
    border: 1px solid rgba(99,102,241,0.2);
    border-radius: 12px;
    margin-bottom: 18px;
}
.ts-now-label { font-size: 12px; color: #94a3b8; margin-bottom: 6px; }
.ts-now-val { font-size: 18px; font-weight: 700; color: #f8fafc; font-family: 'Consolas', monospace; }

/* 颜色选择器 */
.color-picker-wrap {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px;
    background: #16181d;
    border-radius: 12px;
    margin-bottom: 18px;
}
.color-preview {
    width: 84px;
    height: 84px;
    border-radius: 14px;
    border: 2px solid rgba(255,255,255,0.15);
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}
.color-picker-wrap input[type="color"] {
    width: 50px; height: 50px;
    border: none; background: none; cursor: pointer;
    border-radius: 10px;
}

/* 二维码 */
.qrcode-box {
    padding: 22px;
    background: #fff;
    display: inline-block;
    border-radius: 12px;
    margin: 10px 0;
}
.qrcode-box canvas, .qrcode-box img { display: block; }

/* 密码生成 */
.pwd-result {
    padding: 14px 18px;
    background: #16181d;
    border: 1px solid rgba(34,197,94,0.25);
    border-radius: 10px;
    font-size: 20px;
    font-weight: 700;
    font-family: 'Consolas', monospace;
    color: #86efac;
    letter-spacing: 2px;
    margin-bottom: 14px;
    word-break: break-all;
}
.pwd-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 14px;
}
.pwd-opt {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #cbd5e1;
}
.pwd-opt input[type="checkbox"] {
    width: 16px; height: 16px;
    accent-color: #8b5cf6;
    cursor: pointer;
}

/* IP信息 */
.ip-hero {
    padding: 22px;
    background: linear-gradient(135deg, rgba(99,102,241,0.15) 0%, rgba(139,92,246,0.1) 100%);
    border: 1px solid rgba(99,102,241,0.25);
    border-radius: 14px;
    text-align: center;
    margin-bottom: 20px;
}
.ip-hero-label { font-size: 12.5px; color: #94a3b8; margin-bottom: 6px; }
.ip-hero-val { font-size: 30px; font-weight: 800; color: #f8fafc; font-family: 'Consolas', monospace; }
.ip-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.ip-card {
    padding: 14px 16px;
    background: #16181d;
    border: 1px solid rgba(148,163,184,0.1);
    border-radius: 10px;
}
.ip-card-lbl { font-size: 11.5px; color: #64748b; margin-bottom: 5px; }
.ip-card-val { font-size: 14px; color: #f1f5f9; font-weight: 600; word-break: break-all; }

/* 进制转换 */
.hex-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }

/* 单位换算 */
.unit-row { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; margin-bottom: 14px; }
.unit-row .tool-select { padding: 10px 12px; }
.unit-arrow { color: #64748b; font-size: 18px; padding: 0 4px; }