* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; background: #f5f6f8; color: #222; }

.topbar {
    display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between;
    padding: 14px 24px; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.08); position: sticky; top: 0; z-index: 10;
}
.brand { font-size: 20px; font-weight: 700; color: #ff6a00; }
.source-tabs { display: flex; gap: 8px; align-items: center; margin-left: 12px; }
.source-tab { padding: 8px 16px; border: 1px solid #ff6a00; background: #fff; color: #ff6a00; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer; }
.source-tab:hover { background: #fff3e9; }
.source-tab.active { background: #ff6a00; color: #fff; }
.source-tabs-note { font-size: 18px; font-weight: 700; color: #ff6a00; margin-top: 6px; }

.tab-hint { margin-left: 12px; font-size: 12px; color: #b08351; }
.search { display: flex; gap: 8px; }
.search input { width: 320px; max-width: 60vw; padding: 9px 12px; border: 1px solid #ddd; border-radius: 8px; font-size: 14px; }
.search button { padding: 9px 18px; border: none; border-radius: 8px; background: #ff6a00; color: #fff; font-size: 14px; cursor: pointer; }
.search button.ghost { background: #fff; color: #ff6a00; border: 1px solid #ff6a00; }

.container { padding: 20px 24px; max-width: 1400px; margin: 0 auto; }

.token-bar { background: #fff7ef; border: 1px solid #ffe0c2; border-radius: 10px; padding: 12px 16px; margin: 14px 0; }
.token-bar label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: #8a5a2b; font-weight: 600; }
.token-bar input, .token-bar textarea { padding: 9px 12px; border: 1px solid #f0c89a; border-radius: 8px; font-size: 13px; font-weight: 400; color: #333; font-family: inherit; }
.token-bar textarea { resize: vertical; line-height: 1.6; word-break: break-all; }
.token-bar .hint { font-size: 12px; color: #b08351; margin-top: 6px; display: block; font-weight: 400; }
.token-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 10px; }
.token-actions .ghost { background: #fff; color: #ff6a00; border: 1px solid #ff6a00; padding: 7px 14px; border-radius: 8px; cursor: pointer; font-size: 13px; }
.token-actions .ghost:hover { background: #fff3e9; }
.cookie-status { font-size: 13px; color: #888; }
.cookie-status.valid { color: #1a9e55; }
.cookie-status.expired { color: #d33; font-weight: 600; }
.filters { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; background: #fff; padding: 14px 16px; border-radius: 10px; box-shadow: 0 1px 4px rgba(0,0,0,.05); }
.filters label { font-size: 13px; color: #555; display: flex; flex-direction: column; gap: 4px; }
.filters select, .filters input { padding: 7px 10px; border: 1px solid #ddd; border-radius: 7px; font-size: 13px; }
.filters #fIos { width: 150px; }  /* 需容纳「17-17.3.1」这类区间写法 */

/* 容量多选：点击式标签（手机端点按即可，无需 Ctrl/Shift） */
.chip-group { display: flex; flex-wrap: wrap; gap: 6px; max-width: 260px; }
.chip {
    padding: 7px 12px;
    min-height: 34px;              /* 触控友好 */
    background: #fff;
    color: #666;
    border: 1px solid #ddd;
    border-radius: 18px;
    font-size: 13px;
    line-height: 1.2;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.chip:hover { border-color: #ffb27a; color: #ff6a00; }
.chip.active {
    background: #ff6a00;
    border-color: #ff6a00;
    color: #fff;
    font-weight: 600;
}
.count { margin-left: auto; font-size: 13px; color: #888; }

.status { padding: 12px 4px; font-size: 14px; color: #666; min-height: 20px; }
.status.error { color: #d33; }
.status.ok { color: #2a8; }

.table-wrap { background: #fff; border-radius: 10px; box-shadow: 0 1px 4px rgba(0,0,0,.05); overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 11px 12px; text-align: left; border-bottom: 1px solid #f0f0f0; white-space: nowrap; }
th { background: #fafafa; color: #555; font-weight: 600; position: sticky; top: 0; }
tbody tr:hover { background: #fff8f2; }
td a { color: #ff6a00; text-decoration: none; }
td a:hover { text-decoration: underline; }
.img-cell { width: 56px; height: 56px; border-radius: 8px; background: #eee center/cover no-repeat; display: inline-block; }
.price { color: #ff6a00; font-weight: 700; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; }
.tag.lock-free { background: #e6f7ec; color: #1a9e55; }
.tag.lock-yes { background: #fdeaea; color: #d33; }
.tag.unknown { background: #f0f0f0; color: #999; }

.empty { text-align: center; padding: 50px; color: #999; }

/* 筛选栏内的关键词搜索框 */
.search-inline { display: flex; gap: 8px; align-items: center; margin-left: 12px; }
.search-inline input { width: 190px; padding: 8px 12px; border: 1px solid #ddd; border-radius: 8px; font-size: 13px; }
.search-inline input:focus { outline: none; border-color: #ff6a00; }
.search-inline button { padding: 8px 18px; border: none; border-radius: 8px; background: #ff6a00; color: #fff; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.search-inline button:hover { background: #e85f00; }

/* 分页控件 */
.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; padding: 16px 12px; }
.page-btn { padding: 7px 14px; border: 1px solid #ddd; background: #fff; color: #444; border-radius: 8px; font-size: 13px; cursor: pointer; }
.page-btn:hover:not(:disabled) { border-color: #ff6a00; color: #ff6a00; }
.page-btn:disabled { opacity: .45; cursor: not-allowed; }
.page-nums { display: inline-flex; gap: 6px; }
.page-num { min-width: 34px; padding: 7px 8px; text-align: center; }
.page-num.active { background: #ff6a00; border-color: #ff6a00; color: #fff; font-weight: 700; }
.pager-status { margin-left: 8px; font-size: 12px; color: #666; }
.pager-warn { color: #c60; }

/* 状态栏下方的紧凑分页 */
.pager-top { padding: 2px 0 6px; }
.pager-top .page-btn { padding: 5px 12px; font-size: 12px; }
.pager-top .page-num { min-width: 30px; padding: 5px 6px; }
.pager-top .pager-status { margin-left: 6px; }

/* 筛选栏里的次要按钮 */
.filters .ghost-btn { padding: 7px 14px; background: #fff; color: #ff6a00; border: 1px solid #ff6a00; border-radius: 8px; font-size: 13px; cursor: pointer; }
.filters .ghost-btn:hover { background: #fff3e9; }
.filters .ghost-btn.danger { color: #d33; border-color: #f3c1c1; }
.filters .ghost-btn.danger:hover { background: #fdeaea; }

/* 筛选扫描进度（选择后搜索） */
.scan-info {
    padding: 8px 14px;
    margin: 0 0 10px;
    background: #fff8f2;
    border: 1px solid #ffd9b8;
    border-radius: 8px;
    font-size: 13px;
    color: #a35a00;
}
.scan-info b { color: #ff6a00; }
.scan-info.warn { background: #fffbe6; border-color: #f5d98a; color: #8a6100; }

/* 未补全字段的占位 */
.unknown-cell { color: #bbb; cursor: help; }

/* ===== 登录 / 注册页 ===== */
.auth-body { background: linear-gradient(160deg, #fff7ef 0%, #f5f6f8 60%); min-height: 100vh; }
.auth-wrap { display: flex; justify-content: center; align-items: center; min-height: 100vh; padding: 16px; }
.auth-card { width: 380px; max-width: 100%; background: #fff; border-radius: 14px; box-shadow: 0 6px 30px rgba(0,0,0,.08); padding: 28px 26px 20px; }
.auth-brand { font-size: 20px; font-weight: 700; color: #ff6a00; text-align: center; margin-bottom: 18px; }
.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.auth-tabs button { flex: 1; padding: 9px; border: 1px solid #eee; background: #f7f7f7; border-radius: 8px; cursor: pointer; font-size: 14px; color: #666; }
.auth-tabs button.active { background: #ff6a00; border-color: #ff6a00; color: #fff; font-weight: 600; }
.auth-card form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: #555; margin-bottom: 12px; }
.auth-card input { padding: 10px 12px; border: 1px solid #ddd; border-radius: 8px; font-size: 14px; }
.auth-card input:focus { outline: none; border-color: #ff6a00; }
.auth-submit { width: 100%; padding: 11px; border: none; border-radius: 8px; background: #ff6a00; color: #fff; font-size: 15px; font-weight: 600; cursor: pointer; margin-top: 4px; }
.auth-submit:hover { background: #e85f00; }
.auth-msg { min-height: 20px; font-size: 13px; margin-top: 10px; text-align: center; }
.auth-msg.ok { color: #1a9e55; }
.auth-msg.err { color: #d33; }
.auth-note { font-size: 12px; color: #b08351; margin: 8px 0 0; }
.auth-hint { font-size: 12px; color: #999; border-top: 1px dashed #eee; padding-top: 12px; margin-top: 14px; text-align: center; }

/* ===== 用户徽标 / 顶栏用户区 ===== */
.badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; }
.badge.pending { background: #fff3e0; color: #e07800; }
.badge.approved { background: #e6f7ec; color: #1a9e55; }
.badge.rejected { background: #fdeaea; color: #d33; }
.badge.disabled { background: #f0f0f0; color: #888; }
.badge.admin { background: #fff7ef; color: #ff6a00; border: 1px solid #ffd9b3; }
.whoami { font-size: 13px; color: #666; margin: 0 4px; }
.ghost-link { font-size: 13px; color: #ff6a00; text-decoration: none; border: 1px solid #ff6a00; padding: 7px 14px; border-radius: 8px; }
.ghost-link:hover { background: #fff3e9; }

/* ===== 管理员后台 ===== */
.admin-tag { font-size: 12px; color: #888; font-weight: 400; margin-left: 8px; }
.admin-stats { font-size: 14px; color: #555; margin-bottom: 12px; }
td.ops { white-space: nowrap; }
button.op { padding: 5px 10px; margin: 2px; border: 1px solid #ddd; background: #fff; border-radius: 6px; font-size: 12px; cursor: pointer; color: #444; }
button.op:hover { border-color: #ff6a00; color: #ff6a00; }
button.op.ok { color: #1a9e55; border-color: #bfe8cf; }
button.op.danger { color: #d33; border-color: #f3c1c1; }
button.op.warn { color: #e07800; border-color: #f5d9ae; }
.admin-hint { font-size: 12px; color: #999; margin-top: 12px; }

/* 配置区折叠（Token 卡片 + 搜索请求卡片整体） */
.config-zone { display: flex; flex-direction: column; align-items: center; }
.config-zone .token-bar { width: 100%; box-sizing: border-box; }
.collapse-toggle { margin-top: 2px; padding: 4px 16px; border: 1px solid #e5e5e5; background: #fafafa; color: #999; border-radius: 12px; font-size: 12px; cursor: pointer; }
.collapse-toggle:hover { color: #ff6a00; border-color: #ffc899; }
.config-zone.collapsed > .token-bar { display: none; }
.config-zone.collapsed { padding-bottom: 4px; }
.config-zone.collapsed .collapse-toggle { margin-top: 0; }

/* ===== 底部免责声明 ===== */
.disclaimer {
    max-width: 1400px;
    margin: 28px auto 0;
    padding: 18px 24px 26px;
    border-top: 1px solid #e6e6e6;
    background: #fafbfc;
    color: #888;
    font-size: 12px;
    line-height: 1.85;
}
.disclaimer h3 {
    margin: 0 0 8px;
    font-size: 13px;
    font-weight: 600;
    color: #666;
}
.disclaimer p {
    margin: 4px 0;
    max-width: 1000px;
}
.disclaimer b {
    color: #777;
    font-weight: 600;
}

@media (max-width: 720px) {
    .search input { width: 100%; }
    .topbar { flex-direction: column; align-items: stretch; }
}

.wxp-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.wxp-row input[type="text"], .wxp-row input[type="password"] { flex: 1 1 220px; min-width: 160px; padding: 6px 10px; border: 1px solid #ddd; border-radius: 6px; font-size: 13px; }
.wxp-tip { font-size: 13px; color: #666; }
.admin-card { margin-bottom: 16px; padding: 12px 14px; border: 1px solid #eee; border-radius: 10px; background: #fcfcfc; }
.admin-card h3 { margin: 0 0 4px; font-size: 15px; }
