/* ========================================
   Axentra Dark Theme - Modern Design System
   背景: #0d0d0d | 卡片: #1a1a1a | 品牌色: #f0b90b
   ======================================== */

/* ===== CSS Variables ===== */
:root {
    /* 主色调 */
    --bg-primary: #0d0d0d;
    --bg-secondary: #1a1a1a;
    --bg-tertiary: #252525;
    --bg-card: #1a1a1a;
    --bg-input: #252525;
    
    /* 品牌色 */
    --brand-primary: #f0b90b;
    --brand-secondary: #fcd535;
    --brand-gradient: linear-gradient(135deg, #f0b90b 0%, #fcd535 100%);
    
    /* 文字色 */
    --text-primary: #ffffff;
    --text-secondary: #b7bdc6;
    --text-muted: #707a8a;
    --text-dark: #0d0d0d;
    
    /* 状态色 */
    --success: #0ecb81;
    --success-bg: rgba(14, 203, 129, 0.15);
    --danger: #f5465c;
    --danger-bg: rgba(245, 70, 92, 0.15);
    --warning: #f0b90b;
    --info: #3b82f6;
    
    /* 边框 */
    --border-color: #2a2a2a;
    --border-light: #333333;
    
    /* 圆角 */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;
    
    /* 阴影 */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(240, 185, 11, 0.3);
    
    /* 间距 */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
}

/* ===== Base Reset ===== */
*, *::before, *::after {
    box-sizing: border-box;
}

/* ===== Touch Optimization ===== */
/* 移除移动端300ms点击延迟 */
a, button, input, select, textarea, [onclick], .clickable {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

/* 导航元素快速响应 */
.bottom-nav a,
.bottom-nav-item,
.nav-item,
nav a,
.btn {
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(240, 185, 11, 0.1);
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
}

html, body {
    margin: 0;
    padding: 0;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== Typography ===== */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    margin: 0 0 var(--spacing-md);
    font-weight: 600;
}

p {
    color: var(--text-secondary);
    margin: 0 0 var(--spacing-sm);
}

a {
    color: var(--brand-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover, a:active, a:visited {
    color: var(--brand-secondary);
    text-decoration: none;
}

/* ===== Cards ===== */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.card-header {
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: var(--spacing-md);
}

.card-body {
    padding: var(--spacing-md);
}

.card-glass {
    background: rgba(26, 26, 26, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    gap: 8px;
}

.btn-primary {
    background: var(--brand-gradient);
    color: var(--text-dark);
    box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 30px rgba(240, 185, 11, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--border-light);
    border-color: var(--brand-primary);
}

.btn-success {
    background: var(--success);
    color: #ffffff;
}

.btn-success:hover {
    background: #10e68b;
}

.btn-danger {
    background: var(--danger);
    color: #ffffff;
}

.btn-danger:hover {
    background: #ff5f73;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--brand-primary);
    color: var(--brand-primary);
}

.btn-outline:hover {
    background: rgba(240, 185, 11, 0.1);
}

.btn-lg {
    padding: 16px 32px;
    font-size: 16px;
    border-radius: var(--radius-lg);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 12px;
    border-radius: var(--radius-sm);
}

.btn-block {
    width: 100%;
}

/* ===== Form Elements ===== */
.form-control {
    width: 100%;
    padding: 14px 16px;
    font-size: 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(240, 185, 11, 0.2);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-group {
    margin-bottom: var(--spacing-md);
}

/* ===== Input Groups ===== */
.input-group {
    display: flex;
    align-items: center;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.input-group .form-control {
    border: none;
    background: transparent;
}

.input-group-prepend,
.input-group-append {
    padding: 0 16px;
    display: flex;
    align-items: center;
    color: var(--text-muted);
}

/* ===== Status Labels / Badges ===== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: var(--radius-full);
    gap: 4px;
}

.badge-success {
    background: var(--success-bg);
    color: var(--success);
}

.badge-danger {
    background: var(--danger-bg);
    color: var(--danger);
}

.badge-warning {
    background: rgba(240, 185, 11, 0.15);
    color: var(--brand-primary);
}

.badge-info {
    background: rgba(59, 130, 246, 0.15);
    color: var(--info);
}

.badge-secondary {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

/* ===== Status Tags ===== */
.status-tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-pending {
    background: rgba(240, 185, 11, 0.15);
    color: var(--brand-primary);
}

.status-success {
    background: var(--success-bg);
    color: var(--success);
}

.status-failed {
    background: var(--danger-bg);
    color: var(--danger);
}

.status-processing {
    background: rgba(59, 130, 246, 0.15);
    color: var(--info);
}

/* ===== Header / Navigation ===== */
.page-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 1000;
}

.page-header-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.page-header-back,
.page-header-action {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    font-size: 20px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: background 0.2s ease;
}

.page-header-back:hover,
.page-header-action:hover {
    background: var(--bg-tertiary);
}

/* ===== Bottom Navigation ===== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 0 8px;
    padding-bottom: env(safe-area-inset-bottom, 0);
    z-index: 1000;
}

.bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 0;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s ease;
    gap: 4px;
}

.bottom-nav-item:hover,
.bottom-nav-item.active {
    color: var(--brand-primary);
}

.bottom-nav-item i {
    font-size: 22px;
}

.bottom-nav-item span {
    font-size: 11px;
    font-weight: 500;
}

/* ===== List Items ===== */
.list-item {
    display: flex;
    align-items: center;
    padding: 16px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    transition: all 0.2s ease;
}

.list-item:hover {
    background: var(--bg-tertiary);
}

.list-item-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    font-size: 20px;
}

.list-item-content {
    flex: 1;
}

.list-item-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.list-item-subtitle {
    font-size: 12px;
    color: var(--text-muted);
}

.list-item-action {
    color: var(--text-muted);
    font-size: 18px;
}

/* ===== Asset Card ===== */
.asset-card {
    background: var(--brand-gradient);
    border-radius: var(--radius-xl);
    padding: 24px;
    color: var(--text-dark);
    margin-bottom: 16px;
}

.asset-card-label {
    font-size: 13px;
    opacity: 0.8;
    margin-bottom: 8px;
}

.asset-card-value {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 24px;
}

.asset-card-actions {
    display: flex;
    gap: 12px;
}

.asset-card-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-md);
    color: var(--text-dark);
    font-weight: 600;
    font-size: 14px;
    gap: 6px;
    transition: background 0.2s ease;
}

.asset-card-btn:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* ===== Crypto Item ===== */
.crypto-item {
    display: flex;
    align-items: center;
    padding: 16px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
}

.crypto-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 12px;
}

.crypto-info {
    flex: 1;
}

.crypto-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.crypto-pair {
    font-size: 12px;
    color: var(--text-muted);
}

.crypto-price {
    text-align: right;
}

.crypto-price-value {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.crypto-change {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    margin-top: 4px;
}

.crypto-change.up {
    background: var(--success-bg);
    color: var(--success);
}

.crypto-change.down {
    background: var(--danger-bg);
    color: var(--danger);
}

/* ===== Modal / Dialog ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 16px;
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    display: flex;
    gap: 12px;
    padding: 20px;
    border-top: 1px solid var(--border-color);
}

/* ===== Page Content ===== */
.page-content {
    padding-top: 56px;
    padding-bottom: 70px;
    min-height: 100vh;
}

.page-content-no-header {
    padding-top: 0;
}

.page-content-no-footer {
    padding-bottom: 0;
}

.section {
    padding: var(--spacing-md);
}

.section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-md);
}

/* ===== Empty State ===== */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.empty-state-icon {
    font-size: 64px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.empty-state-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.empty-state-text {
    font-size: 14px;
    color: var(--text-muted);
}

/* ===== Utility Classes ===== */
.text-primary { color: var(--text-primary) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-brand { color: var(--brand-primary) !important; }
.text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }

.bg-primary { background: var(--bg-primary) !important; }
.bg-secondary { background: var(--bg-secondary) !important; }
.bg-card { background: var(--bg-card) !important; }
.bg-brand { background: var(--brand-primary) !important; }
.bg-gradient { background: var(--brand-gradient) !important; }

.rounded-sm { border-radius: var(--radius-sm) !important; }
.rounded-md { border-radius: var(--radius-md) !important; }
.rounded-lg { border-radius: var(--radius-lg) !important; }
.rounded-xl { border-radius: var(--radius-xl) !important; }
.rounded-full { border-radius: var(--radius-full) !important; }

.shadow-sm { box-shadow: var(--shadow-sm) !important; }
.shadow-md { box-shadow: var(--shadow-md) !important; }
.shadow-lg { box-shadow: var(--shadow-lg) !important; }
.shadow-glow { box-shadow: var(--shadow-glow) !important; }

.flex { display: flex !important; }
.flex-col { flex-direction: column !important; }
.items-center { align-items: center !important; }
.justify-center { justify-content: center !important; }
.justify-between { justify-content: space-between !important; }
.gap-sm { gap: var(--spacing-sm) !important; }
.gap-md { gap: var(--spacing-md) !important; }

.w-full { width: 100% !important; }
.h-full { height: 100% !important; }

.p-sm { padding: var(--spacing-sm) !important; }
.p-md { padding: var(--spacing-md) !important; }
.p-lg { padding: var(--spacing-lg) !important; }

.m-0 { margin: 0 !important; }
.mb-sm { margin-bottom: var(--spacing-sm) !important; }
.mb-md { margin-bottom: var(--spacing-md) !important; }
.mb-lg { margin-bottom: var(--spacing-lg) !important; }

.text-center { text-align: center !important; }
.text-right { text-align: right !important; }
.text-left { text-align: left !important; }

.font-bold { font-weight: 700 !important; }
.font-semibold { font-weight: 600 !important; }
.font-medium { font-weight: 500 !important; }

.text-xs { font-size: 11px !important; }
.text-sm { font-size: 12px !important; }
.text-base { font-size: 14px !important; }
.text-lg { font-size: 16px !important; }
.text-xl { font-size: 18px !important; }
.text-2xl { font-size: 24px !important; }
.text-3xl { font-size: 32px !important; }

/* ===== Transitions ===== */
.transition-all {
    transition: all 0.2s ease;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== Safe Area ===== */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .page-content {
        padding-bottom: calc(70px + env(safe-area-inset-bottom));
    }
    
    .bottom-nav {
        padding-bottom: env(safe-area-inset-bottom);
    }
}
