/* ===== 基础重置 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --bg: #f4f6f9;
    --card: #ffffff;
    --border: #e5e9f0;
    --text: #1a2332;
    --text-secondary: #6b7a90;
    --text-muted: #9aa7b8;
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #eff4ff;
    --success: #059669;
    --danger: #dc2626;
    --warning: #d97706;
    --radius: 10px;
    --radius-sm: 6px;
    --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", "Noto Sans SC", "Source Han Sans SC", sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14.5px;
    line-height: 1.5;
    -webkit-font-smoothing: auto;
    -moz-osx-font-smoothing: auto;
}

.app { min-height: 100vh; display: flex; flex-direction: column; }

/* ===== 顶部导航 ===== */
.topbar {
    background: var(--card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}
.topbar-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
    width: 36px; height: 36px;
    background: var(--primary);
    color: #fff;
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 18px;
}
.brand-text h1 { font-size: 16px; font-weight: 600; color: var(--text); }
.brand-text span { font-size: 12px; color: var(--text-secondary); }
.topbar-status { display: flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--text-secondary); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-muted); transition: background 0.3s; }
.status-dot.running { background: var(--success); animation: pulse 1.5s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }

/* ===== 内容区 ===== */
.content { flex: 1; max-width: 1280px; width: 100%; margin: 0 auto; padding: 24px; }
.layout { display: grid; grid-template-columns: 320px 1fr; gap: 20px; align-items: start; }

/* ===== 卡片 ===== */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
}
.card-header h2 { font-size: 15px; font-weight: 600; }
.card-body { padding: 20px; }
.card-actions { display: flex; gap: 8px; }

/* ===== 表单 ===== */
.field { margin-bottom: 18px; }
.field-label { display: block; font-size: 13.5px; font-weight: 500; color: var(--text); margin-bottom: 6px; }
.field-label-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.field-value { font-size: 13px; font-weight: 600; color: var(--primary); }
.field-input {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text);
    background: var(--card);
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}
.field-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.field-hint { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.field-inline { display: flex; align-items: center; }

.checkbox { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13.5px; color: var(--text); }
.checkbox input { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; }

.slider {
    width: 100%;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--border);
    border-radius: 2px;
    outline: none;
}
.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px; height: 16px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.slider::-moz-range-thumb {
    width: 16px; height: 16px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #fff;
}

/* ===== 按钮 ===== */
.btn {
    padding: 9px 18px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn-ghost { background: transparent; color: var(--text-secondary); border: 1px solid var(--border); }
.btn-ghost:hover:not(:disabled) { background: var(--bg); color: var(--text); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-danger { color: var(--danger); }
.btn-danger:hover:not(:disabled) { background: #fef2f2; }

.action-row { display: flex; gap: 10px; margin: 20px 0; }
.action-row .btn { flex: 1; }

/* ===== 预估框 ===== */
.estimate-box {
    background: var(--bg);
    border-radius: var(--radius-sm);
    padding: 14px;
}
.estimate-title { font-size: 12px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 10px; }
.estimate-row { display: flex; justify-content: space-between; font-size: 13.5px; padding: 4px 0; }
.estimate-row span:first-child { color: var(--text-secondary); }
.estimate-row span:last-child { font-weight: 500; color: var(--text); }

/* ===== 右侧列 ===== */
.right-col { display: flex; flex-direction: column; gap: 20px; }

/* ===== 统计 ===== */
.stats-card { padding: 20px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 16px; }
.stat { text-align: center; }
.stat-num { font-size: 24px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.stat-num.stat-found { color: var(--success); }
.stat-label { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.progress-track { height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--primary); border-radius: 2px; width: 0%; transition: width 0.3s; }

/* ===== 结果表格 ===== */
.result-card { flex: 1; display: flex; flex-direction: column; }
.table-wrap { overflow-x: auto; max-height: 480px; overflow-y: auto; }
.result-table { width: 100%; border-collapse: collapse; font-size: 13px; table-layout: fixed; }
.result-table thead { position: sticky; top: 0; background: var(--bg); z-index: 1; }
.result-table th {
    padding: 10px 14px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.result-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    font-family: "SF Mono", "Consolas", "Monaco", monospace;
    font-size: 12px;
}
.result-table tbody tr:hover { background: var(--primary-light); }
.col-idx { width: 40px; text-align: center; color: var(--text-muted); }
.col-idx { width: 40px; text-align: center; }
.col-addr { width: 36%; }
.col-sk { width: 40%; }
.col-act { white-space: normal; text-align: center; min-width: 110px; }
.addr-cell { padding: 6px 10px; }
.sk-cell { padding: 6px 10px; }
.copy-input {
    width: 100%;
    padding: 4px 8px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-family: "SF Mono", "Consolas", "Monaco", monospace;
    font-size: 12px;
    color: var(--text);
    background: #fafbfc;
    outline: none;
    cursor: text;
}
.copy-input:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 2px var(--primary-light);
}
.sk-input { color: var(--text-secondary); }
.copy-btn {
    background: none; border: none; color: var(--primary);
    cursor: pointer; font-size: 12px; padding: 3px 6px;
    border-radius: 4px; transition: background 0.2s;
    display: inline-block;
    margin: 1px;
    white-space: nowrap;
}
.copy-btn:hover { background: var(--primary-light); }
.empty-row td { text-align: center; color: var(--text-muted); padding: 40px 14px; font-family: inherit; }

/* ===== 安全提示 ===== */
.notice-card {
    margin-top: 20px;
    padding: 16px 20px;
    display: flex;
    gap: 14px;
    align-items: flex-start;
    background: var(--primary-light);
    border-color: #bfdbfe;
}
.notice-icon {
    width: 24px; height: 24px;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700;
    flex-shrink: 0;
}
.notice-body strong { font-size: 13px; display: block; margin-bottom: 4px; }
.notice-body p { font-size: 12px; color: var(--text-secondary); line-height: 1.6; }

/* ===== 页脚 ===== */
.footer {
    text-align: center;
    padding: 20px;
    font-size: 12px;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    background: var(--card);
}

/* ===== 响应式 ===== */
@media (max-width: 900px) {
    .layout { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

.copy-mobile { display: none; }
.addr-text { display: none; }

/* 移动端：隐藏私钥列，地址完整换行显示，合并复制按钮 */
@media (max-width: 768px) {
    .col-sk, .sk-cell { display: none; }
    .copy-desktop { display: none !important; }
    .copy-mobile { display: inline-block; }
    .addr-text {
        display: block;
        font-family: "SF Mono", "Consolas", "Monaco", monospace;
        font-size: 12px;
        color: var(--text);
        word-break: break-all;
        line-height: 1.5;
        cursor: pointer;
        padding: 2px 0;
    }
    .col-idx { width: 30px; font-size: 11px; }
    .col-addr { width: auto; }
    .col-act { width: 60px; text-align: center; vertical-align: middle; }
    .copy-btn { padding: 5px 10px; font-size: 12px; }
    .result-table th, .result-table td { padding: 8px 8px; }
    .result-table { table-layout: auto; }
    .seo-section { padding: 20px; }
    .seo-section h2 { font-size: 18px; }
}

/* ===== 确认弹窗 ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
}
.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}
.modal-box {
    background: var(--card);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.18);
    padding: 28px 28px 22px;
    width: 380px;
    max-width: 90vw;
    text-align: center;
    transform: translateY(12px) scale(0.96);
    transition: transform 0.2s;
}
.modal-overlay.active .modal-box {
    transform: translateY(0) scale(1);
}
.modal-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #fef3c7;
    color: #d97706;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 700;
    margin: 0 auto 16px;
}
.modal-icon.danger { background: #fee2e2; color: #dc2626; }
.modal-icon.success { background: #d1fae5; color: #059669; }
.modal-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}
.modal-message {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 22px;
}
.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}
.modal-actions .btn {
    min-width: 96px;
    padding: 9px 20px;
}

/* ===== Toast 提示 ===== */
.toast-container {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1100;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}
.toast {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    padding: 12px 20px;
    font-size: 14px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 220px;
    max-width: 420px;
    transform: translateY(-16px);
    opacity: 0;
    transition: transform 0.25s, opacity 0.25s;
    pointer-events: auto;
}
.toast.show {
    transform: translateY(0);
    opacity: 1;
}
.toast-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}
.toast-icon.info { background: var(--primary); }
.toast-icon.success { background: var(--success); }
.toast-icon.warning { background: #d97706; }
.toast-icon.error { background: #dc2626; }

/* ===== SEO 内容区 ===== */
.seo-section {
    margin-top: 20px;
    padding: 28px 32px;
}
.seo-section h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 14px;
}
.seo-section h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin: 24px 0 10px;
}
.seo-section h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}
.seo-section p {
    font-size: 14px;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 12px;
}
.seo-section ul, .seo-section ol {
    margin: 0 0 14px 20px;
    font-size: 14px;
    line-height: 1.9;
    color: var(--text-secondary);
}
.seo-section li { margin-bottom: 4px; }
.seo-section strong { color: var(--text); font-weight: 600; }
.faq-item {
    background: var(--bg);
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    margin-bottom: 10px;
}
.faq-item p { margin-bottom: 0; }

/* ===== 语言切换 ===== */
.topbar-right { display: flex; align-items: center; gap: 16px; }
.lang-switch {
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.5px;
}
.lang-switch:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
/* ===== 高端靓号定制联系 ===== */
.custom-contact {
    text-align: center;
    margin-top: 14px;
    margin-bottom: 4px;
    font-size: 14px;
    color: #2563eb;
}
.tg-link {
    color: #dc2626;
    font-weight: 700;
    text-decoration: none;
}
.tg-link:hover {
    text-decoration: underline;
}
/* ===== WordPress 集成适配 ===== */
.tvg-page-main { max-width: 1240px; margin: 0 auto; padding: 28px 20px 64px; }
.tvg-page-article { margin: 0; }
.tvg-page-main .layout { grid-template-columns: 340px minmax(0, 1fr); }
.tvg-page-main .card { background: #fff; }
.tvg-page-main .result-table { min-width: 0; }
.tvg-page-main .col-addr { width: 38%; }
.tvg-page-main .col-sk { width: 40%; }
.tvg-page-main .col-act { width: 140px; }
.tvg-page-main .copy-btn { white-space: nowrap; }
@media (max-width: 980px) {
  .tvg-page-main { padding: 16px 12px 48px; }
  .tvg-page-main .layout { grid-template-columns: 1fr; }
  .tvg-page-main .col-act { width: 96px; }
}

/* ===== 移动端顶栏优化 ===== */
@media (max-width: 640px) {
  .tvg-page-main .topbar-inner { gap: 10px; padding: 10px 12px; }
  .tvg-page-main .brand { gap: 8px; min-width: 0; }
  .tvg-page-main .brand-mark { width: 34px; height: 34px; }
  .tvg-page-main .brand-text h2 { font-size: 17px; white-space: nowrap; }
  .tvg-page-main .brand-text span { font-size: 11px; white-space: nowrap; }
  .tvg-page-main .topbar-status { display: none; }
  .tvg-page-main .lang-switch { padding: 5px 10px; font-size: 12px; }
}
