/* ============================================================
   DTS-Monaco 统一设计系统（深色主题）
   ============================================================ */
:root {
    --bg: #0b0f17;
    --bg-soft: #0f1522;
    --card: #141b2b;
    --card-2: #1a2337;
    --border: #26304a;
    --border-soft: #1f2840;
    --text: #e6edf9;
    --text-dim: #9aa7bd;
    --text-faint: #6b7a94;
    --accent: #4f8cff;
    --accent-2: #8b5cf6;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --radius: 14px;
    --shadow: 0 12px 32px rgba(2, 6, 16, 0.45);
    --gradient: linear-gradient(135deg, #4f8cff 0%, #8b5cf6 100%);
}

* {
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

html, body {
    min-height: 100%;
}

body {
    background:
        radial-gradient(1000px 500px at 85% -10%, rgba(139, 92, 246, 0.14), transparent 60%),
        radial-gradient(900px 480px at -10% 0%, rgba(79, 140, 255, 0.12), transparent 55%),
        var(--bg);
    background-attachment: fixed;
    color: var(--text);
    font-family: 'Segoe UI', 'Inter', system-ui, -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
}

a {
    color: var(--accent);
    text-decoration: none;
}

    a:hover {
        color: #79a7ff;
    }

/* ---------- 顶部导航 ---------- */
.topbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    background: rgba(11, 15, 23, 0.78);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border-soft);
}

.topbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    height: 64px;
    display: flex;
    align-items: center;
    gap: 18px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--text) !important;
    letter-spacing: 0.3px;
}

    .brand:hover {
        color: #fff !important;
        text-decoration: none;
    }

.brand-logo {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: var(--gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.95rem;
    box-shadow: 0 4px 14px rgba(79, 140, 255, 0.4);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    overflow-x: auto;
}

    .nav-links::-webkit-scrollbar {
        display: none;
    }

.nav-link-item {
    padding: 8px 14px;
    border-radius: 10px;
    color: var(--text-dim) !important;
    font-size: 0.92rem;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.2s ease;
}

    .nav-link-item:hover {
        color: var(--text) !important;
        background: rgba(255, 255, 255, 0.06);
        text-decoration: none;
    }

    .nav-link-item.active {
        color: #fff !important;
        background: rgba(79, 140, 255, 0.16);
    }

.auth-area {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px 6px 6px;
    border-radius: 999px;
    background: var(--card);
    border: 1px solid var(--border);
    color: var(--text-dim);
    font-size: 0.85rem;
    max-width: 220px;
}

    .user-chip .name {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

.avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--gradient);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.btn-logout {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-dim);
    border-radius: 10px;
    padding: 7px 14px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

    .btn-logout:hover {
        color: #fca5a5;
        border-color: rgba(239, 68, 68, 0.5);
        background: rgba(239, 68, 68, 0.08);
    }

/* ---------- 主内容 ---------- */
.app-main {
    flex: 1;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 36px 20px 60px;
}

.page-head {
    text-align: center;
    margin-bottom: 34px;
}

.page-title {
    font-size: clamp(1.6rem, 3.5vw, 2.2rem);
    font-weight: 800;
    background: linear-gradient(90deg, #e6edf9 0%, #9db8f5 60%, #b79df8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 8px;
}

.page-sub {
    color: var(--text-dim);
    font-size: 0.98rem;
    max-width: 620px;
    margin: 0 auto;
}

/* ---------- 卡片 ---------- */
.panel {
    background: linear-gradient(180deg, var(--card) 0%, var(--bg-soft) 100%);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: border-color 0.25s ease, transform 0.25s ease;
}

    .panel.pad {
        padding: 26px;
    }

    .panel:hover {
        border-color: var(--border);
    }

/* ---------- 按钮 ---------- */
.btn {
    border: none;
    border-radius: 11px;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 12px 26px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

    .btn:disabled {
        opacity: 0.55;
        cursor: not-allowed;
        transform: none !important;
        box-shadow: none !important;
    }

.btn-primary {
    background: var(--gradient);
    color: #fff;
    box-shadow: 0 6px 18px rgba(79, 140, 255, 0.35);
}

    .btn-primary:hover:not(:disabled) {
        transform: translateY(-2px);
        box-shadow: 0 10px 24px rgba(79, 140, 255, 0.45);
        color: #fff;
    }

.btn-success {
    background: linear-gradient(135deg, #16a34a, #15803d);
    color: #fff;
    box-shadow: 0 6px 18px rgba(22, 163, 74, 0.3);
}

    .btn-success:hover:not(:disabled) {
        transform: translateY(-2px);
        color: #fff;
    }

.btn-ghost {
    background: var(--card-2);
    border: 1px solid var(--border);
    color: var(--text);
}

    .btn-ghost:hover:not(:disabled) {
        border-color: var(--accent);
        color: #fff;
    }

.btn-block {
    width: 100%;
}

/* ---------- 表单 ---------- */
.field-label {
    display: block;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-dim);
    margin-bottom: 8px;
}

.input {
    width: 100%;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 11px;
    padding: 13px 15px;
    color: var(--text);
    font-size: 0.95rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    outline: none;
}

    .input::placeholder {
        color: #556179;
    }

    .input:focus {
        border-color: var(--accent);
        box-shadow: 0 0 0 3px rgba(79, 140, 255, 0.18);
    }

textarea.input {
    resize: vertical;
    min-height: 120px;
    font-family: 'Cascadia Code', Consolas, monospace;
}

/* ---------- Token 信息卡 ---------- */
.token-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    margin-bottom: 22px;
    flex-wrap: wrap;
}

.token-label {
    display: flex;
    align-items: center;
    gap: 12px;
}

.token-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: rgba(79, 140, 255, 0.14);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.token-title {
    font-weight: 600;
    color: var(--text);
    font-size: 1rem;
}

.token-desc {
    color: var(--text-dim);
    font-size: 0.84rem;
    margin: 0;
}

.token-num {
    font-size: 1.9rem;
    font-weight: 800;
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1;
}

.token-unit {
    color: var(--text-dim);
    font-size: 0.85rem;
}

/* ---------- 结果区 ---------- */
.result-area {
    display: none;
    border-radius: 12px;
    border: 1px solid var(--border-soft);
    background: var(--bg-soft);
    padding: 18px;
    margin-top: 22px;
}

    .result-area.show {
        display: block;
        animation: fadeUp 0.35s ease;
    }

    .result-area.is-success {
        border-color: rgba(34, 197, 94, 0.4);
        background: rgba(34, 197, 94, 0.06);
    }

    .result-area.is-error {
        border-color: rgba(239, 68, 68, 0.4);
        background: rgba(239, 68, 68, 0.06);
    }

    .result-area.is-loading {
        border-color: rgba(79, 140, 255, 0.4);
        background: rgba(79, 140, 255, 0.06);
    }

.result-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    gap: 10px;
}

.result-title {
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.copy-btn {
    background: transparent;
    border: none;
    color: var(--accent);
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 8px;
    transition: background 0.2s ease;
}

    .copy-btn:hover {
        background: rgba(79, 140, 255, 0.12);
    }

.result-box {
    background: var(--bg);
    border: 1px solid var(--border-soft);
    border-radius: 10px;
    padding: 14px;
    font-family: 'Cascadia Code', Consolas, monospace;
    font-size: 0.88rem;
    color: #c9d6ee;
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 280px;
    overflow: auto;
    margin: 0;
}

.copy-note {
    color: var(--success);
    font-size: 0.82rem;
    margin-top: 8px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

    .copy-note.show {
        opacity: 1;
    }

.key-display {
    font-family: 'Cascadia Code', Consolas, monospace;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.5px;
    color: #dbe7ff;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 16px;
    word-break: break-all;
}

.status-pill {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
}

    .status-pill.ok {
        background: rgba(34, 197, 94, 0.15);
        color: #4ade80;
    }

    .status-pill.bad {
        background: rgba(239, 68, 68, 0.15);
        color: #f87171;
    }

.kv-label {
    font-size: 0.8rem;
    color: var(--text-dim);
    font-weight: 600;
    margin-bottom: 4px;
}

.kv-value {
    font-weight: 600;
    color: var(--text);
    font-size: 0.92rem;
}

/* ---------- 首页功能卡片 ---------- */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 20px;
    max-width: 1080px;
    margin: 0 auto;
}

.feature-card {
    background: linear-gradient(180deg, var(--card) 0%, var(--bg-soft) 100%);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    padding: 26px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: fadeUp 0.5s ease backwards;
}

    .feature-card:hover {
        transform: translateY(-6px);
        border-color: var(--accent);
        box-shadow: 0 14px 34px rgba(2, 6, 16, 0.55);
    }

.feature-icon {
    width: 58px;
    height: 58px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 16px;
}

.feature-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
}

.feature-desc {
    font-size: 0.85rem;
    color: var(--text-dim);
    margin-bottom: 18px;
    flex: 1;
}

/* ---------- 拖拽上传区 ---------- */
.drop-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 46px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s ease;
    background: rgba(255, 255, 255, 0.015);
}

    .drop-zone:hover,
    .drop-zone.active {
        border-color: var(--accent);
        background: rgba(79, 140, 255, 0.06);
    }

.drop-zone-icon {
    font-size: 2.4rem;
    color: var(--accent);
    margin-bottom: 12px;
}

.drop-zone-text {
    font-size: 1.02rem;
    font-weight: 600;
    color: var(--text);
}

.drop-zone-hint {
    font-size: 0.85rem;
    color: var(--text-dim);
    margin-top: 4px;
}

/* ---------- 信息块 ---------- */
.info-block {
    border-left: 3px solid var(--accent);
    background: rgba(79, 140, 255, 0.06);
    border-radius: 10px;
    padding: 16px 18px;
    color: var(--text-dim);
    font-size: 0.9rem;
    line-height: 1.7;
}

    .info-block .info-title {
        color: var(--text);
        font-weight: 600;
        margin-bottom: 6px;
        font-size: 0.95rem;
    }

.divider-or {
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--text-dim);
    font-size: 0.82rem;
    margin: 22px 0;
}

    .divider-or::before,
    .divider-or::after {
        content: '';
        flex: 1;
        height: 1px;
        background: var(--border-soft);
    }

.btn-google {
    width: 100%;
    background: #fff;
    color: #1f2937;
    border-radius: 11px;
    padding: 12px;
    font-weight: 600;
    font-size: 0.92rem;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.2s ease;
}

    .btn-google:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
        color: #111;
    }

/* ---------- WhatsApp 浮动按钮 ---------- */
.wa-float {
    position: fixed;
    width: 56px;
    height: 56px;
    right: 22px;
    background: #25d366;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.7rem;
    box-shadow: 0 8px 22px rgba(37, 211, 102, 0.4);
    z-index: 1000;
    transition: all 0.25s ease;
}

    .wa-float:hover {
        transform: scale(1.1);
        color: #fff;
    }

.wa-float-1 {
    bottom: 22px;
}

.wa-float-2 {
    bottom: 90px;
    background: #128c7e;
    box-shadow: 0 8px 22px rgba(18, 140, 126, 0.4);
}

/* ---------- 页脚 ---------- */
.app-footer {
    border-top: 1px solid var(--border-soft);
    background: rgba(11, 15, 23, 0.7);
    padding: 20px;
    text-align: center;
    color: var(--text-dim);
    font-size: 0.85rem;
}

/* ---------- 动画 ---------- */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(14px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---------- 响应式 ---------- */
@media (max-width: 768px) {
    .topbar-inner {
        height: auto;
        flex-wrap: wrap;
        padding: 10px 16px;
        gap: 8px;
    }

    .nav-links {
        order: 3;
        width: 100%;
    }

    .app-main {
        padding: 24px 14px 40px;
    }

    .user-chip {
        max-width: 140px;
    }
}

/* ---------- Bootstrap 控件深色适配 ---------- */
.form-control, .form-check-input {
    background-color: var(--bg-soft);
    border-color: var(--border);
    color: var(--text);
}

    .form-control:focus {
        background-color: var(--bg-soft);
        color: var(--text);
        border-color: var(--accent);
        box-shadow: 0 0 0 3px rgba(79, 140, 255, 0.18);
    }

    .form-control::placeholder {
        color: #556179;
    }

.text-danger {
    color: #f87171 !important;
}
