/* ============================================
 * 域名工具箱 - 首页样式
 * 布局：左侧边栏 + 右侧内容区
 * 参考 90th.cn 风格
 * ============================================ */

:root {
    --sidebar-width: 280px;
    --topbar-height: 56px;
    --primary-color: #2563EB;
    --bg-body: #F0F2F5;
    --border-light: #E5E7EB;
    --text-primary: #1F2937;
    --text-secondary: #6B7280;
}

* { box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB',
                 'Microsoft YaHei', 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-body);
    color: var(--text-primary);
    overflow-x: hidden;
}

/* ========== 顶部导航栏 ========== */
.top-navbar {
    background: white !important;
    height: var(--topbar-height);
    padding: 0 !important;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    z-index: 1000;
    position: sticky;
    top: 0;
}
.top-navbar .navbar-brand {
    font-size: 1.15rem;
    color: var(--text-primary) !important;
    letter-spacing: -0.3px;
}
.top-navbar .navbar-brand i {
    color: var(--primary-color);
}
.top-tabs {
    gap: 2px;
}
.top-tabs .nav-link {
    color: var(--text-secondary) !important;
    font-size: 0.9rem;
    padding: 8px 16px !important;
    border-radius: 6px 6px 0 0;
    transition: all 0.2s;
    font-weight: 500;
}
.top-tabs .nav-link:hover {
    color: var(--primary-color) !important;
    background: #EFF6FF;
}
.top-tabs .nav-link.active {
    color: var(--primary-color) !important;
    background: white;
    border-bottom: 2.5px solid var(--primary-color);
    margin-bottom: -1px;
}
.user-area {
    font-size: 0.85rem;
}

/* ========== 主布局 ========== */
.main-wrapper {
    display: flex;
    min-height: calc(100vh - var(--topbar-height));
}

/* ========== 左侧边栏 ========== */
.sidebar {
    width: var(--sidebar-width);
    background: white;
    border-right: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: var(--topbar-height);
    height: calc(100vh - var(--topbar-height));
    flex-shrink: 0;
    overflow-y: auto;
}
.sidebar-header {
    padding: 14px 18px 8px;
    border-bottom: 1px solid var(--border-light);
    flex-shrink: 0;
}
.sidebar-body {
    flex: 1;
    padding: 10px 12px;
    overflow-y: auto;
}
.sidebar-footer {
    padding: 12px 18px;
    border-top: 1px solid var(--border-light);
    text-align: center;
    flex-shrink: 0;
}

/* 侧栏项 */
.sidebar-item {
    display: flex;
    align-items: center;
    padding: 11px 12px;
    border-radius: 10px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
    margin-bottom: 2px;
}
.sidebar-item:hover {
    background: #F9FAFB;
}
.sidebar-item.active {
    background: linear-gradient(135deg, var(--item-color, #2563EB), transparent);
    background-color: rgba(37, 99, 235, 0.06);
    border-left: 3.5px solid var(--item-color, #2563EB);
    padding-left: 9px; /* compensate for border */
}
.sb-left {
    width: 38px;
    flex-shrink: 0;
}
.sb-icon {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    font-size: 1.05rem;
    background: #F3F4F6;
    color: var(--text-primary);
}
.sidebar-item.active .sb-icon {
    background: white;
    color: var(--item-color, #2563EB);
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}
.sb-center {
    flex: 1;
    min-width: 0;
    padding-left: 10px;
}
.sb-name {
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.25;
}
.sb-meta {
    font-size: 0.72rem;
    color: var(--text-secondary);
    margin-top: 2px;
    display: flex;
    align-items: center;
    gap: 4px;
}
.sb-right {
    width: 70px;
    flex-shrink: 0;
    text-align: right;
    padding-right: 4px;
}
.badge-cat {
    font-size: 0.62rem;
    padding: 1px 6px;
    border-radius: 4px;
    color: white;
    font-weight: 600;
}
.sb-arrow {
    opacity: 0;
    color: var(--text-secondary);
    font-size: 0.65rem;
    transition: opacity 0.2s;
    width: 14px;
}
.sidebar-item:hover .sb-arrow,
.sidebar-item.active .sb-arrow {
    opacity: 1;
}

/* 状态圆点 */
.dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    display: inline-block;
}
.dot-green { background: #22C55E; box-shadow: 0 0 4px rgba(34,197,94,0.4); }
.dot-yellow{ background: #F59E0B; }
.dot-gray  { background: #D1D5DB; }

/* 查看更多 */
.sidebar-more {
    padding: 10px 12px;
    text-align: center;
}
.sidebar-more a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.82rem;
}
.sidebar-more a:hover {
    color: var(--primary-color);
}

/* ========== 右侧主内容区 ========== */
.content-area {
    flex: 1;
    min-width: 0;
    padding: 20px 24px;
    max-width: 100%;
}
.content-panel {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    overflow: hidden;
    margin-bottom: 20px;
}
.panel-header {
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--border-light);
}
.panel-header h4 {
    font-weight: 700;
    font-size: 1.1rem;
}

/* ========== 工具网格卡片 ========== */
.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
    padding: 20px 24px 24px;
}
.tool-card {
    display: block;
    text-decoration: none;
    border: 1px solid var(--border-light);
    border-radius: 10px;
    padding: 16px;
    transition: all 0.25s ease;
    background: white;
    color: inherit;
    position: relative;
    overflow: hidden;
}
.tool-card:hover {
    border-color: var(--card-color, var(--primary-color));
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
}
.tool-card.disabled {
    opacity: 0.7;
    pointer-events: none;
}
.tool-card.disabled:hover {
    transform: none;
    box-shadow: none;
    border-color: var(--border-light);
}
.tc-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 12px;
}
.tc-icon-wrap {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    color: var(--card-color, var(--primary-color));
    flex-shrink: 0;
}
.badge-coming {
    font-size: 0.68rem;
    padding: 2px 8px;
    border-radius: 4px;
    background: #FEF3C7;
    color: #D97706;
    font-weight: 600;
}
.tc-body h6 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 4px;
    line-height: 1.35;
}
.tc-body p.desc {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 30px;
    color: var(--text-secondary);
}
.empty-state i {
    font-size: 3rem;
    opacity: 0.3;
    margin-bottom: 16px;
    display: block;
}
.empty-state h5 {
    color: var(--text-primary);
    margin-bottom: 6px;
}

/* 底部footer */
.content-footer {
    padding: 16px 0;
    font-size: 0.82rem;
}

/* ========== 响应式 ========== */
@media (max-width: 992px) {
    :root {
        --sidebar-width: 240px;
    }
    .main-wrapper {
        flex-direction: column;
    }
    .sidebar {
        position: fixed;
        left: calc(-1 * var(--sidebar-width));
        top: var(--topbar-height);
        height: calc(100vh - var(--topbar-height));
        z-index: 999;
        box-shadow: 2px 0 12px rgba(0,0,0,0.1);
        transition: left 0.3s ease;
        border-right: none;
    }
    .sidebar.show {
        left: 0;
    }
    .content-area {
        width: 100%;
    }
    .tool-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        padding: 14px 14px 18px;
    }
}

@media (max-width: 576px) {
    .tool-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        padding: 12px 12px 16px;
    }
    .tool-card {
        padding: 12px;
    }
    .tc-icon-wrap {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
    .panel-header {
        padding: 14px 14px 12px;
    }
    .content-area {
        padding: 12px;
    }
    /* 移动端隐藏部分信息 */
    .sb-meta,
    .sb-arrow,
    .sb-right .badge-cat {
        display: none !important;
    }
    .top-tabs .nav-link {
        padding: 8px 10px !important;
        font-size: 0.82rem;
    }
}

/* 滚动条美化 */
.sidebar-body::-webkit-scrollbar {
    width: 4px;
}
.sidebar-body::-webkit-scrollbar-thumb {
    background: #D1D5DB;
    border-radius: 4px;
}
.sidebar-body::-webkit-scrollbar-thumb:hover {
    background: #9CA3AF;
}
