/* ============================================================
   梦幻西游跑商协同价格记录 - 公共样式（现代清新 · 轻量 SaaS 风）
   设计令牌：白底 + 浅灰蓝背景 / 靛蓝主色 #4F6EF7 / 成功绿 #10B981
   ============================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
    font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
    background: #f6f8fa;
    color: #1a1b1c;
    padding: 12px;
    font-size: 13.5px;
    -webkit-font-smoothing: antialiased;
}
.container { max-width: 1680px; margin: 0 auto; }

/* ===== 顶部单行信息条 ===== */
.topbar {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    padding: 10px 16px;
    background: #fff;
    border: 1px solid #e4e7ee;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(16, 24, 40, 0.05);
    font-size: 13px;
    margin-bottom: 12px;
}
.brand { font-size: 16px; font-weight: 700; color: #4f6ef7; white-space: nowrap; letter-spacing: .5px; }
.brand .sub { font-size: 12px; color: #8a94a6; font-weight: 400; margin-left: 6px; }
.tinfo { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; color: #5b6472; }
.tinfo b { font-weight: 700; margin: 0 2px; }
.tinfo .shichen { color: #dc2626; }
.tinfo .cd { color: #10b981; }
.tinfo .cd.warning { color: #dc2626; font-weight: 700; }
.tinfo .ercha { color: #f59e0b; }
.tinfo .ercha.warning { color: #dc2626; font-weight: 700; }
.tinfo .phase { color: #7c8aa8; font-size: 12px; }
.ercha-set { display: flex; align-items: center; gap: 6px; color: #6b7280; white-space: nowrap; }
.ercha-set input[type="number"] {
    width: 52px; padding: 4px 6px;
    border: 1px solid #d9dee8; border-radius: 8px;
    font-size: 13px; color: #1a1b1c;
    background: #fff;
}
.ercha-set input[type="number"]:focus { outline: none; border-color: #4f6ef7; box-shadow: 0 0 0 3px rgba(79, 110, 247, .12); }
.ercha-set button {
    padding: 5px 14px;
    background: #4f6ef7; color: #fff;
    border: none; border-radius: 8px;
    cursor: pointer; font-size: 13px;
    margin-left: 6px; transition: background .15s;
}
.ercha-set button:hover { background: #3b5bdb; }
.ercha-set .ercha-status { font-size: 12px; color: #8a94a6; margin-left: 6px; }
.sync { display: flex; align-items: center; gap: 5px; font-size: 12px; color: #8a94a6; margin-left: auto; }
.sync .dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: #10b981; display: inline-block;
    animation: pulse 2s infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

/* ===== 5 场景横排 ===== */
.places { display: flex; gap: 10px; flex-wrap: wrap; }
.place-card {
    flex: 1 1 200px;
    min-width: 190px;
    background: #fff;
    border: 1px solid #e4e7ee;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 1px 3px rgba(16, 24, 40, 0.05);
}
.place-header {
    background: linear-gradient(135deg, #4f6ef7, #6c8bff);
    color: #fff;
    padding: 7px 10px;
    font-size: 14px;
    font-weight: 700;
    text-align: center;
    letter-spacing: 1px;
}
.table-wrap { overflow-x: auto; flex: 1; }
.price-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    table-layout: fixed;
}
.price-table th {
    background: #eef1fe;
    color: #3b5bdb;
    padding: 5px 2px;
    font-size: 11px;
    font-weight: 600;
    border: 1px solid #dfe5f8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.price-table th:nth-child(1) { width: 30%; }
.price-table th:nth-child(n+2) { width: 17.5%; }
.price-table td {
    border: 1px solid #edf0f5;
    padding: 3px 2px;
    text-align: center;
    vertical-align: middle;
    overflow: hidden;
}
.price-table td.gname {
    text-align: left;
    background: #fafbfe;
    padding: 3px 6px;
}
.gname-line { font-weight: 700; font-size: 13px; line-height: 1.3; color: #1a1b1c; }
.gref { font-size: 10px; color: #9aa4b5; font-weight: 400; line-height: 1.3; word-break: break-all; }
.price-table td.better { background: #e7f8f1; }
.price-table td.better input { border-color: #10b981; background: #e7f8f1; }
.price-cell {
    width: 100%;
    min-width: 0;
    padding: 4px 3px;
    border: 1px solid #d9dee8;
    border-radius: 7px;
    font-size: 13px;
    text-align: center;
    color: #1a1b1c;
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
}
.price-cell.up { border-color: #dc2626; }
.price-cell.down { border-color: #10b981; }
.price-cell:focus { outline: none; border-color: #4f6ef7; box-shadow: 0 0 0 3px rgba(79, 110, 247, .12); background: #fff; }
.footer { text-align: center; margin-top: 12px; padding: 6px; color: #aab2c0; font-size: 12px; }
.footer a { color: #7c8aa8; }

/* ===== 区服切换 + 选择弹窗 ===== */
.server-switch { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.server-switch button {
    padding: 5px 14px; background: #4f6ef7; color: #fff;
    border: none; border-radius: 8px; cursor: pointer; font-size: 13px;
    transition: background .15s;
}
.server-switch button:hover { background: #3b5bdb; }
.modal-mask {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(17, 24, 39, 0.5); z-index: 1000;
    display: flex; align-items: center; justify-content: center;
}
.modal {
    width: 380px; max-width: 92vw; max-height: 80vh;
    background: #fff; border-radius: 14px; overflow: hidden;
    display: flex; flex-direction: column;
    box-shadow: 0 12px 40px rgba(16, 24, 40, 0.18);
}
.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px;
    background: linear-gradient(135deg, #4f6ef7, #6c8bff);
    color: #fff; font-size: 15px; font-weight: 700;
}
.modal-close { background: none; border: none; color: #fff; font-size: 20px; cursor: pointer; line-height: 1; opacity: .85; }
.modal-close:hover { opacity: 1; }
.modal-search { padding: 12px 16px; border-bottom: 1px solid #eef0f5; }
.modal-search input { width: 100%; padding: 8px 12px; border: 1px solid #d9dee8; border-radius: 8px; font-size: 13px; }
.modal-search input:focus { outline: none; border-color: #4f6ef7; box-shadow: 0 0 0 3px rgba(79, 110, 247, .12); }
.server-list { flex: 1; overflow-y: auto; padding: 8px 10px; min-height: 120px; }
.server-item {
    padding: 9px 12px; border-radius: 8px; cursor: pointer; font-size: 13px; color: #1a1b1c;
    display: flex; justify-content: space-between; align-items: center;
    transition: background .12s;
}
.server-item:hover { background: #f3f5fd; }
.server-item.active { background: #eef1fe; color: #3b5bdb; font-weight: 700; }
.server-item .cur-tag { font-size: 11px; color: #4f6ef7; background: #e2e8ff; padding: 1px 8px; border-radius: 999px; }
.modal-footer { padding: 12px 16px; border-top: 1px solid #eef0f5; display: flex; gap: 8px; align-items: center; }
.modal-footer input { flex: 1; padding: 8px 12px; border: 1px solid #d9dee8; border-radius: 8px; font-size: 13px; }
.modal-footer input:focus { outline: none; border-color: #4f6ef7; box-shadow: 0 0 0 3px rgba(79, 110, 247, .12); }
.modal-footer button {
    padding: 8px 16px; background: #4f6ef7; color: #fff;
    border: none; border-radius: 8px; cursor: pointer; font-size: 13px; white-space: nowrap;
    transition: background .15s;
}
.modal-footer button:hover { background: #3b5bdb; }
.modal-empty { padding: 20px; text-align: center; color: #9aa4b5; font-size: 12px; }

@media (max-width: 1200px) {
    .place-card { flex: 1 1 300px; min-width: 260px; }
}
