/* ============================================
   Database 页面通用样式
   ============================================ */
body { background-color: #0d1117; color: #c9d1d9; }

.db-layout {
    display: flex; max-width: 1400px; margin: 2rem auto;
    padding: 0 1.5rem; gap: 2rem; align-items: flex-start;
}

/* ── 侧边栏 ─────────────────────────────── */
.db-sidebar {
    width: 280px; background: #161b22; border: 1px solid #30363d;
    border-radius: 8px; padding: 0.75rem 0; flex-shrink: 0;
    position: sticky; top: 80px; overflow-y: auto; max-height: calc(100vh - 100px);
}
.db-sidebar-title {
    font-size: 0.85rem; color: #8b949e; padding: 0.25rem 1rem 0.5rem;
    font-weight: 600;
}

/* 一级列表 */
.db-nav { list-style: none; padding: 0; margin: 0; }

/* 顶部固定链接（概述 / 所有商品） */
.db-nav-top {
    display: block; padding: 0.5rem 1rem; color: #c9d1d9;
    text-decoration: none; font-size: 0.95rem; font-weight: 600;
    transition: background 0.15s;
}
.db-nav-top:hover { background: #21262d; }
.db-nav-top.active {
    background: rgba(46,160,67,0.15); color: #3fb950;
}
.db-nav-top .db-count {
    float: right; color: #8b949e; font-weight: 400;
}

/* 一级分类项（▶ Weapons  77） */
.db-cat {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.5rem 1rem; color: #c9d1d9; text-decoration: none;
    font-size: 0.95rem; cursor: pointer; transition: background 0.15s;
    user-select: none;
}
.db-cat:hover { background: #21262d; }
.db-cat .db-arrow {
    font-size: 0.65rem; margin-right: 0.5rem; color: #8b949e;
    display: inline-block; width: 0.8rem; flex-shrink: 0;
}
.db-cat .db-cat-label { flex: 1; }
.db-cat .db-count { color: #8b949e; font-size: 0.9rem; flex-shrink: 0; }

/* 二级子菜单容器 */
.db-sub {
    list-style: none; padding: 0; margin: 0;
    overflow: hidden; transition: max-height 0.2s ease;
}
.db-sub.collapsed { display: none; }

/* "查看所有XXX" 绿色链接 */
.db-sub-viewall {
    display: block; padding: 0.4rem 1rem 0.4rem 2.5rem;
    color: #3fb950; text-decoration: none; font-size: 0.9rem; font-weight: 600;
}
.db-sub-viewall:hover { text-decoration: underline; }

/* 二级子项 */
.db-sub-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 0.4rem 1rem 0.4rem 2.5rem; color: #c9d1d9;
    text-decoration: none; font-size: 0.9rem; transition: background 0.15s;
}
.db-sub-item:hover { background: #21262d; }
.db-sub-item.active { color: #3fb950; background: rgba(46,160,67,0.1); }
.db-sub-item .db-count { color: #8b949e; font-size: 0.85rem; }

/* ── 主内容区 ────────────────────────────── */
.db-main { flex-grow: 1; min-width: 0; }
.db-breadcrumbs { font-size: 0.9rem; color: #8b949e; margin-bottom: 0.25rem; }
.db-breadcrumbs span { color: #3fb950; }
.db-header-meta {
    font-size: 0.7rem; text-transform: uppercase; color: #3fb950;
    font-weight: 700; letter-spacing: 0.06em; margin-bottom: 0.5rem;
}
.db-main h1 {
    font-size: 2.2rem; margin: 0 0 0.75rem; color: #f0f6fc;
    border: none; padding: 0;
}
.db-desc { color: #8b949e; line-height: 1.6; margin-bottom: 1.5rem; }

/* 指南入口横幅 */
.db-guide-link {
    background: rgba(46,160,67,0.08); border: 1px solid rgba(46,160,67,0.25);
    border-radius: 8px; padding: 0.75rem 1rem; margin-bottom: 1.5rem;
    font-size: 0.95rem;
}
.db-guide-link a { color: #3fb950; text-decoration: none; font-weight: 600; }
.db-guide-link a:hover { text-decoration: underline; }

/* ── 搜索工具栏 ──────────────────────────── */
.db-toolbar {
    display: flex; justify-content: space-between; align-items: center;
    background: #161b22; border: 1px solid #30363d; border-radius: 8px;
    padding: 0.5rem 0.75rem; margin-bottom: 1.5rem;
}
.db-search-input {
    background: #0d1117; border: 1px solid #30363d; color: #c9d1d9;
    padding: 0.5rem 1rem; border-radius: 6px; width: 300px; outline: none;
    font-size: 0.95rem;
}
.db-search-input:focus { border-color: #58a6ff; box-shadow: 0 0 0 2px rgba(88,166,255,0.15); }
.db-toolbar-meta { color: #8b949e; font-size: 0.85rem; }
.db-sort-select {
    background: #0d1117; border: 1px solid #30363d; color: #c9d1d9;
    padding: 0.3rem 0.5rem; border-radius: 6px; outline: none;
}

/* ── 卡片网格 ────────────────────────────── */
.db-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.75rem;
}
.db-card {
    background: #161b22; border: 1px solid #30363d; border-radius: 8px;
    padding: 0.85rem; display: flex; gap: 0.85rem;
    transition: all 0.2s ease; cursor: pointer; text-decoration: none; color: inherit;
}
.db-card:hover { border-color: #58a6ff; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.3); }
.db-card-icon {
    width: 56px; height: 56px; background: #0d1117; border: 1px solid #30363d;
    border-radius: 6px; display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; overflow: hidden; font-size: 1.5rem;
}
.db-card-icon img { width: 100%; height: 100%; object-fit: cover; }
.db-card-content { display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.db-card-title {
    font-size: 1rem; font-weight: 600; margin: 0 0 0.15rem;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.db-card-type { font-size: 0.8rem; color: #8b949e; margin: 0 0 0.3rem; }
.db-badge {
    display: inline-block; font-size: 0.7rem; font-weight: 700;
    padding: 0.1rem 0.45rem; border-radius: 10px; width: fit-content;
}

/* 稀有度颜色 */
.rarity-epic { color: #d2a8ff; background: rgba(210,168,255,0.1); border: 1px solid rgba(210,168,255,0.2); }
.rarity-rare { color: #58a6ff; background: rgba(88,166,255,0.1); border: 1px solid rgba(88,166,255,0.2); }
.rarity-uncommon { color: #3fb950; background: rgba(63,185,80,0.1); border: 1px solid rgba(63,185,80,0.2); }
.rarity-common { color: #8b949e; background: rgba(139,148,158,0.1); border: 1px solid rgba(139,148,158,0.2); }
.title-epic { color: #d2a8ff; }
.title-rare { color: #58a6ff; }
.title-uncommon { color: #3fb950; }

/* ── 响应式 ──────────────────────────────── */
@media (max-width: 900px) {
    .db-layout { flex-direction: column; }
    .db-sidebar { width: 100%; position: static; max-height: 350px; }
    .db-toolbar { flex-direction: column; gap: 0.75rem; }
    .db-search-input { width: 100%; }
    .db-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 500px) {
    .db-grid { grid-template-columns: 1fr; }
}

/* ============================================
   物品详情页 v2 — 左右双栏布局
   左侧：图片 + 基础信息 + 概述
   右侧：制作配方（分级卡片）
   ============================================ */

/* ── 容器 ─────────────────────────────────── */
.detail-wrap {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

/* ── 面包屑 ───────────────────────────────── */
.detail-breadcrumbs {
    font-size: 0.9rem;
    color: #8b949e;
    margin-bottom: 1.5rem;
}
.detail-breadcrumbs a { color: #3fb950; text-decoration: none; }
.detail-breadcrumbs a:hover { text-decoration: underline; }

/* ── 双栏主体 ─────────────────────────────── */
.detail-two-col {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 1.5rem;
    align-items: start;
}

/* ── 左栏：物品信息 ───────────────────────── */
.detail-left {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* 物品图片卡 */
.detail-item-image {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 10px;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
    overflow: hidden;
}
.detail-item-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    image-rendering: auto;
}

/* 物品头部信息 */
.detail-item-info {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
}
.detail-item-info .item-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: #3fb950;
    font-weight: 700;
    letter-spacing: 0.06em;
    margin-bottom: 0.5rem;
}
.detail-item-info .item-name {
    font-size: 1.6rem;
    font-weight: 800;
    color: #f0f6fc;
    margin: 0 0 0.5rem;
    line-height: 1.2;
    border: none;
    padding: 0;
}
.detail-item-info .item-type-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #8b949e;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}
.detail-item-info .item-rarity-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
}

/* 属性方格（攻击力 / 等级） */
.detail-stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-top: 0.5rem;
}
.detail-stat-box {
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 0.75rem;
    text-align: center;
}
.detail-stat-box .stat-label {
    font-size: 0.7rem;
    color: #8b949e;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.25rem;
}
.detail-stat-box .stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: #f0f6fc;
}

/* 左侧：概述卡片 (替代原来的数据集概览) */
.detail-overview-card {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
}
.detail-overview-card .overview-title {
    font-size: 0.72rem;
    text-transform: uppercase;
    color: #3fb950;
    font-weight: 700;
    letter-spacing: 0.06em;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid #21262d;
    padding-bottom: 0.5rem;
}
.detail-overview-card .overview-text {
    color: #c9d1d9;
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0 0 0.75rem;
}
.detail-overview-card .overview-quote {
    margin: 0;
    padding-left: 0.8rem;
    border-left: 3px solid #30363d;
    color: #8b949e;
    font-style: italic;
    font-size: 0.9rem;
    line-height: 1.6;
}

/* ── 右栏 ─────────────────────────────────── */
.detail-right {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* ── 右侧：高级制作面板 ─────────────────────── */
.detail-crafting-premium {
    background: linear-gradient(180deg, #161b22 0%, #0d1117 100%);
    border: 1px solid #30363d;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.crafting-premium-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}
.crafting-premium-header .title {
    font-size: 1.4rem;
    font-weight: 800;
    color: #f0f6fc;
    margin: 0 0 0.25rem;
    letter-spacing: -0.01em;
}
.crafting-premium-header .subtitle {
    font-size: 0.85rem;
    color: #8b949e;
    margin: 0;
}
.station-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 0.4rem 0.75rem;
}
.station-badge img {
    width: 28px;
    height: 28px;
    border-radius: 4px;
}
.station-badge span {
    font-size: 0.9rem;
    font-weight: 600;
    color: #c9d1d9;
}

/* 时间线列表 */
.crafting-tiers-list {
    display: flex;
    flex-direction: column;
}
.tier-card {
    display: flex;
    gap: 1.25rem;
    position: relative;
}
.tier-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 24px;
    flex-shrink: 0;
}
.tier-indicator .dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #30363d;
    border: 3px solid #0d1117;
    box-shadow: 0 0 0 1px #30363d;
    margin-top: 0.5rem;
    z-index: 2;
}
.tier-indicator.tier-1 .dot { background: #22c55e; box-shadow: 0 0 0 1px #22c55e; }
.tier-indicator.tier-2 .dot { background: #3b82f6; box-shadow: 0 0 0 1px #3b82f6; }
.tier-indicator.tier-3 .dot { background: #a855f7; box-shadow: 0 0 0 1px #a855f7; }

.tier-indicator .line {
    width: 2px;
    flex-grow: 1;
    background: #30363d;
    margin-top: 6px;
    margin-bottom: -0.5rem;
}
.tier-card:last-child .tier-indicator .line {
    display: none;
}

.tier-content {
    flex-grow: 1;
    background: rgba(255,255,255,0.015);
    border: 1px solid #21262d;
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 2rem;
    transition: background 0.2s, border-color 0.2s;
}
.tier-card:last-child .tier-content { margin-bottom: 0; }
.tier-content:hover {
    background: rgba(255,255,255,0.03);
    border-color: #30363d;
}

.tier-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.tier-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: #f0f6fc;
}
.tier-reqs {
    display: flex;
    gap: 0.5rem;
}
.tier-reqs .req {
    font-size: 0.75rem;
    color: #8b949e;
    background: #0d1117;
    border: 1px solid #21262d;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
}

.tier-mats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
}
.mat-pill {
    display: flex;
    align-items: center;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 30px;
    padding: 0.35rem 1rem 0.35rem 0.35rem;
    gap: 0.6rem;
    transition: border-color 0.2s, transform 0.2s;
    cursor: default;
    text-decoration: none;
    color: inherit;
}
.mat-pill:hover {
    border-color: #58a6ff;
    transform: translateY(-2px);
    text-decoration: none;
}
.mat-pill img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
}
.mat-pill .mat-name {
    font-size: 0.85rem;
    color: #c9d1d9;
    font-weight: 500;
}
.mat-pill .mat-count {
    font-size: 0.8rem;
    color: #3fb950;
    font-weight: 700;
}

/* ── 返回按钮 ─────────────────────────────── */
.detail-back {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: #3fb950;
    text-decoration: none;
    font-size: 0.9rem;
    margin-top: 1.5rem;
    padding: 0.5rem 1rem;
    background: rgba(46,160,67,0.08);
    border: 1px solid rgba(46,160,67,0.2);
    border-radius: 8px;
}
.detail-back:hover { background: rgba(46,160,67,0.15); text-decoration: none; }

/* ── 兼容：旧版详情页样式保留 ────────────── */
.detail-header {
    display: flex; gap: 1.25rem; align-items: center;
    background: #161b22; border: 1px solid #30363d; border-radius: 10px;
    padding: 1.5rem; margin-bottom: 1.5rem;
}
.detail-icon {
    width: 80px; height: 80px; background: #0d1117; border: 1px solid #30363d;
    border-radius: 8px; display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; overflow: hidden; font-size: 2.5rem;
}
.detail-icon img { width: 100%; height: 100%; object-fit: cover; }
.detail-meta h1 {
    font-size: 1.8rem; margin: 0 0 0.3rem; color: #f0f6fc; border: none; padding: 0;
}
.detail-meta .detail-type {
    font-size: 0.95rem; color: #8b949e; margin: 0 0 0.4rem;
}
.detail-section {
    background: #161b22; border: 1px solid #30363d; border-radius: 10px;
    padding: 1.25rem 1.5rem; margin-bottom: 1rem;
}
.detail-section-title {
    font-size: 0.75rem; text-transform: uppercase; color: #3fb950;
    font-weight: 700; letter-spacing: 0.05em; margin-bottom: 0.75rem;
    padding-bottom: 0.5rem; border-bottom: 1px solid #21262d;
}
.detail-stats {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.5rem 1.5rem;
}
.detail-stat {
    display: flex; justify-content: space-between; padding: 0.35rem 0;
    border-bottom: 1px solid #21262d;
}
.detail-stat-label { color: #8b949e; font-size: 0.9rem; }
.detail-stat-value { color: #f0f6fc; font-weight: 600; font-size: 0.9rem; }
.detail-materials { list-style: none; padding: 0; margin: 0; }
.detail-materials li {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.4rem 0; border-bottom: 1px solid #21262d; font-size: 0.95rem;
}
.detail-materials li:last-child { border-bottom: none; }
.detail-mat-qty {
    background: #0d1117; border: 1px solid #30363d; border-radius: 4px;
    padding: 0.15rem 0.4rem; font-size: 0.8rem; color: #8b949e;
    font-weight: 600; min-width: 2rem; text-align: center;
}
.detail-mat-link { color: #58a6ff; text-decoration: none; }
.detail-mat-link:hover { text-decoration: underline; }
.detail-mat-plain { color: #c9d1d9; }
.detail-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.detail-tag {
    background: #21262d; border: 1px solid #30363d; border-radius: 6px;
    padding: 0.25rem 0.6rem; font-size: 0.85rem; color: #c9d1d9;
}
.detail-text { color: #c9d1d9; line-height: 1.7; font-size: 0.95rem; }
.detail-text li { margin-bottom: 0.3rem; }
.detail-links { list-style: none; padding: 0; margin: 0; }
.detail-links li { padding: 0.35rem 0; border-bottom: 1px solid #21262d; }
.detail-links li:last-child { border-bottom: none; }
.detail-links a { color: #58a6ff; text-decoration: none; font-size: 0.95rem; }
.detail-links a:hover { text-decoration: underline; }

/* ── 响应式 ───────────────────────────────── */
@media (max-width: 900px) {
    .detail-two-col {
        grid-template-columns: 1fr;
    }
    .detail-left {
        max-width: 400px;
        margin: 0 auto;
        width: 100%;
    }
    .detail-item-image {
        aspect-ratio: auto;
        max-height: 300px;
    }
}
@media (max-width: 600px) {
    .detail-header { flex-direction: column; text-align: center; }
    .detail-stats { grid-template-columns: 1fr; }
    .detail-wrap { padding: 0 1rem; }
    .detail-stat-grid { grid-template-columns: 1fr; }
    .crafting-tier-materials { flex-direction: column; align-items: stretch; }
    .material-item { width: 100%; }
}
