@import url("https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap");

:root {
    --bg-dark: #06080d;
    --bg-card: rgba(15, 18, 25, 0.95);
    --bg-card-solid: #12151e;
    --border-dark: rgba(56, 189, 248, 0.1);
    --border-glow: rgba(56, 189, 248, 0.3);
    --cyan: #38bdf8;
    --cyan-bright: #00d4ff;
    --cyan-glow: rgba(56, 189, 248, 0.5);
    --purple: #a855f7;
    --green: #22c55e;
    --green-glow: rgba(34, 197, 94, 0.5);
    --red: #ef4444;
    --amber: #f59e0b;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Outfit", sans-serif;
}
body {
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* 隐藏所有数字输入框的上下箭头 */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
input[type="number"] {
    -moz-appearance: textfield; /* 兼容 Firefox */
}

/* 优化后的全局背景 */
.grid-bg {
    position: fixed;
    inset: 0;
    z-index: -2;
    background-image:
        linear-gradient(rgba(56, 189, 248, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(56, 189, 248, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
}
.glow-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(
            ellipse at 20% 0%,
            rgba(56, 189, 248, 0.15) 0%,
            transparent 50%
        ),
        radial-gradient(
            ellipse at 80% 100%,
            rgba(168, 85, 247, 0.12) 0%,
            transparent 50%
        );
}

/* 导航与顶栏 */
.header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 100;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(6, 8, 13, 0.85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-dark);
}
.menu-btn {
    width: 44px;
    height: 44px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 6px;
    background: var(--bg-card);
    border: 1px solid var(--border-dark);
    border-radius: 12px;
    cursor: pointer;
    transition:
        border-color 0.3s,
        box-shadow 0.3s;
}
.menu-btn:hover {
    border-color: var(--cyan);
    box-shadow: 0 0 20px var(--cyan-glow);
}
.menu-btn span {
    width: 18px;
    height: 2px;
    background: var(--cyan);
    border-radius: 1px;
}

/* 品牌 Logo 全局通用样式 */
.brand-logo {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background-image: url("barkx_sq.png");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.15);
    transition: box-shadow 0.3s ease;
}

.brand-logo:hover {
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.4);
}

.wallet-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-dark);
    border-radius: 12px;
    font-family: "JetBrains Mono", monospace;
    font-size: 13px;
}
.wallet-dot {
    width: 8px;
    height: 8px;
    background: var(--green);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--green-glow);
}

/* 开启硬件加速的抽屉菜单 */
.nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(6, 8, 13, 0.8);
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transition:
        opacity 0.3s,
        visibility 0.3s;
    will-change: opacity;
}
.nav-overlay.active {
    opacity: 1;
    visibility: visible;
}
.side-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    max-width: 320px;
    z-index: 201;
    background: var(--bg-card-solid);
    transform: translateX(-100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 40px 20px;
    border-right: 1px solid var(--border-glow);
    will-change: transform;
}
.side-nav.active {
    transform: translateX(0);
}

.nav-link {
    display: block;
    padding: 16px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 18px;
    border-radius: 12px;
    margin-bottom: 8px;
    transition:
        background-color 0.3s,
        color 0.3s,
        border-color 0.3s;
    border: 1px solid transparent;
}
.nav-link:hover,
.nav-link.active {
    background: rgba(56, 189, 248, 0.1);
    color: var(--cyan);
    border-color: var(--border-dark);
}

/* 布局与通用组件 */
.main {
    padding: 90px 20px 40px;
    max-width: 600px;
    margin: 0 auto;
}
.card,
.swap-card,
.panel {
    background: var(--bg-card);
    border: 1px solid var(--border-dark);
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 20px;
}
.panel {
    display: none;
}
.panel.active {
    display: block;
    animation: fadeIn 0.3s ease;
}
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--cyan);
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border-dark);
    padding-bottom: 10px;
}
.stat-row,
.data-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    font-size: 14px;
}
.stat-row:last-child,
.data-row:last-child {
    border-bottom: none;
}
.stat-label,
.data-lbl {
    color: var(--text-secondary);
}
.stat-value,
.data-val {
    font-family: "JetBrains Mono", monospace;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}
.highlight {
    color: var(--cyan) !important;
}
.green {
    color: var(--green) !important;
}

/* Tabs 切换 */
.tabs {
    display: flex;
    overflow-x: auto;
    gap: 8px;
    margin-bottom: 20px;
    padding-bottom: 5px;
    scrollbar-width: none;
}
.tabs::-webkit-scrollbar {
    display: none;
}
.tab {
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-dark);
    border-radius: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition:
        background-color 0.3s,
        color 0.3s,
        border-color 0.3s;
    flex: 1;
    text-align: center;
}
.tab.active {
    background: rgba(56, 189, 248, 0.15);
    border-color: var(--cyan);
    color: var(--cyan);
}

/* 输入框组合 */
.input-group {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-dark);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 16px;
}
.input-header {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 10px;
}
.input-row {
    display: flex;
    align-items: center;
    gap: 12px;
}
.input-field {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    font-family: "JetBrains Mono", monospace;
    font-size: 24px;
    color: var(--text-primary);
    width: 100%;
}
.asset-badge {
    background: var(--bg-card-solid);
    border: 1px solid var(--border-dark);
    padding: 8px 12px;
    border-radius: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: default;
}
.asset-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
}
.asset-icon.barkx {
    background: linear-gradient(135deg, var(--cyan), var(--purple));
}
.asset-icon.usdt {
    background: #26a17b;
}
.asset-icon.lp {
    background: linear-gradient(135deg, var(--purple), var(--cyan));
    font-size: 10px;
}

/* 按钮 */
.btn-submit {
    width: 100%;
    padding: 16px;
    margin-top: 16px;
    background: linear-gradient(135deg, var(--cyan) 0%, #0ea5e9 100%);
    color: #000;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    text-transform: uppercase;
    box-shadow: 0 0 20px var(--cyan-glow);
    transition:
        transform 0.2s,
        box-shadow 0.2s;
}
.btn-submit:active {
    transform: scale(0.98);
}
.btn-submit.amber {
    background: linear-gradient(135deg, var(--amber) 0%, #d97706 100%);
    color: #fff;
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.3);
}
.btn-submit.purple {
    background: linear-gradient(135deg, var(--purple) 0%, #7c3aed 100%);
    color: #fff;
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.3);
}
.btn-submit.danger {
    background: linear-gradient(135deg, var(--red) 0%, #dc2626 100%);
    color: #fff;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.3);
}

.percent-btns {
    display: flex;
    gap: 6px;
    margin-top: 10px;
    justify-content: center;
}
.p-btn {
    padding: 4px 10px;
    font-size: 11px;
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid rgba(56, 189, 248, 0.3);
    color: var(--cyan);
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s;
}
.p-btn:hover {
    background: rgba(56, 189, 248, 0.2);
}

/* 其他视觉组件 */
.info-box {
    background: rgba(56, 189, 248, 0.05);
    border-left: 3px solid var(--cyan);
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.5;
}
.info-box.amber {
    border-left-color: var(--amber);
    background: rgba(245, 158, 11, 0.05);
}

.swap-direction {
    display: flex;
    justify-content: center;
    margin: -16px 0;
    position: relative;
    z-index: 2;
}
.swap-direction-btn {
    width: 40px;
    height: 40px;
    background: var(--bg-card-solid);
    border: 2px solid var(--border-dark);
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--cyan);
}
.icon-divider {
    text-align: center;
    color: var(--text-muted);
    font-size: 24px;
    margin: 10px 0;
}
