* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: "Microsoft YaHei", "PingFang SC", sans-serif; background: #f0f2f5; color: #333; }
.hidden { display: none !important; }
.muted { color: #888; font-size: 13px; }
.warn { color: #b26a00; font-size: 13px; background: #fff7e6; padding: 8px; border-radius: 4px; }
a { color: #4a7dff; }

/* 登录 */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; z-index: 100; }
.login-box { background: #fff; padding: 28px; border-radius: 10px; width: 380px; max-width: 92vw; box-shadow: 0 8px 30px rgba(0,0,0,.2); }
.login-box h2, .login-box h3 { margin-bottom: 12px; }
.login-box input { width: 100%; padding: 10px; margin: 10px 0; border: 1px solid #ddd; border-radius: 6px; font-size: 14px; }
.error-text { color: #d4380d; font-size: 13px; min-height: 18px; margin-top: 6px; }

/* 顶栏 */
header { display: flex; justify-content: space-between; align-items: center; background: #1f2d3d; color: #fff; padding: 12px 20px; }
.brand { font-size: 18px; font-weight: bold; }
.tag { font-size: 12px; background: #4a7dff; padding: 2px 8px; border-radius: 10px; vertical-align: middle; }
.top-actions { display: flex; align-items: center; gap: 14px; }
.balance-box b { color: #ffd666; }
.api-status { font-size: 12px; background: #ff7875; padding: 3px 10px; border-radius: 10px; }
.api-status.ok { background: #52c41a; }

/* 按钮 */
.btn { padding: 7px 14px; border: 1px solid #d9d9d9; background: #fff; border-radius: 6px; cursor: pointer; font-size: 14px; }
.btn:hover { border-color: #4a7dff; color: #4a7dff; }
.btn.primary { background: #4a7dff; color: #fff; border-color: #4a7dff; }
.btn.primary:hover { background: #3564e0; }
.btn.danger { color: #d4380d; border-color: #ffa39e; }
.btn.mini { padding: 3px 8px; font-size: 12px; }
.btn.block { width: 100%; }

/* 主区 */
main { padding: 16px 20px; max-width: 1400px; margin: 0 auto; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.tab { padding: 9px 18px; border: none; background: #e4e8ee; border-radius: 8px 8px 0 0; cursor: pointer; font-size: 14px; }
.tab.active { background: #fff; font-weight: bold; box-shadow: 0 -2px 6px rgba(0,0,0,.06); }
.badge { background: #ff4d4f; color: #fff; border-radius: 10px; padding: 1px 7px; font-size: 12px; }
.badge:empty { display: none; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.panel { background: #fff; padding: 16px; border-radius: 8px; margin-bottom: 14px; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.panel h3 { margin-bottom: 10px; font-size: 15px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 8px 0; }

input, select { padding: 8px 10px; border: 1px solid #d9d9d9; border-radius: 6px; font-size: 14px; }
select { min-width: 220px; }
#countrySearch { width: 150px; }

/* 表格 */
.table-wrap { background: #fff; border-radius: 8px; overflow: auto; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { background: #fafafa; text-align: left; padding: 10px; border-bottom: 2px solid #f0f0f0; white-space: nowrap; }
td { padding: 9px 10px; border-bottom: 1px solid #f5f5f5; }
tr:hover td { background: #f9fbff; }
.mono { font-family: Consolas, monospace; }

/* 状态标签 */
.status { padding: 2px 10px; border-radius: 10px; font-size: 12px; white-space: nowrap; }
.status.WAITING { background: #fff7e6; color: #d48806; }
.status.SUCCESS { background: #f6ffed; color: #389e0d; }
.status.COMPLETED { background: #e6f4ff; color: #0958d9; }
.status.CANCELED, .status.REFUNDED { background: #fff1f0; color: #cf1322; }

.stats { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 10px; font-size: 13px; }
.stat-chip { background: #f5f7fa; border-radius: 6px; padding: 6px 12px; }

#toast { position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%); background: #333; color: #fff; padding: 10px 20px; border-radius: 8px; opacity: 0; transition: opacity .3s; pointer-events: none; z-index: 200; }
#toast.show { opacity: 1; }
#keyVerifyResult { margin-top: 8px; font-size: 13px; }
#buyInfo { background: #f5f7fa; padding: 12px; border-radius: 6px; margin: 10px 0; line-height: 1.9; }

/* 最低价提示与徽标 */
.cheapest-hint { font-size: 13px; color: #389e0d; background: #f6ffed; border-radius: 4px; padding: 6px 10px; margin: 8px 0; }
.cheapest-tag { background: #52c41a; color: #fff; font-size: 11px; padding: 1px 6px; border-radius: 8px; margin-left: 4px; }
#buyTotal { color: #d4380d; font-size: 13px; }
