/* ══════════════════════════════════════════════════════
   BattleMail — Dark Cyberpunk Theme
   ══════════════════════════════════════════════════════ */

:root {
    --bg-deep:      #0a0c14;
    --bg-card:      #111827;
    --bg-card-2:    #161f30;
    --bg-input:     #0d1520;
    --border:       #1e2d45;
    --border-glow:  #2563eb44;

    --accent:       #3b82f6;
    --accent-glow:  #3b82f688;
    --accent-dark:  #1d4ed8;
    --danger:       #ef4444;
    --danger-dark:  #b91c1c;
    --warning:      #f59e0b;
    --success:      #22c55e;
    --info:         #06b6d4;

    --text-primary:   #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted:     #475569;

    --font-main: 'Inter', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', 'Courier New', monospace;

    --radius:    10px;
    --radius-lg: 16px;
    --shadow:    0 4px 24px rgba(0,0,0,.5);
    --shadow-glow: 0 0 20px rgba(59,130,246,.15);

    --nav-h: 60px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-main);
    background: var(--bg-deep);
    color: var(--text-primary);
    min-height: 100vh;
    background-image:
            radial-gradient(ellipse 80% 50% at 50% -20%, rgba(59,130,246,.12), transparent),
            radial-gradient(ellipse 60% 40% at 80% 80%, rgba(99,102,241,.06), transparent);
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: #2d3a52; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ══ NAVBAR ══════════════════════════════════════════ */

.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--nav-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    background: rgba(10,12,20,.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 0 0 rgba(59,130,246,.08);
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-icon {
    font-size: 22px;
    filter: drop-shadow(0 0 8px var(--accent));
}

.brand-text {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: .5px;
    background: linear-gradient(135deg, #e2e8f0 30%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.navbar-nav {
    display: flex;
    gap: 8px;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 8px 18px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font-main);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all .2s ease;
}

.nav-btn:hover {
    border-color: var(--accent);
    color: var(--text-primary);
    background: rgba(59,130,246,.08);
}

.nav-btn.active {
    border-color: var(--accent);
    background: rgba(59,130,246,.15);
    color: var(--accent);
    box-shadow: 0 0 12px rgba(59,130,246,.2);
}

.nav-icon { font-size: 15px; }

/* ══ MAIN CONTAINER ══════════════════════════════════ */

.main-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 32px 24px 64px;
}

/* ── Page Sections ── */
.page { display: none; }
.page.active { display: block; }
.page.hidden { display: none !important; }

/* ── Page Header ── */
.page-header {
    margin-bottom: 28px;
}

.page-title {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.page-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
}

/* ── Two-column layout ── */
.layout-two-col {
    display: grid;
    grid-template-columns: 420px 1fr;
    gap: 20px;
    align-items: start;
}

@media (max-width: 900px) {
    .layout-two-col { grid-template-columns: 1fr; }
}

.col-left, .col-right {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ══ CARD ════════════════════════════════════════════ */

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: box-shadow .25s;
}

.card:hover {
    box-shadow: var(--shadow), var(--shadow-glow);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    background: rgba(255,255,255,.02);
}

.card-icon { font-size: 17px; }

.card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
}

.card-body {
    padding: 20px;
}

.sticky-card {
    position: sticky;
    top: calc(var(--nav-h) + 16px);
}

/* ── Badge ── */
.badge {
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    background: rgba(59,130,246,.15);
    color: var(--accent);
    border: 1px solid rgba(59,130,246,.3);
}

/* ══ FORMS ═══════════════════════════════════════════ */

.form-group {
    margin-bottom: 16px;
}

.form-group:last-child { margin-bottom: 0; }

.form-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: .5px;
    text-transform: uppercase;
    margin-bottom: 7px;
}

.form-input {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 14px;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}

.form-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--border-glow);
}

.form-input::placeholder { color: var(--text-muted); }

.form-textarea {
    resize: vertical;
    min-height: 72px;
    line-height: 1.5;
}

.form-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.form-select option { background: var(--bg-card); }

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* ── Range ── */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: calc(100% - 48px);
    height: 4px;
    border-radius: 2px;
    background: var(--border);
    outline: none;
    vertical-align: middle;
}
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    box-shadow: 0 0 6px var(--accent-glow);
}
.range-val {
    display: inline-block;
    width: 40px;
    text-align: right;
    font-size: 13px;
    font-weight: 600;
    color: var(--accent);
    vertical-align: middle;
}

/* ── Advanced Toggle ── */
.advanced-toggle {
    margin: 16px 0;
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.advanced-toggle summary {
    padding: 10px 14px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: color .2s;
}

.advanced-toggle summary::before { content: '▶'; font-size: 10px; transition: transform .2s; }
.advanced-toggle[open] summary::before { transform: rotate(90deg); }
.advanced-toggle summary:hover { color: var(--text-primary); }

.advanced-body {
    padding: 14px;
    border-top: 1px dashed var(--border);
    background: rgba(0,0,0,.2);
}

/* ══ BUTTONS ══════════════════════════════════════════ */

.btn-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    font-family: var(--font-main);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s ease;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0);
    transition: background .15s;
}

.btn:hover::after { background: rgba(255,255,255,.07); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }

.btn-icon { font-size: 15px; }

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: #fff;
    box-shadow: 0 4px 14px rgba(59,130,246,.35);
}
.btn-primary:hover { box-shadow: 0 4px 20px rgba(59,130,246,.55); }

.btn-danger {
    background: linear-gradient(135deg, var(--danger), var(--danger-dark));
    color: #fff;
    box-shadow: 0 4px 14px rgba(239,68,68,.3);
}
.btn-danger:hover { box-shadow: 0 4px 20px rgba(239,68,68,.5); }

.btn-warning {
    background: linear-gradient(135deg, var(--warning), #d97706);
    color: #111;
    box-shadow: 0 4px 14px rgba(245,158,11,.3);
}

.btn-secondary {
    background: var(--bg-card-2);
    border: 1px solid var(--border);
    color: var(--text-secondary);
}
.btn-secondary:hover { color: var(--text-primary); border-color: var(--accent); }

/* ══ STATUS BAR ══════════════════════════════════════ */

.status-bar {
    margin-top: 14px;
    padding: 10px 14px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: fadeIn .25s ease;
}
.status-bar.hidden { display: none; }
.status-bar.loading {
    background: rgba(59,130,246,.1);
    border: 1px solid rgba(59,130,246,.3);
    color: var(--accent);
}
.status-bar.success {
    background: rgba(34,197,94,.08);
    border: 1px solid rgba(34,197,94,.3);
    color: var(--success);
}
.status-bar.error {
    background: rgba(239,68,68,.08);
    border: 1px solid rgba(239,68,68,.3);
    color: var(--danger);
}

/* ══ EMAIL LIST ══════════════════════════════════════ */

.email-list { max-height: 480px; overflow-y: auto; }

.email-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background .15s;
    position: relative;
}

.email-item:last-child { border-bottom: none; }
.email-item:hover { background: rgba(59,130,246,.06); }
.email-item.selected { background: rgba(59,130,246,.12); }
.email-item.selected::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--accent);
    border-radius: 0 3px 3px 0;
}

.email-item-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #6366f1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    flex-shrink: 0;
    font-weight: 700;
    color: white;
}

.email-item-info { flex: 1; min-width: 0; }

.email-item-from {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 3px;
}

.email-item-subject {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.email-item-date {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}

/* ══ EMAIL DETAIL ═════════════════════════════════════ */

.email-meta {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 16px;
}

.meta-row {
    display: flex;
    gap: 10px;
    padding: 5px 0;
    border-bottom: 1px solid rgba(255,255,255,.04);
    font-size: 13px;
    align-items: baseline;
}
.meta-row:last-child { border-bottom: none; }

.meta-key {
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
    min-width: 60px;
    flex-shrink: 0;
}

.meta-val {
    color: var(--text-secondary);
    word-break: break-all;
}

.email-body-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
}

.tab-btn {
    padding: 6px 16px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: transparent;
    color: var(--text-muted);
    font-size: 13px;
    font-family: var(--font-main);
    font-weight: 500;
    cursor: pointer;
    transition: all .15s;
}
.tab-btn:hover { color: var(--text-primary); border-color: var(--accent); }
.tab-btn.active {
    background: rgba(59,130,246,.15);
    border-color: var(--accent);
    color: var(--accent);
}

.email-iframe {
    width: 100%;
    min-height: 420px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fff;
}

.email-body-plain { }
.email-body-plain pre {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-secondary);
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 480px;
    overflow-y: auto;
    line-height: 1.6;
}

.email-detail.hidden { display: none; }

/* ══ PLACEHOLDER ══════════════════════════════════════ */

.placeholder-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 60px 20px;
    color: var(--text-muted);
}

.placeholder-icon {
    font-size: 48px;
    opacity: .4;
    filter: grayscale(1);
}

.placeholder-area p {
    font-size: 14px;
    text-align: center;
}

/* ══ PROGRESS ═════════════════════════════════════════ */

.progress-wrap { margin-top: 18px; }
.progress-wrap.hidden { display: none; }

.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.progress-bar-track {
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #6366f1);
    border-radius: 3px;
    transition: width .3s ease;
    box-shadow: 0 0 8px var(--accent-glow);
}

/* ══ STATS GRID ══════════════════════════════════════ */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    text-align: center;
    transition: transform .2s;
}
.stat-card:hover { transform: translateY(-2px); }

.stat-num {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 4px;
    font-family: var(--font-mono);
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-normal   { border-color: rgba(34,197,94,.3);  } .stat-normal   .stat-num { color: var(--success); }
.stat-notfound { border-color: rgba(6,182,212,.3);  } .stat-notfound .stat-num { color: var(--info); }
.stat-locked   { border-color: rgba(239,68,68,.3);  } .stat-locked   .stat-num { color: var(--danger); }
.stat-failed   { border-color: rgba(245,158,11,.3); } .stat-failed   .stat-num { color: var(--warning); }

/* ══ BATTLE RESULTS ══════════════════════════════════ */

.filter-tabs {
    display: flex;
    gap: 4px;
    margin-left: auto;
}

.filter-btn {
    padding: 4px 10px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: transparent;
    color: var(--text-muted);
    font-size: 12px;
    font-family: var(--font-main);
    cursor: pointer;
    transition: all .15s;
}

.filter-btn:hover { color: var(--text-primary); }
.filter-btn.active {
    background: rgba(59,130,246,.15);
    border-color: var(--accent);
    color: var(--accent);
}

.result-list {
    max-height: 680px;
    overflow-y: auto;
}
.result-list.hidden { display: none; }

.result-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    border-bottom: 1px solid var(--border);
    transition: background .15s;
    font-size: 13px;
    gap: 12px;
}
.result-item:last-child { border-bottom: none; }
.result-item:hover { background: rgba(255,255,255,.02); }

.result-email {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text-secondary);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.result-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

.status-normal   { background: rgba(34,197,94,.12);  color: var(--success); border: 1px solid rgba(34,197,94,.3);  }
.status-notfound { background: rgba(6,182,212,.12);  color: var(--info);    border: 1px solid rgba(6,182,212,.3);  }
.status-locked   { background: rgba(239,68,68,.12);  color: var(--danger);  border: 1px solid rgba(239,68,68,.3);  }
.status-failed   { background: rgba(245,158,11,.12); color: var(--warning); border: 1px solid rgba(245,158,11,.3); }
.status-pending  { background: rgba(148,163,184,.08); color: var(--text-muted); border: 1px solid var(--border); }

/* ── Spinner ── */
.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(59,130,246,.3);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin .65s linear infinite;
    vertical-align: middle;
}

/* ── code font helper ── */
.code-font { font-family: var(--font-mono); font-size: 13px; }

/* ── hidden ── */
.hidden { display: none !important; }

/* ══ ANIMATIONS ══════════════════════════════════════ */

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.page.active { animation: fadeIn .3s ease; }

.result-item { animation: fadeIn .2s ease; }

/* ══ FOLDER TAGS (垃圾邮件 / 收件箱标记) ══════════════ */

.folder-tag {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 1px 7px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .3px;
    vertical-align: middle;
    margin-left: 5px;
    white-space: nowrap;
    flex-shrink: 0;
}

.folder-inbox {
    background: rgba(59,130,246,.12);
    color: var(--accent);
    border: 1px solid rgba(59,130,246,.3);
}

.folder-junk {
    background: rgba(239,68,68,.12);
    color: var(--danger);
    border: 1px solid rgba(239,68,68,.3);
}

/* 垃圾邮件头像 — 红色渐变 */
.email-item-avatar.avatar-junk {
    background: linear-gradient(135deg, #ef4444, #b91c1c);
    box-shadow: 0 0 8px rgba(239,68,68,.35);
}

/* 邮件详情 - 文件夹字段值（垃圾邮件时变红） */
.folder-junk-val {
    color: var(--danger) !important;
    font-weight: 600;
}

/* 列表中垃圾邮件行淡红色背景 */
.email-item:has(.folder-junk) {
    background: rgba(239,68,68,.03);
}
.email-item:has(.folder-junk):hover {
    background: rgba(239,68,68,.08);
}
.email-item.selected:has(.folder-junk) {
    background: rgba(239,68,68,.12);
}
.email-item.selected:has(.folder-junk)::before {
    background: var(--danger);
}

/* ══ EMAIL PAGE — 新布局 ════════════════════════════════ */

/* 顶部搜索栏 */
.email-search-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    align-items: center;
}

.email-search-input {
    flex: 1;
    font-size: 15px;
    padding: 12px 16px;
}

.email-search-num {
    width: 90px;
    text-align: center;
    font-size: 15px;
    padding: 12px 10px;
}

.email-search-btn {
    padding: 12px 24px;
    font-size: 15px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* 左右布局容器 */
.email-layout {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

/* 左面板 */
.email-panel-list {
    width: 360px;
    flex-shrink: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
}

/* 右面板 */
.email-panel-content {
    flex: 1;
    min-width: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    position: sticky;
    top: calc(var(--nav-h) + 16px);
}

/* 面板标题栏 */
.panel-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    background: var(--accent);
    color: #fff;
    font-weight: 600;
    font-size: 14px;
}

.panel-header-icon { font-size: 16px; }

/* 左面板列表区 */
.panel-list-body {
    max-height: 640px;
    overflow-y: auto;
}

/* 左面板邮件行 */
.email-list-item {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background .15s;
    position: relative;
}

.email-list-item:last-child { border-bottom: none; }

.email-list-item:hover { background: rgba(59,130,246,.06); }

.email-list-item.active {
    background: rgba(59,130,246,.12);
    border-left: 3px solid var(--accent);
    padding-left: 13px;
}

.email-list-subject {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 6px;
}

.email-list-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-secondary);
}

.email-list-from {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 60%;
}

.email-list-date { flex-shrink: 0; color: var(--text-muted); }

/* 右面板内容区 */
.panel-content-body {
    padding: 20px;
    min-height: 500px;
}

/* 邮件详情头部 */
.email-info-bar {
    margin-bottom: 14px;
}

.email-info-subject {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    line-height: 1.4;
    word-break: break-word;
}

.email-info-meta {
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
}

.email-info-meta strong { color: var(--text-primary); }

.email-divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 14px 0;
}

/* ══ 战网批量检测 — 核心样式 ══════════════════════════════ */

.battle-input-wrap {
    margin-bottom: 0;
}

.battle-textarea {
    width: 100%;
    min-height: 160px;
    padding: 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    color: var(--text-primary);
    resize: vertical;
    outline: none;
    font-family: var(--font-mono);
    line-height: 1.6;
    transition: border-color .2s, box-shadow .2s;
}

.battle-textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--border-glow);
}

.battle-textarea::placeholder { color: var(--text-muted); }

/* 统计与进度 */
.battle-progress-track {
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 12px;
}

.battle-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #6366f1);
    border-radius: 3px;
    transition: width .3s ease;
    box-shadow: 0 0 8px var(--accent-glow);
}

/* 结果表格 */
.battle-table-wrap {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.battle-table-header {
    display: flex;
    background: var(--bg-card-2);
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.btcol {
    padding: 14px 16px;
    font-size: 14px;
}
.btcol-email  { flex: 2; min-width: 0; }
.btcol-status { flex: 1; text-align: center; }
.btcol-code   { flex: 1; text-align: center; }
.btcol-time   { flex: 1; text-align: right; }

.battle-table-body {
    max-height: 600px;
    overflow-y: auto;
}

/* 数据行 */
.battle-row {
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-primary);
    transition: background .15s;
}
.battle-row:last-child { border-bottom: none; }
.battle-row:hover { background: rgba(59,130,246,.04); }

.battle-row .btcol-email {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.battle-row .btcol-status { text-align: center; }
.battle-row .btcol-code   { text-align: center; font-family: var(--font-mono); color: var(--accent); }
.battle-row .btcol-time   { text-align: right; color: var(--text-muted); font-size: 12px; }

/* 状态标签 (覆盖全局) */
.bstatus {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid transparent;
}
.bstatus-normal   { background: rgba(34,197,94,.12);  color: var(--success); border-color: rgba(34,197,94,.3);  }
.bstatus-locked   { background: rgba(239,68,68,.12);  color: var(--danger);  border-color: rgba(239,68,68,.3);  }
.bstatus-banned   { background: rgba(245,158,11,.12); color: var(--warning); border-color: rgba(245,158,11,.3); }
.bstatus-notfound { background: rgba(6,182,212,.12);  color: var(--info);    border-color: rgba(6,182,212,.3);  }
.bstatus-failed   { background: rgba(245,158,11,.12); color: var(--warning); border-color: rgba(245,158,11,.3); }
.bstatus-checking { background: rgba(59,130,246,.12); color: var(--accent);  border-color: rgba(59,130,246,.3); }

/* 空状态 */
.battle-empty {
    padding: 32px 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
}

/* ══ MODAL ════════════════════════════════════════════ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn .2s ease;
}

.modal-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 1100px;
    box-shadow: 0 20px 50px rgba(0,0,0,.6);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: var(--bg-card-2);
    border-bottom: 1px solid var(--border);
}

.modal-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
    transition: color .2s;
}
.modal-close:hover { color: var(--danger); }

.modal-body {
    padding: 24px;
}

.btn-sm {
    padding: 4px 10px;
    font-size: 12px;
    border-radius: 4px;
}

.btcol-action {
    width: 100px;
    flex: none;
    text-align: center;
}

/* ══ 响应式 ═══════════════════════════════════════════ */

/* 平板（≤900px） */
@media (max-width: 900px) {
    .main-container { padding: 20px 16px 48px; }
    .navbar { padding: 0 16px; }
    .brand-text { font-size: 15px; }
    .nav-btn { padding: 7px 12px; font-size: 13px; }
    .email-search-num { width: 70px; }
    .layout-two-col { grid-template-columns: 1fr; }
    .email-panel-content { position: static; }
}

/* 手机（≤640px） */
@media (max-width: 640px) {
    :root { --nav-h: 52px; }

    /* 导航 */
    .navbar { padding: 0 12px; height: var(--nav-h); }
    .brand-icon { font-size: 18px; }
    .brand-text { font-size: 14px; }
    .navbar-nav { gap: 4px; }
    .nav-btn { padding: 6px 10px; font-size: 12px; gap: 4px; }
    .nav-icon { font-size: 13px; }

    /* 页面容器 */
    .main-container { padding: 14px 12px 40px; }
    .page-title { font-size: 20px; }
    .page-subtitle { font-size: 13px; }
    .page-header { margin-bottom: 16px; }

    /* 搜索栏：竖排 */
    .email-search-bar { flex-wrap: wrap; gap: 8px; }
    .email-search-input { flex: 1 1 100%; font-size: 14px; padding: 11px 13px; }
    .email-search-num   { flex: 1; font-size: 14px; }
    .email-search-btn   { flex: 2; justify-content: center; font-size: 14px; padding: 11px 0; }

    /* 邮件布局：手机切换模式（列表/内容二选一） */
    .email-layout { flex-direction: column; gap: 0; }
    .email-panel-list {
        width: 100%;
        border-radius: var(--radius);
    }
    .email-panel-content {
        width: 100%;
        position: static;
        border-radius: var(--radius);
        display: none;
    }
    /* 点击邮件后，JS 给 .email-layout 加 .show-content 切换显示 */
    .email-layout.show-content .email-panel-list    { display: none; }
    .email-layout.show-content .email-panel-content { display: block; }

    /* 邮件列表触控优化 */
    .panel-list-body { max-height: none; }
    .email-list-item { padding: 14px 14px; }
    .email-list-subject { font-size: 14px; }
    .email-list-meta { font-size: 12px; }

    /* 邮件内容区 */
    .panel-content-body { padding: 14px; min-height: 0; }
    .email-info-subject { font-size: 16px; }
    .email-info-meta { font-size: 12px; flex-direction: column; gap: 3px; }
    .email-iframe { min-height: 300px; }
    .tab-btn { padding: 5px 10px; font-size: 12px; }

    /* 返回按钮（仅手机可见） */
    .mobile-back-btn {
        display: inline-flex !important;
        align-items: center;
        gap: 4px;
        padding: 4px 10px;
        background: rgba(255,255,255,.15);
        border: 1px solid rgba(255,255,255,.3);
        border-radius: 6px;
        color: #fff;
        font-size: 13px;
        font-weight: 600;
        cursor: pointer;
        transition: background .15s;
        white-space: nowrap;
        flex-shrink: 0;
    }
    .mobile-back-btn:hover { background: rgba(255,255,255,.25); }

    /* 战网页面 */
    .btn-group { flex-wrap: wrap; }
    .btn { flex: 1 1 auto; justify-content: center; }
    .stats-grid { gap: 8px; }
    .stat-num { font-size: 22px; }
    .filter-tabs { flex-wrap: nowrap; overflow-x: auto; }
    .filter-btn { flex-shrink: 0; }
    .card-body { padding: 14px; }
    .card-header { padding: 13px 14px; }
}

/* 超窄屏（≤360px） */
@media (max-width: 360px) {
    .nav-btn .nav-icon ~ * { display: none; }
    .nav-btn { padding: 6px 8px; }
}

/* 桌面端：返回按钮始终隐藏 */
@media (min-width: 641px) {
    .mobile-back-btn { display: none !important; }
}

/* ══ 战网速查特有样式 ══════════════════════════════ */
.code-display {
    font-size: 2rem;
    font-family: var(--font-mono);
    font-weight: 700;
    margin: 1.5rem 0;
    padding: 1.25rem;
    background-color: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    color: var(--accent);
    box-shadow: inset 0 0 10px rgba(0,0,0,0.2);
}

.copy-btn {
    background-color: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius);
    padding: 0.6rem 1.2rem;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.copy-btn:hover {
    background-color: var(--accent-dark);
    box-shadow: 0 0 10px var(--accent-glow);
}

.date-info {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-top: 1rem;
}

/* ══ GLOBAL MOBILE RESPONSIVENESS (ADDED) ══════════════ */
@media (max-width: 768px) {
    .navbar {
        padding: 0 10px;
        overflow-x: auto;
        white-space: nowrap;
        justify-content: flex-start;
    }
    .navbar-nav {
        flex-wrap: nowrap;
    }
    .nav-btn {
        padding: 8px 12px;
        font-size: 13px;
    }
    .brand-text {
        display: none; /* Hide text on very small screens to save space */
    }
    .main-container {
        padding: 16px 12px 32px;
    }

    .email-search-bar {
        display: flex;
        flex-direction: column !important;
        gap: 10px !important;
    }
    .email-search-input, .email-search-num, .email-search-btn {
        width: 100% !important;
        margin: 0 !important;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr !important;
    }

    /* Convert battle table rows to cards for mobile */
    .battle-table-header {
        display: none !important;
    }
    .battle-table-body {
        height: auto !important;
        max-height: 60vh !important;
        min-height: 200px !important;
    }
    .battle-row {
        display: flex;
        flex-direction: column !important;
        padding: 12px !important;
        margin-bottom: 10px !important;
        background: var(--bg-card) !important;
        border: 1px solid var(--border) !important;
        border-radius: var(--radius) !important;
        height: auto !important;
        gap: 6px !important;
    }
    .btcol {
        width: 100% !important;
        max-width: 100% !important;
        text-align: left !important;
        flex: none !important;
        white-space: normal !important;
        word-break: break-all !important;
    }
    .btcol-action {
        display: flex !important;
        justify-content: flex-end !important;
        gap: 10px !important;
        margin-top: 8px !important;
        border-top: 1px dashed var(--border);
        padding-top: 8px;
    }
    .result-status {
        display: inline-block !important;
    }

    /* Original/Quick query cards */
    .code-display {
        flex-direction: column;
        gap: 1rem;
        font-size: 1.5rem;
        word-break: break-all;
    }
    .card {
        padding: 1rem !important;
    }
    .card-body {
        padding: 10px !important;
    }
}
