/* ===== CSS Variables ===== */
:root {
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --primary-glow: rgba(79,70,229,0.15);
    --accent: #7c3aed;
    --success: #059669;
    --success-bg: rgba(5,150,105,0.08);
    --danger: #dc2626;
    --danger-bg: rgba(220,38,38,0.08);
    --warning: #d97706;
    --info: #0284c7;
    --info-bg: rgba(2,132,199,0.08);

    --bg-page: #f1f5f9;
    --bg-card: #ffffff;
    --bg-card-hover: #f8fafc;
    --bg-input: #f8fafc;
    --bg-input-focus: #ffffff;

    --border: #e2e8f0;
    --border-focus: var(--primary);

    --text: #1e293b;
    --text-muted: #64748b;
    --text-dim: #94a3b8;

    --radius-sm: 6px;
    --radius: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;

    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.08);
    --shadow-glow: 0 0 0 transparent;

    --font-main: 'Noto Sans SC', 'DM Sans', sans-serif;
    --font-mono: 'JetBrains Mono', 'Noto Sans Mono', monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0 }

/* 统一字体继承 — 全站使用 Noto Sans SC + DM Sans */
input, button, select, textarea, optgroup, option { font-family: inherit; font-size: inherit }
input[type="checkbox"], input[type="radio"] { font-family: inherit }
ul, ol, li { font-family: inherit }
/* 列表样式 */
ul, ol { padding-left: 1.5em; margin: 0.25em 0 }
li { line-height: 1.6; font-size: 0.85rem; color: var(--text) }
/* info-box 中的列表 */
.info-box ul, .info-box ol { padding-left: 1.25em; margin: 0.25em 0 }
.info-box li { font-size: 0.8rem; color: var(--text-muted); line-height: 1.65 }

/* 字体工具类 */
.font-main { font-family: var(--font-main) }
.font-mono { font-family: var(--font-mono) }

html { overflow-y: scroll }
body {
    font-family: var(--font-main);
    background: var(--bg-page);
    min-height: 100vh;
    padding: 1.5rem;
    color: var(--text);
}

/* ===== Icons (Lucide) ===== */
.icon, svg.lucide{width:1em;height:1em;display:inline-block;vertical-align:-0.1em;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0}
[data-lucide]{display:inline-flex;align-items:center;justify-content:center;width:1em;height:1em;vertical-align:-0.1em;flex-shrink:0}
.icon-sm,[data-lucide].icon-sm,svg.lucide.icon-sm{width:16px;height:16px}
.icon-md,[data-lucide].icon-md,svg.lucide.icon-md{width:20px;height:20px}
.icon-lg,[data-lucide].icon-lg,svg.lucide.icon-lg{width:24px;height:24px}
html:not(.icons-ready) [data-lucide]{opacity:0}
html.icons-ready svg.icon{opacity:1}

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 6px; height: 6px }
::-webkit-scrollbar-track { background: transparent }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 99px }
::-webkit-scrollbar-thumb:hover { background: #94a3b8 }

/* ===== Container ===== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

/* ===== Header ===== */
.header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    padding: 1.25rem 1.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}
.header-left{display:flex;align-items:center;gap:0.875rem}
.header-icon{
    width:40px;height:40px;
    background:rgba(255,255,255,0.2);
    border-radius:var(--radius);
    display:flex;align-items:center;justify-content:center;
    flex-shrink:0;
}
.header-icon .icon{width:22px;height:22px;stroke:white}
.header h1 {
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
    letter-spacing: -0.01em;
}
.header-subtitle {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.75);
    margin-top: 2px;
}
.user-info { font-size: 0.875rem }
.user-status-row {
    display: flex; align-items: center; gap: 8px;
    background: rgba(255,255,255,0.15);
    border-radius: 99px;
    padding: 6px 14px 6px 10px;
}
.status-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    flex-shrink: 0;
    transition: background 0.3s;
}
.status-dot.online { background: #34d399; box-shadow: 0 0 0 2px rgba(52,211,153,0.3) }
#userAvatar {
    width: 26px; height: 26px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.3);
    display: none;
    object-fit: cover;
}
#loginStatusText { font-size: 0.8rem; color: rgba(255,255,255,0.9) }
#kaimaInfo {
    font-family: var(--font-main) !important;
    font-size: 0.75rem;
    margin-top: 8px;
    color: rgba(255,255,255,0.8);
    line-height: 1.6;
    display: none;
    background: rgba(255,255,255,0.1);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
}
#kaimaInfo strong {
    font-family: var(--font-main) !important;
    color: white;
}
#kaimaValue,
#kaimaExpiry {
    font-family: var(--font-mono) !important;
    font-variant-numeric: tabular-nums;
}

/* ===== Nav Tabs ===== */
.nav-tabs {
    display: flex;
    background: #f1f5f9;
    border-bottom: 1px solid var(--border);
    padding: 0 1.25rem;
    overflow-x: auto;
    gap: 2px;
}
.nav-tab {
    padding: 0.875rem 1rem;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}
.nav-tab .icon{opacity:0.6}
.nav-tab:hover { color: var(--text) }
.nav-tab:hover .icon{opacity:0.8}
.nav-tab.active { color: var(--primary); border-bottom-color: var(--primary) }
.nav-tab.active .icon{opacity:1}
.nav-tab.active::after{display:none}

/* ===== Content ===== */
.content {
    display: flex;
    padding: 1.5rem;
    gap: 1.5rem;
    min-height: 580px;
}
.left-panel, .right-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    min-width: 0;
}
.tab-content { display: none; width: 100% }
.tab-content.active { display: flex; gap: 1.5rem; flex-wrap: wrap }
.tab-content.active .section {
    animation: fadeSlideIn 0.3s ease both;
}
.tab-content.active .section:nth-child(1) { animation-delay: 0ms }
.tab-content.active .section:nth-child(2) { animation-delay: 60ms }
.tab-content.active .section:nth-child(3) { animation-delay: 120ms }
.tab-content.active .section:nth-child(4) { animation-delay: 180ms }
@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateY(10px) }
    to { opacity: 1; transform: translateY(0) }
}

/* ===== Section ===== */
.section {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}
.section-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 1rem;
    padding-bottom: 0.625rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
}
.title-icon{
    width:28px;height:28px;
    background:rgba(79,70,229,0.08);
    border-radius:var(--radius-sm);
    display:flex;align-items:center;justify-content:center;
    flex-shrink:0;
}
.title-icon .icon{width:16px;height:16px;stroke:var(--primary)}

/* ===== Form Elements ===== */
.input-group { margin-bottom: 0.875rem }
.input-group:last-child { margin-bottom: 0 }
.input-group label {
    display: block;
    margin-bottom: 0.375rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
}
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    font-family: var(--font-main);
}
.input-group input:not([type="checkbox"]):not([type="radio"]),
.input-group select,
.input-group textarea {
    width: 100%;
    padding: 0.625rem 0.75rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.875rem;
    color: var(--text);
    font-family: var(--font-main);
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
    outline: none;
}
.input-group input[type="checkbox"],
.input-group input[type="radio"] {
    width: 14px;
    height: 14px;
    padding: 0;
    margin: 0;
    flex-shrink: 0;
}
/* select 背景与卡片统一 */
.input-group select {
    background: var(--bg-card);
}
.input-group input::placeholder,
.input-group textarea::placeholder { color: var(--text-dim) }
.input-group input:not([type="checkbox"]):not([type="radio"]):focus,
.input-group select:focus,
.input-group textarea:focus {
    border-color: var(--primary);
    background: var(--bg-card);
    box-shadow: 0 0 0 3px rgba(79,70,229,0.1);
}
.input-group input:not([type="checkbox"]):not([type="radio"]):disabled,
.input-group select:disabled,
.input-group textarea:disabled {
    background: var(--bg-card);
    opacity: 0.6;
    cursor: not-allowed;
}
textarea { min-height: 130px; resize: vertical; line-height: 1.55 }

/* ===== Buttons ===== */
.btn-group {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.875rem;
    flex-wrap: wrap;
}
.reg-actions-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
}
.reg-actions-row .btn {
    flex-shrink: 0;
}
.reg-local-confirm {
    margin-top: 0.75rem;
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-input);
    font-size: 0.8125rem;
}
.reg-local-confirm p {
    margin: 0 0 0.5rem;
    color: var(--text);
    line-height: 1.45;
}
.reg-local-confirm__actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: nowrap;
}
.reg-preview-result:empty::before {
    content: '点击「预览账号示例」在本地生成（不请求服务器）';
    color: var(--text-dim);
    opacity: 0.85;
}
.btn {
    padding: 0.56rem 1rem;
    border: none;
    border-radius: var(--radius);
    font-weight: 500;
    font-size: 0.8125rem;
    cursor: pointer;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    white-space: nowrap;
    font-family: inherit;
}
.btn:active { transform: scale(0.97) }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important }
.btn-primary { background: var(--primary); color: white }
.btn-primary:hover:not(:disabled) { background: var(--primary-dark) }
.btn-secondary { background: #f1f5f9; color: var(--text-muted); border: 1px solid var(--border) }
.btn-secondary:hover:not(:disabled) { background: #e2e8f0; color: var(--text) }
.btn-danger { background: var(--danger); color: white }
.btn-danger:hover:not(:disabled) { background: #b91c1c }
.btn-teal { background: var(--info); color: white }
.btn-teal:hover:not(:disabled) { background: var(--primary-dark) }
.btn.loading { color: transparent !important; pointer-events: none; position: relative }
.btn.loading::after {
    content: '';
    position: absolute;
    left: 50%; top: 50%;
    width: 14px; height: 14px;
    margin: -7px 0 0 -7px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg) } }

/* ===== Status Bar ===== */
.status-bar {
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    margin-top: 0.75rem;
    font-size: 0.8rem;
    display: none;
    align-items: center;
    gap: 6px;
}
.status-bar.show { display: flex }
.status-bar .icon{width:14px;height:14px}
.status-success { background: var(--success-bg); color: var(--success) }
.status-error { background: var(--danger-bg); color: var(--danger) }
.status-info { background: var(--info-bg); color: var(--info) }

/* ===== Info Box ===== */
.info-box {
    background: rgba(79,70,229,0.06);
    border-radius: var(--radius);
    padding: 0.875rem;
    margin-top: 0.875rem;
}
.info-box h4 {
    color: var(--primary);
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
}
.info-box p, .info-box div {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.65;
}
.info-box strong { color: var(--text); font-weight: 500 }
.info-box span { color: var(--text) }

/* ===== Save Table ===== */
.save-list-container { margin-top: 0.75rem; overflow-x: auto }
.save-table { width: 100%; border-collapse: collapse; min-width: 540px }
.save-table th {
    background: #f8fafc;
    padding: 0.625rem 0.75rem;
    text-align: left;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-dim);
    border-bottom: 1px solid var(--border);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.save-table td {
    padding: 0.625rem 0.75rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.8rem;
}
.save-table tr:last-child td { border-bottom: none }
.save-table tr:hover td { background: #f8fafc }
html.is-mobile .save-table tbody tr:hover td,
.m-body .save-table tbody tr:hover td {
    background: transparent !important;
}
.save-table th:nth-child(2),
.save-table td:nth-child(2) { max-width: 97px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.save-slot-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    min-height: 20px;
    padding: 2px 8px;
    background: var(--primary);
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    color: white;
    line-height: 1.2;
    white-space: nowrap;
}

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--text-dim);
}
.empty-state-icon {
    width: 48px; height: 48px;
    margin: 0 auto 0.625rem;
    stroke: #cbd5e1;
}
.empty-state p { font-size: 0.85rem }

/* ===== Batch Progress ===== */
.batch-progress { margin-top: 0.75rem }
.batch-progress-bar {
    height: 6px;
    background: #e2e8f0;
    border-radius: 99px;
    overflow: hidden;
}
.batch-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transition: width 0.3s ease;
    border-radius: 99px;
}
.progress-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
    font-size: 0.75rem;
    color: var(--text-muted);
}
.progress-pct {
    font-weight: 600;
    color: var(--primary);
}
.batch-log {
    max-height: 220px;
    overflow-y: auto;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.625rem;
    margin-top: 0.75rem;
    font-family: var(--font-main);
    font-size: 0.7rem;
}
.batch-log-item {
    padding: 2px 0;
    border-bottom: 1px solid var(--border);
    line-height: 1.5;
}
.batch-log-item:last-child { border-bottom: none }
.batch-log-success { color: var(--success) }
.batch-log-error { color: var(--danger) }
.batch-log-info { color: var(--info) }

/* ===== Stats Grid ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.625rem;
    margin-top: 0.75rem;
}
.stat-card {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem;
    text-align: center;
}
.stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.35;
    min-height: 1.35em;
    margin-bottom: 2px;
}
.stat-label {
    font-size: 0.65rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ===== Modal ===== */
.modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(15,23,42,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}
.modal-content {
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    width: 90%;
    max-width: 440px;
    overflow: hidden;
    animation: modalIn 0.2s ease;
}
@keyframes modalIn {
    from { opacity: 0; transform: scale(0.96) translateY(8px) }
    to { opacity: 1; transform: scale(1) translateY(0) }
}
.modal-header {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    padding: 1.125rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 10px;
}
.modal-header-icon{
    width:32px;height:32px;
    background:rgba(255,255,255,0.2);
    border-radius:var(--radius-sm);
    display:flex;align-items:center;justify-content:center;
}
.modal-header-icon .icon{width:18px;height:18px;stroke:white}
.modal-header h3 { margin: 0; font-size: 1rem; font-weight: 600; color: white }
.modal-body { padding: 1.25rem }
.modal-body p { line-height: 1.65; color: var(--text-muted); font-size: 0.875rem }
.modal-footer {
    padding: 0.875rem 1.25rem;
    display: flex;
    justify-content: flex-end;
    gap: 0.625rem;
    border-top: 1px solid var(--border);
    background: #f8fafc;
}

/* ===== Badge ===== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 99px;
    font-size: 0.65rem;
    font-weight: 600;
}
.badge-primary { background: rgba(79,70,229,0.08); color: var(--primary) }
.badge-success { background: var(--success-bg); color: var(--success) }
.selected-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    margin-left: 10px;
    background: linear-gradient(135deg, #10b981, #34d399);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 12px;
    animation: pulse 1.5s infinite;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
}
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5); transform: scale(1); }
    50% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); transform: scale(1.05); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); transform: scale(1); }
}

/* ===== Inline Input ===== */
.input-inline { display: flex; gap: 0.5rem; align-items: center }
.input-inline input { flex: 1 }

/* ===== Divider ===== */
.divider { height: 1px; background: var(--border); margin: 0.75rem 0 }

/* ===== Select Custom ===== */
.input-group select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-color: var(--bg-card);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 14px;
    padding-right: 2.25rem;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s, box-shadow 0.2s;
}
.input-group select:hover {
    border-color: #cbd5e1;
    background-color: #f1f5f9;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 14px;
}
.input-group select:active {
    border-color: var(--primary);
}
.input-group select::-ms-expand {
    display: none;
}
.input-group select option, .input-group select optgroup {
    -webkit-appearance: none;
    background: var(--bg-card);
    color: var(--text);
    padding: 6px 12px;
    font-size: 0.875rem;
    font-family: var(--font-main);
}
select {
    text-align: center;
    text-align-last: center;
    font-family: var(--font-main);
}
select option, select optgroup {
    text-align: center;
    font-family: var(--font-main);
}

/* 注册代理工具栏 — 单行横向对齐 */
.input-group .reg-proxy-toolbar .reg-proxy-row {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}
.input-group .reg-proxy-toolbar .reg-proxy-field {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}
.input-group .reg-proxy-toolbar .reg-proxy-field-name {
    flex: 0 0 auto;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-dim);
    white-space: nowrap;
    line-height: 1;
}
.input-group .reg-proxy-toolbar .reg-proxy-control {
    height: 34px !important;
    min-height: 34px !important;
    max-height: 34px !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    font-size: 0.78rem !important;
    line-height: 1 !important;
    border-radius: calc(var(--radius) - 2px) !important;
    flex: 0 0 auto;
}
.input-group .reg-proxy-toolbar .reg-proxy-qty-input {
    width: 64px !important;
    padding-left: 8px !important;
    padding-right: 8px !important;
}
.input-group .reg-proxy-toolbar .reg-proxy-refresh-select {
    width: auto !important;
    min-width: 124px !important;
    max-width: none !important;
    padding-left: 10px !important;
    padding-right: 28px !important;
    background-position: right 8px center !important;
    background-size: 12px !important;
}
.input-group .reg-proxy-toolbar .reg-proxy-refresh-btn.btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding-left: 14px !important;
    padding-right: 14px !important;
    white-space: nowrap;
}

/* ===== Archive Tab Layout ===== */
#archive-tab .left-panel {
    flex: 0 1 42%;
    max-width: 480px;
    min-width: 280px;
}
#archive-tab .right-panel {
    flex: 1 1 58%;
    max-width: none;
    min-width: 0;
}

/* ===== Crypto Tab ===== */
#crypto-tab {
    display: none !important;
    justify-content: center !important;
}
#crypto-tab.active {
    display: flex !important;
    justify-content: center !important;
    gap: 0 !important;
}
.crypto-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}
.crypto-container .input-group textarea {
    width: 100%;
    contain: content;
    will-change: transform;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    line-height: 1.5;
    word-break: break-all;
    overflow-wrap: break-word;
}
.crypto-size-hint {
    font-size: 0.7rem;
    color: var(--text-dim);
    text-align: right;
    margin-top: 2px;
    padding-right: 4px;
}
.crypto-mode-bar {
    margin-bottom: 1rem;
}
.crypto-mode-select-wrap {
    margin-bottom: 0.5rem;
}
.crypto-mode-select-wrap select {
    max-width: 420px;
}
.crypto-mode-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.55;
    margin: 0;
    padding: 0.65rem 0.85rem;
    background: var(--bg-secondary, rgba(0, 0, 0, 0.04));
    border-radius: 8px;
    border-left: 3px solid var(--primary, #6366f1);
}
.crypto-action-bar {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin: 1rem 0 1.25rem;
    flex-wrap: wrap;
}
.crypto-action-bar .btn-crypto-main {
    min-width: 8.5rem;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}
.crypto-result-group {
    margin-top: 0;
}
.crypto-util-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.45rem 0.5rem;
    margin-top: 0.85rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--border, rgba(0, 0, 0, 0.08));
}
.crypto-util-label {
    font-size: 0.72rem;
    color: var(--text-dim);
    font-weight: 600;
    margin-right: 0.15rem;
}
.crypto-util-divider {
    width: 1px;
    height: 1.25rem;
    background: var(--border, rgba(0, 0, 0, 0.12));
    margin: 0 0.25rem;
}
.btn-crypto-util {
    font-size: 0.78rem;
    padding: 0.35rem 0.65rem;
}
@media (max-width: 600px) {
    .crypto-action-bar .btn-crypto-main {
        flex: 1 1 calc(50% - 0.5rem);
        min-width: 0;
    }
    .crypto-util-bar {
        justify-content: flex-start;
    }
    .crypto-util-divider {
        display: none;
    }
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
    .tab-content.active { flex-direction: column }
    .left-panel, .right-panel { width: 100% }
}
@media (max-width: 640px) {
    body:not(.app-shell) { padding: 0.75rem }
    .content { padding: 1rem; gap: 1rem }
    .header { padding: 1rem 1.25rem; flex-direction: column; text-align: center }
    .nav-tabs { padding: 0 0.75rem }
    .btn-group { flex-direction: column }
    .btn-group .btn { width: 100% }
    .reg-actions-row { flex-direction: row; flex-wrap: nowrap }
    .reg-actions-row .btn { width: auto }
    .stats-grid { grid-template-columns: repeat(2, 1fr) }
}

/* ===== Preprocess Toggles ===== */
.preprocess-toggles {
    margin: 0.5rem 0;
    padding: 0.75rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.preprocess-toggle-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}
.preprocess-toggle-header .icon { width: 14px; height: 14px; stroke: var(--primary) }
.preprocess-toggle-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
}
.preprocess-toggle-item + .preprocess-toggle-item {
    border-top: 1px dashed var(--border);
    padding-top: 8px;
    margin-top: 2px;
}
.preprocess-toggle-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
    flex-shrink: 0;
}
.preprocess-toggle-label {
    font-size: 0.8rem;
    color: var(--text);
    cursor: pointer;
    font-weight: 500;
    font-family: var(--font-main);
}
.preprocess-toggle-desc {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 1px;
}

/* 强制 modal 内文字字体 */
.modal-overlay p,
.modal-overlay div,
.modal-overlay span { font-family: var(--font-main) }

/* 公告内容字体强制 */
#noticeContent { font-family: var(--font-main) !important }

/* ===== 全局字体强制（与 style-modern.css 变量栈一致）===== */
html,body,div,span,label,p,li,td,th,a,em,strong,b,i,u,small,sub,sup,cite,code,kbd,samp,pre,blockquote,q,caption,figcaption,summary,details,dt,dd {
    font-family: var(--font-main) !important;
}

/* 复选框/单选框旁边文字 */
.checkbox-label,
.checkbox-label span,
.checkbox-label + span,
label.checkbox-label,
div > span[style*="user-select"] {
    font-family: var(--font-main) !important;
}

/* 等宽字体 — 日志 / 代码 / 数据区 */
.batch-log, .batch-log *,
code, pre, kbd, samp,
#saveEditorData {
    font-family: var(--font-mono) !important;
}
