/* Light & Dark Theme CSS for Binance Alpha Income Calendar */

:root {
    /* Light Theme Variables (Default) */
    --primary-color: #4f46e5;
    --secondary-color: #7c3aed;
    --light-color: #FFFFFF;
    --dark-color: #1e293b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --border-color: #e2e8f0;
    --background-color: #f8fafc;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --text-color: #1e293b;
    --text-secondary: #64748b;
    --card-bg: white;
    --header-bg: linear-gradient(135deg, #4f46e5, #7c3aed);
    --user-section-bg: #f1f5f9;
    --dropdown-hover: #f8fafc;
    --toast-bg: linear-gradient(135deg, #4f46e5, #7c3aed);
    --calendar-day-hover: #f1f5f9;
    --calendar-other-month: #fafafa;
    --today-bg: #eef2ff;
    --user-menu-active: #eef2ff;
    --stat-bg: white;
    --warning-color: #f97316;
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

[data-theme="dark"] {
    /* Dark Theme Variables */
    --primary-color: #6366f1;
    --secondary-color: #8b5cf6;
    --light-color: #1e293b;
    --dark-color: #f8fafc;
    --border-color: #334155;
    --background-color: #0f172a;
    --shadow-color: rgba(0, 0, 0, 0.3);
    --text-color: #f1f5f9;
    --text-secondary: #94a3b8;
    --card-bg: #1e293b;
    --header-bg: linear-gradient(135deg, #4338ca, #5b21b6);
    --user-section-bg: #1e293b;
    --dropdown-hover: #334155;
    --toast-bg: linear-gradient(135deg, #4338ca, #5b21b6);
    --calendar-day-hover: #334155;
    --calendar-other-month: #1e1e1e;
    --today-bg: #312e81;
    --user-menu-active: #312e81;
    --stat-bg: #1e293b;
    --warning-color: #fb923c;
}

/* Bootstrap Icons Font */
@font-face {
    font-display: block;
    font-family: "bootstrap-icons";
    src: url("https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.0/font/fonts/bootstrap-icons.woff2") format("woff2"),
         url("https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.0/font/fonts/bootstrap-icons.woff") format("woff");
}

.bi::before {
    display: inline-block;
    font-family: bootstrap-icons !important;
    font-style: normal;
    font-weight: normal !important;
    font-variant: normal;
    text-transform: none;
    line-height: 1;
    vertical-align: -0.125em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.bi-question-circle::before { content: "\f505"; }
.bi-translate::before { content: "\f5c1"; }
.bi-gear::before { content: "\f3e4"; }
.bi-people::before { content: "\f4ce"; }
.bi-upload::before { content: "\f603"; }
.bi-download::before { content: "\f30a"; }
.bi-pencil::before { content: "\f4cb"; }
.bi-trash::before { content: "\f5de"; }
.bi-chevron-left::before { content: "\f284"; }
.bi-chevron-right::before { content: "\f285"; }
.bi-sun::before { content: "\f5a2"; }
.bi-moon::before { content: "\f497"; }

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background: var(--background-color);
    min-height: 100vh;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-color);
    transition: background-color 0.3s ease;
}

.app-container {
    width: 100%;
    max-width: 800px;
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: 0 8px 24px var(--shadow-color);
    overflow: hidden;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.app-header {
    background: var(--header-bg);
    color: white;
    padding: 20px;
    text-align: center;
    font-size: 1.4em;
    font-weight: 600;
    transition: background 0.3s ease;
}

/* User Section Styles */
.user-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background-color: var(--user-section-bg);
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.3s ease;
}

.user-selector {
    display: flex;
    align-items: center;
    position: relative;
}

.user-icon-wrapper {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 4px;
    border-radius: 20px;
    transition: background-color 0.2s ease;
}

.user-icon-wrapper:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.user-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.user-icon:hover {
    background-color: var(--secondary-color);
}

.user-icon i {
    font-size: 20px;
}

.current-user-name {
    margin-left: 8px;
    font-size: 14px;
    color: var(--text-color);
    font-weight: 500;
    transition: color 0.3s ease;
}

.user-menu {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 8px;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 4px 20px var(--shadow-color);
    min-width: 200px;
    display: none;
    z-index: 1000;
    transition: background-color 0.3s ease;
}

.user-menu.show {
    display: block;
    animation: fadeInDown 0.2s ease;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.user-menu-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 14px;
    transition: color 0.3s ease, border-color 0.3s ease;
}

.user-menu-list {
    max-height: 250px;
    overflow-y: auto;
}

.user-menu-item {
    padding: 10px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    color: var(--text-color);
}

.user-menu-item:hover {
    background-color: var(--dropdown-hover);
}

.user-menu-item.active {
    background-color: var(--user-menu-active);
    color: var(--primary-color);
}

.user-menu-item i {
    margin-right: 8px;
    font-size: 16px;
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-btn {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
}

.header-btn:hover {
    background-color: rgba(0,0,0,0.05);
    color: var(--primary-color);
}

/* Dropdown Styles */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: 45px;
    background-color: var(--card-bg);
    min-width: 180px;
    box-shadow: 0 8px 16px var(--shadow-color);
    z-index: 100;
    border-radius: 8px;
    overflow: hidden;
    transition: background-color 0.3s ease;
}

.dropdown-content.show {
    display: block;
    animation: fadeIn 0.2s;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.dropdown-item {
    padding: 12px 16px;
    text-decoration: none;
    display: flex;
    align-items: center;
    color: var(--text-color);
    transition: all 0.2s ease, color 0.3s ease;
    border-bottom: 1px solid var(--border-color);
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item:hover {
    background-color: var(--dropdown-hover);
}

.dropdown-item i {
    margin-right: 10px;
    color: var(--primary-color);
}

/* Button Styles */
.btn {
    padding: 8px 12px;
    border-radius: 8px;
    border: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
}

.btn i {
    margin-right: 5px;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-outline {
    background-color: var(--card-bg);
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow-color);
}

/* Stats Dashboard */
.stats-dashboard {
    padding: 15px;
    background-color: var(--background-color);
    transition: background-color 0.3s ease;
}

.stats-container {
    display: flex;
    background-color: var(--stat-bg);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 6px var(--shadow-color);
    overflow: hidden;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.stat-card {
    flex: 1;
    text-align: center;
    padding: 16px;
}

.stat-card:not(:last-child) {
    border-right: 1px solid var(--border-color);
    transition: border-color 0.3s ease;
}

.stat-title {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    transition: color 0.3s ease;
}

.stat-value {
    font-size: 28px;
    font-weight: 600;
    color: var(--primary-color);
    transition: color 0.3s ease;
}

/* Calendar Styles */
.calendar-container {
    padding: 0 15px 15px;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    margin-bottom: 5px;
}

.month-selector {
    display: flex;
    align-items: center;
}

.month-selector button {
    background: none;
    border: none;
    font-size: 18px;
    color: var(--primary-color);
    cursor: pointer;
    padding: 0 8px;
}

.month-display {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color);
    margin: 0 10px;
    transition: color 0.3s ease;
}

.month-stats {
    display: flex;
    align-items: center;
    background-color: var(--card-bg);
    border-radius: 20px;
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.month-stat-item {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 0 8px;
}

.month-stat-item:not(:last-child) {
    border-right: 1px solid var(--border-color);
    padding-right: 12px;
    transition: border-color 0.3s ease;
}

.month-stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

.month-stat-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary-color);
    margin-left: 5px;
    transition: color 0.3s ease;
}

/* Calendar Grid */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    background-color: var(--card-bg);
    width: 100%;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.calendar-weekday {
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 10px 0;
    background-color: var(--background-color);
    border-bottom: 1px solid var(--border-color);
    transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
}

.calendar-day {
    aspect-ratio: 1 / 0.8;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    border-right: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    padding: 5px;
    min-width: 0;
    box-sizing: border-box;
}

.calendar-day:nth-child(7n) {
    border-right: none;
}

.calendar-day:nth-last-child(-n+7) {
    border-bottom: none;
}

.calendar-day:hover {
    background-color: var(--calendar-day-hover);
}

.day-number {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
    transition: color 0.3s ease;
}

.day-balance {
    font-size: 13px;
    margin-top: 4px;
    font-weight: 500;
}

.positive-balance {
    color: var(--success-color);
    font-weight: 500;
}

.negative-balance {
    color: var(--danger-color);
    font-weight: 500;
}

.today {
    background-color: var(--today-bg);
    position: relative;
    transition: background-color 0.3s ease;
}

.today::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--primary-color);
    transition: background-color 0.3s ease;
}

.other-month {
    opacity: 0.4;
    background-color: var(--calendar-other-month);
    transition: background-color 0.3s ease;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
    animation: fadeIn 0.3s;
}

.modal-content {
    background-color: var(--card-bg);
    margin: 10% auto;
    padding: 20px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    width: 90%;
    max-width: 384px; 
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px var(--shadow-color);
    animation: slideIn 0.3s;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

@keyframes slideIn {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 16px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
    transition: border-color 0.3s ease;
}

.modal-title {
    font-size: 1em;
    font-weight: 600;
    color: var(--text-color);
    transition: color 0.3s ease;
}

.close-modal {
    color: var(--text-secondary);
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-modal:hover {
    color: var(--primary-color);
}

/* Modal Description Text */
.modal-description {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0 0 20px 0;
    text-align: center;
    line-height: 1.5;
    transition: color 0.3s ease;
}

.warning-text {
    color: var(--warning-color);
    font-weight: 500;
}

.file-upload-container {
    width: 100%;
    text-align: center;
}

.file-upload-container input[type="file"] {
    width: 100%;
    padding: 8px 0;
}

/* Form Styles */
.form-row {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.form-label {
    flex: 0 0 45%;
    font-size: 14px;
    color: var(--text-secondary);
    text-align: left;
    padding-right: 6px;
    display: flex;
    align-items: center;
    transition: color 0.3s ease;
}

.required-field::after {
    content: "*";
    color: var(--danger-color);
    margin-left: 4px;
}

.help-icon {
    margin-left: 5px;
    color: var(--text-secondary);
    font-size: 16px;
    cursor: help;
    display: inline-block;
    width: 16px;
    height: 16px;
    line-height: 16px;
    text-align: center;
    vertical-align: middle;
    transition: color 0.3s ease;
}

.form-input {
    flex: 0 0 55%;
    position: relative;
    max-width: none;
}

.form-control {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 15px;
    background-color: var(--card-bg);
    color: var(--text-color);
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

input[type="number"].form-control,
input[type="text"].form-control {
    width: 100%;
    max-width: none;
}

.form-hint {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
    transition: color 0.3s ease;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
    transition: border-color 0.3s ease;
}

/* Toast Styles */
.toast-container {
    position: fixed;
    top: 20%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
}

.toast {
    background: var(--toast-bg);
    color: #fff;
    padding: 10px 18px;
    border-radius: 8px;
    margin: 6px;
    font-size: 14px;
    font-weight: 500;
    opacity: 0;
    transition: opacity .3s, transform .3s;
    transform: translateY(-20px);
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0,0,0,.15);
}

/* Theme Toggle */
.theme-toggle {
    cursor: pointer;
    transition: all 0.2s ease;
}

.theme-toggle i {
    transition: transform 0.3s ease;
}

/* Bootstrap Icons additional codes */
.bi-three-dots-vertical::before { content: "\f5d4"; }
.bi-cloud-arrow-down::before { content: "\f33d"; }
.bi-cloud-arrow-up::before { content: "\f343"; }
.bi-calendar-event::before { content: "\f26e"; }
.bi-plus-circle::before { content: "\f4fa"; }

/* Responsive Styles */
@media (max-width: 768px) {
    .month-stats {
        padding: 4px 8px;
    }
    
    .month-stat-item {
        padding: 0 5px;
    }
    
    .month-stat-item:first-child {
        padding-right: 8px;
    }
    
    .calendar-container {
        padding: 0 10px 10px;
    }

    .calendar-day {
        aspect-ratio: 1 / 0.9;
        padding: 2px;
        font-size: 12px;
    }
    
    .day-number {
        font-size: 15px;
    }
    
    .day-balance {
        font-size: 11px;
    }
    
    .header-controls {
        flex-direction: column;
        align-items: flex-end;
    }
}

@media (max-width: 480px) {
    .stat-value {
        font-size: 22px;
    }

    .stat-title {
        font-size: 12px;
    }
    
    .calendar-header {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }
    
    .month-selector {
        width: 100%;
        justify-content: space-between;
    }
    
    .month-stats {
        width: 100%;
        justify-content: center;
    }
    
    .calendar-container {
        padding: 0 5px 5px;
    }
    
    .modal-content {
        width: 95%;
        margin: 5% auto;
    }
    
    .calendar-day {
        aspect-ratio: 1 / 1;
        padding: 1px;
        min-height: 32px;
        min-width: 32px;
    }
    
    .day-number {
        font-size: 14px;
    }
    
    .day-balance {
        font-size: 10px;
        margin-top: 1px;
    }
    
    .calendar-weekday {
        padding: 5px 0;
        font-size: 12px;
    }
    .current-user-name {
        font-size: 13px;
    }
}

/* Very Small Screens */
@media (max-width: 360px) {
    body {
        padding: 2px;
    }
    
    .app-container {
        border-radius: 4px;
    }
    
    .app-header {
        padding: 10px 5px;
        font-size: 1.1em;
    }
    
    .calendar-container {
        padding: 0 2px 2px;
    }
    
    .user-section {
        padding: 5px;
    }
    
    .stats-dashboard {
        padding: 5px;
    }
    
    .calendar-grid {
        font-size: 10px;
    }
    
    .calendar-day {
        padding: 0;
        min-height: 28px;
        min-width: 28px;
    }
    
    .day-number {
        font-size: 12px;
    }
    
    .day-balance {
        font-size: 9px;
        margin-top: 0;
    }
    .current-user-name {
        display: none;
    }
} 

/* 移除移动端底部导航样式，统一使用频道 Tabs */

/* ========== Channel Tabs（全端） ========== */
.channel-tabs {
    display: flex;
    justify-content: center;
    gap: 32px;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
}

.channel-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    padding: 12px 0;
    border-bottom: 2px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.channel-link:hover {
    color: var(--primary-color);
}

.channel-link.active {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

/* 移动端保持足够点击空间 */
@media (max-width: 480px) {
    .channel-link { font-size: 13px; padding: 10px 0; }
    .channel-tabs { gap: 24px; }
} 


/* 去掉顶部圆弧 */
.app-container {
    border-radius: 0;
} 