/*
==========================================================================
WOAIL VIP - 一站式数字化工作空间
基于 templatemo_609_crypto_vault 样式
==========================================================================
*/

/* ========================================
   CSS Reset & Base
======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ========================================
   CSS Variables - Dark Theme (Default)
======================================== */
:root, [data-theme="dark"] {
    --bg-primary: #1c1c1e;
    --bg-secondary: #232325;
    --bg-card: #2c2c2e;
    --bg-card-hover: #343436;
    --accent-copper: #b87333;
    --accent-copper-light: #c9845a;
    --accent-gradient: linear-gradient(135deg, #b87333 0%, #d4945a 50%, #c9845a 100%);
    --accent-gradient-hover: linear-gradient(135deg, #c9845a 0%, #daa57a 50%, #d4945a 100%);
    --text-primary: #f5f0e8;
    --text-secondary: #a8a8a8;
    --text-muted: #6e6e6e;
    --gain: #6b8e6b;
    --loss: #c27878;
    --border: #3a3a3c;
    --shadow: rgba(0, 0, 0, 0.3);
    --chart-grid: rgba(255, 255, 255, 0.05);
    --overlay: rgba(0, 0, 0, 0.5);
}

/* ========================================
   CSS Variables - Light Theme
======================================== */
[data-theme="light"] {
    --bg-primary: #f5f5f7;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #f0f0f2;
    --accent-copper: #d4945a;
    --accent-copper-light: #e8b88a;
    --accent-gradient: linear-gradient(135deg, #d4945a 0%, #e8b88a 50%, #f0c89a 100%);
    --accent-gradient-hover: linear-gradient(135deg, #e8b88a 0%, #f0c89a 50%, #f5d4a8 100%);
    --text-primary: #1c1c1e;
    --text-secondary: #6e6e6e;
    --text-muted: #9a9a9a;
    --gain: #5a9a5a;
    --loss: #c76b6b;
    --border: #e0e0e2;
    --shadow: rgba(0, 0, 0, 0.08);
    --chart-grid: rgba(0, 0, 0, 0.05);
    --overlay: rgba(0, 0, 0, 0.5);
}

/* ========================================
   Body & Typography
======================================== */
body {
    font-family: 'Instrument Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    font-size: 18px;
    line-height: 1.6;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.25;
    color: var(--text-primary);
}

p { color: var(--text-secondary); }

a {
    color: var(--accent-copper);
    text-decoration: none;
    transition: color 0.2s ease;
}
a:hover { color: var(--accent-copper-light); }

/* ========================================
   Buttons
======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid var(--border);
    background-color: transparent;
    color: var(--text-primary);
    text-decoration: none;
}

.btn:hover {
    background-color: var(--bg-card-hover);
}

.btn-primary {
    background: var(--accent-gradient);
    border: none;
    color: #1c1c1e;
}

.btn-primary:hover {
    background: var(--accent-gradient-hover);
    transform: translateY(-2px);
}

.btn-danger {
    color: var(--loss);
    border-color: var(--loss);
}

.btn-danger:hover {
    background-color: rgba(194, 120, 120, 0.15);
}

.btn-sm { padding: 8px 16px; font-size: 14px; border-radius: 8px; }
.btn-lg { padding: 16px 32px; font-size: 18px; border-radius: 12px; }
.btn-block { width: 100%; }

.btn-ghost {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
}
.btn-ghost:hover {
    border-color: var(--accent-copper);
    color: var(--text-primary);
}

/* ========================================
   Form Elements
======================================== */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.form-group {
    margin-bottom: 24px;
}

.form-group.full-width {
    grid-column: span 2;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 14px 18px;
    background-color: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 16px;
    font-family: inherit;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-copper);
}

.form-input::placeholder {
    color: var(--text-muted);
}

textarea.form-input { resize: vertical; min-height: 100px; }

.form-select {
    width: 100%;
    padding: 14px 18px;
    background-color: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 16px;
    font-family: inherit;
    color: var(--text-primary);
    cursor: pointer;
    appearance: none;
}

.form-select:focus {
    outline: none;
    border-color: var(--accent-copper);
}

.form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 24px;
}

@media (max-width: 640px) {
    .form-grid { grid-template-columns: 1fr; }
    .form-group.full-width { grid-column: span 1; }
}

/* ========================================
   Cards
======================================== */
.card {
    background-color: var(--bg-card);
    border-radius: 14px;
    padding: 28px;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    gap: 12px;
}

.card-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.card-description {
    font-size: 14px;
    color: var(--text-secondary);
}

.card-body { margin-top: 12px; }
.card-link {
    font-size: 14px;
    color: var(--accent-copper);
    text-decoration: none;
    font-weight: 500;
}
.card-link:hover { color: var(--accent-copper-light); }

/* ========================================
   Stat Cards
======================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background-color: var(--bg-card);
    border-radius: 14px;
    padding: 20px;
    border: 1px solid var(--border);
    display: flex;
    align-items: flex-start;
    gap: 16px;
    transition: all 0.3s ease;
}

.stat-card:hover {
    border-color: var(--accent-copper);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px var(--shadow);
}

.stat-card.primary {
    background: var(--accent-gradient);
    border: none;
}

.stat-card.primary .stat-label,
.stat-card.primary .stat-value,
.stat-card.primary .stat-change {
    color: #1c1c1e;
}

.stat-card.primary .stat-icon {
    background-color: rgba(28, 28, 30, 0.2);
}

.stat-card.primary .stat-icon svg {
    stroke: #1c1c1e;
}

.stat-icon {
    width: 48px;
    height: 48px;
    background-color: rgba(184, 115, 51, 0.15);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon svg {
    stroke: var(--accent-copper);
    width: 24px;
    height: 24px;
}

.stat-content { flex: 1; min-width: 0; }
.stat-label { font-size: 13px; color: var(--text-secondary); margin-bottom: 4px; }
.stat-value { font-size: 24px; font-weight: 700; color: var(--text-primary); margin-bottom: 4px; }
.stat-change { font-size: 13px; color: var(--text-muted); }
.stat-change.positive { color: var(--gain); }
.stat-change.negative { color: var(--loss); }

/* ========================================
   Tags / Badges
======================================== */
.tag {
    display: inline-block;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 6px;
    background-color: rgba(184, 115, 51, 0.15);
    color: var(--accent-copper);
}
.tag-success { background-color: rgba(107, 142, 107, 0.15); color: var(--gain); }
.tag-danger { background-color: rgba(194, 120, 120, 0.15); color: var(--loss); }
.tag-muted { background-color: var(--bg-primary); color: var(--text-muted); }

/* ========================================
   Toggle Switches
======================================== */
.toggle-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}
.toggle-item:last-child { border-bottom: none; }
.toggle-info { flex: 1; }
.toggle-title { font-size: 16px; font-weight: 600; color: var(--text-primary); margin-bottom: 4px; }
.toggle-description { font-size: 14px; color: var(--text-secondary); }

.toggle-switch {
    position: relative;
    width: 52px;
    height: 28px;
    background-color: var(--border);
    border-radius: 14px;
    cursor: pointer;
    transition: background 0.3s ease;
    flex-shrink: 0;
}
.toggle-switch::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    background-color: var(--text-primary);
    border-radius: 50%;
    transition: transform 0.3s ease;
}
.toggle-switch.active {
    background: var(--accent-gradient);
}
.toggle-switch.active::after {
    transform: translateX(24px);
    background-color: #1c1c1e;
}

/* ========================================
   Utility
======================================== */
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col { display: flex; flex-direction: column; }
.gap-sm { gap: 8px; } .gap-md { gap: 16px; } .gap-lg { gap: 24px; }
.mt-sm { margin-top: 8px; } .mt-md { margin-top: 16px; } .mt-lg { margin-top: 24px; }
.mb-sm { margin-bottom: 8px; } .mb-md { margin-bottom: 16px; } .mb-lg { margin-bottom: 24px; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-success { color: var(--gain); }
.text-danger { color: var(--loss); }
.fs-sm { font-size: 14px; }
.fs-lg { font-size: 20px; }
.fw-bold { font-weight: 700; }
.hidden { display: none !important; }
.w-full { width: 100%; }

/* ========================================
   Toast
======================================== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}
.toast {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent-copper);
    border-radius: 10px;
    padding: 14px 20px;
    box-shadow: 0 8px 24px var(--shadow);
    min-width: 280px;
    animation: slideIn 0.3s ease;
    pointer-events: auto;
    font-size: 16px;
}
.toast.toast-success { border-left-color: var(--gain); }
.toast.toast-error { border-left-color: var(--loss); }
.toast.toast-warning { border-left-color: #c9a878; }
@keyframes slideIn {
    from { transform: translateX(120%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ========================================
   Modal
======================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: var(--overlay);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 9000;
    animation: fadeIn 0.2s ease;
}
.modal {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 28px;
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.25s ease;
}
.modal-lg { max-width: 720px; }
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}
.modal-header h2 { font-size: 20px; font-weight: 600; }
.modal-close {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, color 0.2s ease;
}
.modal-close:hover {
    background-color: var(--bg-primary);
    color: var(--text-primary);
}
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 16px;
    margin-top: 24px;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ========================================
   List Items
======================================== */
.list-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    border-radius: 10px;
    transition: background 0.2s ease;
    border-bottom: 1px solid var(--border);
}
.list-item:last-child { border-bottom: none; }
.list-item:hover { background-color: var(--bg-primary); }

/* ========================================
   Empty State
======================================== */
.empty-state {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-muted);
}
.empty-state svg {
    width: 48px;
    height: 48px;
    opacity: 0.4;
    margin-bottom: 12px;
    stroke: var(--text-muted);
}

/* ========================================
   Tabs
======================================== */
.tabs {
    display: flex;
    gap: 6px;
    background-color: var(--bg-primary);
    border-radius: 10px;
    padding: 4px;
    margin-bottom: 24px;
    overflow-x: auto;
}
.tab {
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
    transition: all 0.2s ease;
}
.tab:hover { color: var(--text-primary); background-color: var(--bg-card-hover); }
.tab.active {
    background: var(--accent-gradient);
    color: #1c1c1e;
}

/* ========================================
   Divider
======================================== */
.divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 24px 0;
}
.divider-line {
    flex: 1;
    height: 1px;
    background-color: var(--border);
}
.divider-text {
    font-size: 14px;
    color: var(--text-muted);
}

/* ========================================
   Input Group (with icon)
======================================== */
.input-group {
    position: relative;
    display: flex;
    align-items: center;
}
.input-group .input-icon {
    position: absolute;
    left: 18px;
    color: var(--text-muted);
    display: flex;
}
.input-group .input-icon svg { width: 18px; height: 18px; }
.input-group .form-input { padding-left: 48px; }

/* ========================================
   Checkbox
======================================== */
.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}
.checkbox {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}
.checkbox-wrapper.checked .checkbox {
    background: var(--accent-gradient);
    border-color: var(--accent-copper);
}
.checkbox-wrapper.checked .checkbox svg { stroke: #1c1c1e; }

/* ========================================
   Landing Page (index.html)
======================================== */
.landing {
    min-height: 100vh;
    padding: 40px 24px 60px;
}
.landing-nav {
    max-width: 1200px;
    margin: 0 auto 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
}
.landing-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 22px;
    font-weight: 700;
}
.landing-logo .logo-icon {
    width: 42px;
    height: 42px;
    background: var(--accent-gradient);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1c1c1e;
    font-size: 20px;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(184, 115, 51, 0.25);
}
.hero {
    max-width: 900px;
    margin: 60px auto 48px;
    text-align: center;
    padding: 0 20px;
}
.hero-tag {
    display: inline-block;
    padding: 6px 14px;
    background-color: rgba(184, 115, 51, 0.15);
    color: var(--accent-copper);
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 24px;
}
.hero h1 {
    font-size: 48px;
    font-weight: 700;
    line-height: 1.15;
    margin-bottom: 20px;
    letter-spacing: -0.02em;
}
.hero h1 .highlight {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero p {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 32px;
    max-width: 620px;
    margin-left: auto;
    margin-right: auto;
}
.hero-cta {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}
.features-grid {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
}
.feature-card {
    padding: 28px;
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    transition: all 0.3s ease;
}
.feature-card:hover {
    border-color: var(--accent-copper);
    transform: translateY(-4px);
    box-shadow: 0 12px 28px var(--shadow);
}
.feature-icon {
    width: 48px;
    height: 48px;
    background: rgba(184, 115, 51, 0.15);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}
.feature-icon svg { width: 24px; height: 24px; stroke: var(--accent-copper); }
.feature-card h3 { font-size: 20px; font-weight: 600; margin-bottom: 8px; }
.feature-card p { font-size: 14px; color: var(--text-secondary); line-height: 1.6; }
.landing-footer {
    max-width: 1200px;
    margin: 80px auto 0;
    padding: 24px 40px;
    text-align: center;
    border-top: 1px solid var(--border);
    font-size: 14px;
    color: var(--text-muted);
}
.landing-footer a {
    color: var(--accent-copper);
    text-decoration: none;
}
.landing-footer a:hover {
    color: var(--accent-copper-light);
}

@media (max-width: 768px) {
    .hero h1 { font-size: 32px; }
    .hero p { font-size: 16px; }
    .landing-nav .nav-links { display: none; }
}

/* ========================================
   Search Dropdown (topbar)
======================================== */
.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 8px;
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    max-height: 400px;
    overflow-y: auto;
    box-shadow: 0 12px 28px var(--shadow);
    z-index: 100;
    display: none;
}
.search-results.show { display: block; }
.search-result-item {
    padding: 14px 18px;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    transition: background 0.15s ease;
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background-color: var(--bg-primary); }
.search-result-type {
    font-size: 11px;
    color: var(--accent-copper);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}
.search-result-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 2px;
}
.search-result-preview {
    font-size: 12px;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* ========================================
   Spinner
======================================== */
.spinner {
    width: 24px;
    height: 24px;
    border: 2.5px solid var(--border);
    border-top-color: var(--accent-copper);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ========================================
   Copyright Footer
======================================== */
.copyright {
    text-align: center;
    padding: 24px 40px;
    color: var(--text-muted);
    font-size: 14px;
    border-top: 1px solid var(--border);
    margin-top: 40px;
}

.copyright a {
    color: var(--accent-copper);
    text-decoration: none;
}

.copyright a:hover {
    color: var(--accent-copper-light);
}
