/* ========================================
   热血传奇爆率查询系统 - 样式表
   ======================================== */

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
    background: linear-gradient(135deg, #eef1f5 0%, #e8ecf3 100%);
    color: #333;
    min-height: 100vh;
}

body.query-page {
    overflow: hidden;
}

/* ---- 顶部导航栏 ---- */
.top-bar {
    background: linear-gradient(135deg, #4a3d8a 0%, #6a5acd 50%, #7b6bdd 100%);
    color: #fff;
    padding: 0 20px;
    height: 56px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    position: sticky;
    top: 0;
    z-index: 100;
}
.top-bar-inner {
    max-width: 1600px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 20px;
}
.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: #fff;
    flex-shrink: 0;
}
.logo-icon {
    background: #2ecc71;
    color: #fff;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-size: 16px;
}
.logo-text {
    font-size: 18px;
    font-weight: bold;
    letter-spacing: 1px;
}
.top-right {
    margin-left: auto;
    flex-shrink: 0;
}
.site-badge {
    background: rgba(255,255,255,0.15);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    border: 1px solid rgba(255,255,255,0.3);
}
.help-btn {
    background: rgba(255,255,255,0.15);
    color: #fff;
    padding: 6px 18px;
    border-radius: 20px;
    font-size: 13px;
    border: 1px solid rgba(255,255,255,0.3);
    cursor: pointer;
    transition: background 0.2s;
}
.help-btn:hover {
    background: rgba(255,255,255,0.25);
}

/* ---- 使用说明弹窗 ---- */
.help-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.help-modal {
    background: #fff;
    border-radius: 12px;
    width: 92%;
    max-width: 760px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}
.help-modal-header {
    background: linear-gradient(135deg, #4a3d8a, #6a5acd);
    color: #fff;
    padding: 14px 20px;
    border-radius: 12px 12px 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 16px;
    font-weight: bold;
}
.help-modal-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}
.help-modal-body {
    padding: 16px 20px;
    overflow-y: auto;
    font-size: 13px;
    line-height: 1.6;
    color: #444;
}
.help-section {
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
}
.help-section:last-child {
    border-bottom: none;
}
.help-section-title {
    font-size: 14px;
    font-weight: bold;
    color: #4a3d8a;
    margin-bottom: 6px;
}
.help-section p {
    margin: 4px 0;
    color: #666;
}
.help-section ul {
    padding-left: 20px;
    margin: 4px 0;
}
.help-section li {
    margin: 3px 0;
}
.help-tips {
    background: #f3f0ff;
    border-radius: 8px;
    padding: 12px 16px;
    margin-top: 8px;
}
.help-tips-title {
    font-size: 13px;
    font-weight: bold;
    color: #6a5acd;
    margin-bottom: 6px;
}
.help-tips ul {
    padding-left: 20px;
    margin: 0;
}
.help-tips li {
    margin: 3px 0;
    color: #555;
}
.help-columns {
    display: flex;
    gap: 20px;
}
.help-col {
    flex: 1;
    min-width: 0;
}

/* ---- 版本导航 ---- */
.version-nav select {
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.1);
    color: #fff;
    font-size: 14px;
    cursor: pointer;
}
.version-nav select option { color: #333; background: #fff; }

/* ---- 查询导航 ---- */
.query-nav {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
    min-width: 0;
}
.nav-version {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    flex-shrink: 0;
}
.nav-version select {
    padding: 4px 10px;
    border-radius: 4px;
    border: 1px solid rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.1);
    color: #fff;
    font-size: 13px;
    min-width: 220px;
    max-width: 340px;
}
.nav-version select option { color: #333; background: #fff; }
.nav-search {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    min-width: 220px;
}
.nav-search.inline-search {
    min-width: 32px;
    max-width: 220px;
    flex: 0 0 220px;
}
.nav-search input {
    width: 100%;
    min-width: 0;
    padding: 6px 10px;
    border-radius: 4px;
    border: 1px solid rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.14);
    color: #fff;
    outline: none;
}
.nav-search input::placeholder { color: rgba(255,255,255,0.7); }
.nav-tabs {
    display: flex;
    gap: 2px;
}
.nav-tab {
    padding: 8px 18px;
    color: rgba(255,255,255,0.8);
    cursor: pointer;
    border-radius: 4px 4px 0 0;
    font-size: 14px;
    transition: all 0.2s;
    text-decoration: none;
}
.nav-tab:hover { background: rgba(255,255,255,0.1); color: #fff; }
.nav-tab.active {
    background: #f0f2f5;
    color: #e67e22;
    font-weight: bold;
}

/* ---- 控制栏 ---- */
.control-bar, .query-control-bar {
    background: #fff;
    border-bottom: 1px solid #ece8f5;
    padding: 12px 20px;
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.home-toolbar {
    margin-bottom: 8px;
}
.control-inner, .query-control-bar {
    max-width: 1600px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}
.control-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    flex-wrap: wrap;
}
.control-right { flex-shrink: 0; }
.view-tabs {
    display: flex;
    gap: 2px;
    background: #f0f0f0;
    border-radius: 6px;
    padding: 2px;
}
.tab {
    padding: 6px 16px;
    border: none;
    background: transparent;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    color: #666;
}
.tab.active { background: #6a5acd; color: #fff; }

/* ---- 搜索框 ---- */
.search-box {
    display: flex;
    align-items: center;
    gap: 6px;
}
.search-label {
    font-size: 14px;
    color: #555;
    white-space: nowrap;
    font-weight: 600;
}
.search-box input {
    padding: 9px 14px;
    border: 1px solid #d4ccf5;
    border-radius: 8px;
    font-size: 14px;
    width: 280px;
    outline: none;
    background: #f5f9ff;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.search-box input:focus {
    border-color: #6a5acd;
    box-shadow: 0 0 0 3px rgba(25,118,210,0.1);
    background: #fff;
}
.clear-btn {
    background: none;
    border: none;
    font-size: 18px;
    color: #999;
    cursor: pointer;
    padding: 0 4px;
}
.query-search input { width: 260px; }
.result-count { font-size: 13px; color: #888; white-space: nowrap; }

/* ---- 复选框 ---- */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
}

/* ---- 主内容区 ---- */
.main-content {
    max-width: 1600px;
    margin: 0 auto;
    padding: 16px 20px;
}

body.query-page .main-content {
    max-width: none;
    width: 100%;
    height: calc(100vh - 56px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

body.query-page .top-bar {
    padding: 0;
}

body.query-page .top-bar-inner {
    max-width: none;
    width: 100%;
    padding: 0 20px;
}

.current-version-bar {
    margin-bottom: 10px;
    padding: 10px 14px;
    background: #fff;
    border-radius: 8px;
    color: #4a3d8a;
    font-size: 14px;
    font-weight: bold;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    flex-shrink: 0;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: nowrap;
    min-width: 0;
}

.version-bar-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    white-space: nowrap;
}

.version-bar-center {
    flex: 1 1 auto;
    min-width: 32px;
}

.version-bar-center .nav-search input {
    color: #333;
    background: #f8f5ff;
    border-color: #d4ccf5;
    font-size: 14px;
    font-weight: 600;
    padding: 8px 12px;
}

.version-bar-center .nav-search input::placeholder {
    color: #b8a9f0;
}

.version-bar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    white-space: nowrap;
}

/* ---- 来源类型颜色 ---- */
.item-badge.source-drop {
    background: #fff3e0;
    color: #e67e22;
}
.item-badge.source-give {
    background: #e8f5e9;
    color: #2e7d32;
}
.item-badge.source-take {
    background: #ffebee;
    color: #c62828;
}
.item-badge.source-shop {
    background: #f5f5f5;
    color: #333;
}
.section-tag.source-drop { color: #e67e22; }
.section-tag.source-give { color: #2e7d32; }
.section-tag.source-take { color: #c62828; }
.section-tag.source-shop { color: #333; }

/* ---- 版本选择卡片网格 ---- */
.version-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
    padding: 12px 0;
}
.version-card {
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    border: 1px solid rgba(0,0,0,0.04);
}
.version-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 36px rgba(106,90,205,0.15);
}
.card-banner {
    position: relative;
    height: 80px;
    overflow: hidden;
}
.banner-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #1565c0 0%, #1e88e5 50%, #42a5f5 100%);
}
.banner-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 80% 20%, rgba(255,255,255,0.08) 0%, transparent 50%),
                radial-gradient(circle at 20% 80%, rgba(241,196,15,0.06) 0%, transparent 40%);
}
.banner-text {
    position: relative;
    z-index: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 0 20px;
}
.banner-text h2 {
    font-size: 22px;
    font-weight: 800;
    color: #222;
    text-shadow: none;
    letter-spacing: 6px;
}
.banner-text p {
    font-size: 13px;
    color: rgba(255,255,255,0.8);
    margin-top: 4px;
}
.card-body {
    padding: 14px 16px;
}
.card-title {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 6px;
}
.card-desc {
    font-size: 12px;
    color: #888;
    margin-bottom: 8px;
    display: none;
}
.card-stats {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.stat-item {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-size: 13px;
    font-weight: 600;
    color: #444;
    background: #f3f0ff;
    border-radius: 8px;
    padding: 8px 6px;
    min-width: 0;
}
.stat-item i {
    font-style: normal;
    font-size: 16px;
}
.stat-item em {
    font-style: normal;
    font-size: 12px;
    color: #888;
    font-weight: normal;
}
.card-engine { margin-bottom: 10px; }
.engine-tag {
    display: inline-block;
    padding: 2px 10px;
    background: #e8f5e9;
    color: #2e7d32;
    border-radius: 10px;
    font-size: 12px;
}
.card-actions {
    display: flex;
    gap: 8px;
}
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    text-align: center;
}
.btn-primary {
    background: linear-gradient(135deg, #4a3d8a, #6a5acd);
    color: #fff;
    flex: 1;
}
.btn-primary:hover {
    background: linear-gradient(135deg, #6a5acd, #7b6bdd);
    box-shadow: 0 4px 12px rgba(106,90,205,0.3);
    transform: translateY(-1px);
}
.btn-outline {
    background: transparent;
    color: #2ecc71;
    border: 1px solid #2ecc71;
    flex: 1;
}
.btn-outline:hover { background: #2ecc71; color: #fff; }

/* ---- 查询面板 ---- */
.query-panel { animation: fadeIn 0.2s; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

body.query-page .query-control-bar,
body.query-page .query-panel {
    flex-shrink: 0;
}

body.query-page .query-panel {
    flex: 1;
    min-height: 0;
}

/* ---- 四栏布局 ---- */
.four-columns {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 12px;
    height: calc(100vh - 210px);
}
.two-columns {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 12px;
    height: calc(100vh - 210px);
}
.full-column { height: calc(100vh - 210px); }

body.query-page .four-columns,
body.query-page .two-columns,
body.query-page .full-column {
    height: 100%;
    min-height: 0;
}

.column, .full-column {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}
.col-header {
    background: linear-gradient(135deg, #1565c0, #1e88e5);
    color: #fff;
    padding: 10px 14px;
    font-size: 14px;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.col-count {
    font-size: 12px;
    font-weight: normal;
    opacity: 0.8;
}
.col-body {
    flex: 1;
    overflow-y: auto;
    padding: 4px 0;
    min-height: 0;
}
.scroll-list {
    scrollbar-width: thin;
    scrollbar-color: #6a5acd #eef2fb;
    min-height: 0;
}
.scroll-list::-webkit-scrollbar {
    width: 10px;
}
.scroll-list::-webkit-scrollbar-track {
    background: #eef2fb;
}
.scroll-list::-webkit-scrollbar-thumb {
    background: #6a5acd;
    border-radius: 999px;
    border: 2px solid #eef2fb;
}
.col-footer {
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-top: 1px solid #eee;
    font-size: 12px;
}
.page-btn {
    padding: 4px 10px;
    border: 1px solid #d0d0d0;
    background: #fff;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
}
.page-btn:hover { background: #f0f0f0; }

/* ---- 列表项 ---- */
.list-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: 1px solid #f5f5f5;
    font-size: 13px;
}
.list-item:hover { background: #f8f5ff; }
.list-item.active {
    background: #3498db;
    color: #fff;
}
.list-item.active .item-num { background: #fff; color: #3498db; }
.list-item.active .item-badge { background: rgba(255,255,255,0.2); color: #fff; }

.item-num {
    width: 24px;
    height: 24px;
    background: #6a5acd;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    flex-shrink: 0;
}
.item-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.item-badge {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 11px;
    flex-shrink: 0;
}

/* ---- 占位/加载 ---- */
.placeholder, .loading {
    padding: 40px 20px;
    text-align: center;
    color: #999;
    font-size: 14px;
}
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #999;
}
.empty-state .hint { font-size: 13px; margin-top: 8px; }

/* ---- 地图项 ---- */
.map-item {
    padding: 10px 12px;
    border-bottom: 1px solid #f5f5f5;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.map-item:hover { background: #f8f5ff; }
.map-item.active {
    background: #3498db;
    color: #fff;
}
.map-item.active .map-name,
.map-item.active .map-info,
.map-item.active .map-coord {
    color: #fff;
}
.map-item .map-name {
    font-weight: bold;
    color: #4a3d8a;
}
.map-item .map-info {
    color: #888;
    font-size: 12px;
    margin-top: 2px;
}
.map-coord {
    color: #e67e22;
    font-weight: bold;
}

/* ---- 路线项 ---- */
.route-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-bottom: 1px solid #f5f5f5;
    font-size: 13px;
}
.route-arrow {
    color: #e67e22;
    font-weight: bold;
    font-size: 16px;
}
.route-map {
    color: #4a3d8a;
    font-weight: bold;
}

/* ---- NPC列表 ---- */
.npc-table {
    width: min(1180px, 96%);
    margin: 0 auto;
    border-collapse: collapse;
    font-size: 13px;
    table-layout: fixed;
}
.full-column .col-header {
    width: min(1180px, 96%);
    margin: 0 auto;
    border-radius: 0;
}
.npc-table th {
    background: #f5f7fa;
    padding: 8px 10px;
    text-align: left;
    font-weight: bold;
    border-bottom: 2px solid #e0e0e0;
}
.npc-table td {
    padding: 7px 10px;
    border-bottom: 1px solid #f0f0f0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.npc-table tr:hover td { background: #f8f5ff; }

/* ---- 怪物详情 ---- */
.detail-section { margin-bottom: 16px; }
.detail-title {
    font-size: 14px;
    font-weight: bold;
    color: #4a3d8a;
    padding: 8px 0;
    border-bottom: 2px solid #6a5acd;
    margin-bottom: 8px;
}
.drop-item {
    display: inline-block;
    padding: 4px 10px;
    margin: 2px 4px;
    background: #f5f5f5;
    border-radius: 4px;
    font-size: 12px;
}
.drop-item .drop-prob {
    color: #e67e22;
    font-weight: bold;
    margin-left: 4px;
}
.drop-group {
    color: #6a5acd;
    font-size: 11px;
    margin-left: 6px;
}

.section-tag {
    font-size: 12px;
    font-weight: bold;
    color: #4a3d8a;
    padding: 8px 12px 4px;
}

.script-item {
    padding: 10px 12px;
    border-bottom: 1px solid #f1f1f1;
}
.script-line {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}
.script-action {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: bold;
    color: #fff;
    background: #4a3d8a;
}
.script-action.give { background: #2ecc71; }
.script-action.take { background: #e67e22; }
.script-path {
    font-size: 12px;
    color: #4a3d8a;
    font-weight: bold;
}
.script-meta {
    margin-top: 4px;
    color: #777;
    font-size: 12px;
    line-height: 1.4;
}

.route-coord {
    color: #888;
    font-size: 12px;
}
.npc-script {
    color: #777;
    font-size: 12px;
}

/* ---- 响应式 ---- */
@media (max-width: 1200px) {
    .four-columns { grid-template-columns: 1fr 1fr; }
    .two-columns { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .four-columns { grid-template-columns: 1fr; }
    .version-grid { grid-template-columns: 1fr; }
    .query-nav { flex-wrap: wrap; }
    .nav-tabs { flex-wrap: wrap; }
    .current-version-bar {
        flex-wrap: wrap;
    }
    .version-bar-left,
    .version-bar-center {
        width: 100%;
        min-width: 0;
    }
    .query-control-bar, .control-bar { padding: 10px 12px; }
    .help-columns { flex-direction: column; gap: 0; }
    .help-modal { width: 96%; }
}
