/* ============================================
   全局样式 - 白色主题
   ============================================ */

:root {
    /* 白色主题配色 */
    --bg-primary: #ffffff;
    --bg-secondary: #f5f5f5;
    --bg-tertiary: #e8e8e8;
    --accent-primary: #4a90e2;
    --accent-secondary: #6ba3e8;
    --accent-light: #8bb5ed;
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-light: #999999;
    --text-white: #ffffff;
    --border-color: rgba(0, 0, 0, 0.1);
    --shadow-deep: rgba(0, 0, 0, 0.15);
    --shadow-medium: rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 
                 'Microsoft YaHei', 'Helvetica Neue', Arial, sans-serif;
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
    position: relative;
    overflow-x: hidden;
    background: var(--bg-primary);
}

/* iOS 风格毛玻璃效果层 - 整个页面背景 */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    z-index: -1;
    pointer-events: none;
}

/* ============================================
   顶部导航栏
   ============================================ */

.header {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    padding: 1rem 2rem;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.05), 0 2px 10px rgba(0, 0, 0, 0.05);
    border-bottom: 0.5px solid rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-info-left {
    display: flex;
    align-items: center;
}

.user-info-left-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 1rem;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.user-info-left-content:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

.user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.user-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.login-btn {
    background: #000000;
    color: var(--text-white);
    border: none;
    padding: 0.6rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    background: #1a1a1a;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--text-primary);
}

.user-name {
    font-size: 0.95rem;
    color: #000000;
    font-weight: 500;
    white-space: nowrap;
}

.add-module-btn {
    background: #000000;
    color: var(--text-white);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5rem;
    font-weight: 300;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    margin-right: 0.5rem;
    line-height: 1;
}

.add-module-btn:hover {
    transform: translateY(-2px) rotate(90deg);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    background: #1a1a1a;
}

.logout-btn {
    background: transparent;
    color: #000000;
    border: 1px solid #000000;
    padding: 0.5rem 1.2rem;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    border-color: #1a1a1a;
}

/* ============================================
   主要内容区域
   ============================================ */

.main-content {
    max-width: 1200px;
    margin-top: 1rem;
    margin-bottom: 4rem;
    margin-left: auto;
    margin-right: auto;
    padding: 0 2rem;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, 380px);
    gap: 1rem;
    padding-top: 1rem;
    padding-bottom: 1rem;
    padding-left: 0;
    padding-right: 0;
    max-width: 1200px;
    margin: 0 auto;
    justify-content: center;
}

/* iOS 风格毛玻璃卡片 */
.grid-item {
    /* iOS 风格半透明背景 */
    background: rgba(255, 255, 255, 0.7) !important;
    background-color: rgba(255, 255, 255, 0.7) !important;
    background-image: none !important;
    
    /* iOS 风格毛玻璃效果 */
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    
    /* iOS 风格边框 */
    border: 0.5px solid rgba(0, 0, 0, 0.1);
    border-radius: 20px;
    padding: 2.5rem;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    
    /* iOS 风格阴影 */
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.9),
        inset 0 -1px 0 rgba(0, 0, 0, 0.05);
    
    position: relative;
    overflow: hidden;
    
    /* 固定尺寸 - 所有卡片必须完全一致 */
    width: 380px !important;
    height: 280px !important;
    max-width: 380px !important;
    min-width: 380px !important;
    max-height: 280px !important;
    min-height: 280px !important;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-sizing: border-box;
    flex-shrink: 0;
    flex-grow: 0;
}

.module-edit-buttons {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
    pointer-events: none;
}

.module-edit-buttons > * {
    pointer-events: auto;
}

.module-move-up-btn {
    position: absolute !important;
    top: 1rem !important;
    left: 1rem !important;
    bottom: auto !important;
    right: auto !important;
    background: #000000;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.9rem;
    color: white;
    transition: all 0.3s ease;
    user-select: none;
    -webkit-user-select: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    z-index: 20;
    font-weight: 300;
    line-height: 1;
}

.module-move-down-btn {
    position: absolute !important;
    top: 1rem !important;
    left: 3.8rem !important;
    bottom: auto !important;
    right: auto !important;
    background: #000000;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.9rem;
    color: white;
    transition: all 0.3s ease;
    user-select: none;
    -webkit-user-select: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    z-index: 20;
    font-weight: 300;
    line-height: 1;
}

/* 当没有"往前排"按钮时，"往后排"按钮显示在第一个位置 */
.module-move-down-btn-first {
    left: 1rem !important;
}

.module-move-up-btn:hover,
.module-move-down-btn:hover {
    background: #1a1a1a;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.module-delete-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 107, 107, 0.95);
    border: 1px solid rgba(255, 107, 107, 0.3);
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.5rem;
    color: white;
    transition: all 0.3s ease;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
}

.module-delete-btn:hover {
    background: #ff5252;
    border-color: #ff5252;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.4);
}

/* 编辑按钮样式（与+按钮一样） */
.edit-module-btn {
    background: #000000;
    color: var(--text-white);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5rem;
    font-weight: 300;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    margin-right: 0.5rem;
    line-height: 1;
    transform: scaleX(-1); /* 左右翻转 */
}

.edit-module-btn:hover {
    transform: scaleX(-1) translateY(-2px) rotate(90deg); /* 保持翻转，同时应用hover效果 */
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    background: #1a1a1a;
}

/* 拖拽占位符 */
.module-drag-placeholder {
    background: rgba(74, 144, 226, 0.1);
    border: 2px dashed #4a90e2;
    border-radius: 20px;
    margin: 0.5rem 0;
}

/* 拖拽状态 */
body.dragging {
    cursor: grabbing;
}

body.dragging .grid-item {
    cursor: grabbing;
}

/* iOS 风格高光效果 */
.grid-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.95), 
        transparent
    );
    z-index: 1;
}

/* 毛玻璃内部光晕效果 */
.grid-item::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, 
        rgba(74, 144, 226, 0.1) 0%, 
        transparent 70%
    );
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    z-index: 0;
}

.grid-item:hover::after {
    opacity: 1;
}

.grid-item:hover {
    transform: translateY(-8px) scale(1.01);
    background: rgba(255, 255, 255, 0.85) !important;
    background-color: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(50px) saturate(180%);
    -webkit-backdrop-filter: blur(50px) saturate(180%);
    border-color: rgba(0, 0, 0, 0.2);
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.95),
        inset 0 -1px 0 rgba(0, 0, 0, 0.08),
        0 0 30px rgba(0, 0, 0, 0.05);
}

.grid-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    filter: drop-shadow(0 0 10px rgba(74, 144, 226, 0.3));
    position: relative;
    z-index: 2;
}

.grid-item h3 {
    font-size: 1.5rem;
    margin-bottom: 0.8rem;
    color: #000000;
    position: relative;
    z-index: 2;
}

.grid-item p {
    font-size: 1rem;
    color: var(--text-secondary);
    opacity: 0.9;
    position: relative;
    z-index: 2;
}

/* 时间模块样式 */
.time-module .time-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.time-module .time-date {
    font-size: 1rem;
    color: var(--text-secondary);
    position: relative;
    z-index: 2;
}

.time-module .time-clock {
    font-size: 3.5rem;
    font-weight: 600;
    color: #000000;
    font-family: 'Courier New', monospace;
    letter-spacing: 2px;
    position: relative;
    z-index: 2;
    line-height: 1.2;
}

/* 天气模块样式 */
.weather-module h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

/* 天气位置显示（城市名称） */
.dynamic-weather-location {
    text-align: center;
}

/* 天气位置包装器（城市名称+切换按钮，整体居中） */
.weather-location-wrapper {
    display: inline-block;
}

/* 天气位置文本 */
.weather-location-text {
    display: inline-block;
}

/* 天气信息包装器（天气信息+刷新按钮） */
.weather-info-wrapper {
    display: inline-block;
}

/* 天气信息文本 */
.weather-info-text {
    display: inline-block;
}

.weather-module p {
    font-size: 1.1rem;
    font-weight: 500;
}

/* 天气选择城市链接（可点击） */
.weather-select-city-link {
    cursor: pointer;
    text-decoration: underline;
    color: var(--accent-primary);
    transition: all 0.3s ease;
    font-weight: 500;
}

.weather-select-city-link:hover {
    color: var(--accent-secondary);
    text-decoration: underline;
}

.weather-select-city-link:active {
    color: var(--accent-light);
}

/* 天气切换城市图标（城市名称右侧，紧贴） */
.weather-change-city-icon {
    display: inline-block;
    margin-left: 0.3rem;
    font-size: 0.75rem;
    color: var(--text-light);
    cursor: pointer;
    opacity: 0.5;
    transition: all 0.3s ease;
    vertical-align: middle;
    line-height: 1;
    transform: scaleX(-1); /* 左右翻转 */
}

.weather-change-city-icon:hover {
    opacity: 0.8;
    color: var(--text-secondary);
    transform: scaleX(-1) translateY(-2px) rotate(90deg); /* 保持翻转，同时应用hover效果：向上移动2px并旋转90度 */
}

.weather-change-city-icon:active {
    opacity: 1;
    color: var(--text-primary);
}

/* 天气刷新图标（天气信息右侧，紧贴） */
.weather-refresh-icon {
    display: inline-block;
    margin-left: 0.3rem;
    font-size: 0.75rem;
    color: var(--text-light);
    cursor: pointer;
    opacity: 0.5;
    transition: all 0.3s ease;
    vertical-align: middle;
    line-height: 1;
}

.weather-refresh-icon:hover {
    opacity: 0.8;
    color: var(--text-secondary);
    transform: rotate(180deg); /* 悬停时旋转 */
}

.weather-refresh-icon:active {
    opacity: 1;
    color: var(--text-primary);
}

/* 明日天气行容器 */
.weather-tomorrow-row {
    margin-top: 0.8rem;
    width: 100%;
    position: relative;
}

/* 明日天气预测按钮 */
.weather-tomorrow-btn {
    padding: 0.5rem 1rem;
    background: transparent;
    color: var(--text-light);
    border: none;
    border-radius: 0;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    text-align: center;
    opacity: 0.6;
    text-decoration: underline;
}

.weather-tomorrow-btn:hover {
    opacity: 0.8;
    color: var(--text-secondary);
}

.weather-tomorrow-btn:active {
    opacity: 1;
    color: var(--text-primary);
}

/* 明日天气信息显示（替换按钮显示） */
.weather-tomorrow-info {
    padding: 0.5rem 1rem;
    background: transparent;
    border: none;
    border-radius: 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.weather-tomorrow-info:hover {
    color: var(--text-primary);
}

/* 天气城市输入框容器 */
.weather-city-input-wrapper {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: none;
    flex-direction: column;
    gap: 0.8rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border-radius: 16px;
    border: 0.5px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    z-index: 100;
    min-width: 250px;
}

.weather-city-input {
    padding: 0.8rem 1rem;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.9);
    color: #000000;
    outline: none;
    transition: all 0.3s ease;
}

.weather-city-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.weather-city-confirm,
.weather-city-cancel {
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 10px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.weather-city-confirm {
    background: rgba(0, 0, 0, 0.9);
    color: #ffffff;
}

.weather-city-confirm:hover {
    background: rgba(0, 0, 0, 1);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.weather-city-cancel {
    background: rgba(0, 0, 0, 0.1);
    color: #000000;
}

.weather-city-cancel:hover {
    background: rgba(0, 0, 0, 0.15);
}

/* 浏览器不支持backdrop-filter时的降级方案 */
@supports not (backdrop-filter: blur(1px)) {
    .grid-item {
        background: rgba(255, 255, 255, 0.95) !important;
        background-color: rgba(255, 255, 255, 0.95) !important;
        background-image: none !important;
        border: 0.5px solid rgba(0, 0, 0, 0.1);
    }
}

/* ============================================
   登录弹窗
   ============================================ */

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.show {
    display: flex;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border-radius: 20px;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 
                inset 0 1px 0 rgba(255, 255, 255, 0.9);
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 0.5px solid rgba(0, 0, 0, 0.1);
}

/* 收支表单弹窗样式 - 宽度与卡片一致 */
.income-expense-form-modal {
    width: 380px !important;
    max-width: 380px !important;
    position: relative;
}

.income-expense-form-modal .modal-header {
    display: none;
}

.income-expense-form-modal .modal-body {
    padding: 1.5rem;
}

.income-expense-form-modal .form-group {
    margin-bottom: 0.75rem;
}

.income-expense-close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 10;
    background: #000000 !important;
    border: none !important;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.5rem;
    color: #ffffff !important;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    padding: 0;
    line-height: 1;
    pointer-events: auto;
}

.income-expense-close-btn:hover {
    background: #1a1a1a !important;
    transform: scale(1.1) !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3) !important;
}

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

.modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    color: #000000;
    font-size: 1.5rem;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    transition: all 0.3s ease;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.modal-close:hover {
    background: var(--bg-secondary);
    color: #000000;
    transform: rotate(90deg);
}

.modal-body {
    padding: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 0.8rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 1rem;
    line-height: 1.5;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.form-control:focus {
    outline: none;
    border-color: #000000;
    background: var(--bg-primary);
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
}

.form-control::placeholder {
    color: var(--text-light);
}

select.form-control {
    cursor: pointer;
}

.form-error {
    color: #ff6b6b;
    font-size: 0.9rem;
    margin-top: 0.5rem;
    min-height: 1.5rem;
    display: none;
}

.form-error.show {
    display: block;
}

.btn-submit {
    width: 100%;
    padding: 0.9rem;
    background: #000000;
    color: var(--text-white);
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    background: #1a1a1a;
}

.btn-submit:active {
    transform: translateY(0);
}

/* 旧的样式定义已移动到下方，此处删除避免冲突 */

/* ============================================
   响应式设计
   ============================================ */

@media (max-width: 768px) {
    .header {
        padding: 1rem;
    }

    .main-content {
        margin-top: 1rem;
        margin-bottom: 2rem;
        margin-left: auto;
        margin-right: auto;
        padding: 0 1rem;
    }

    .grid-container {
        grid-template-columns: 340px !important;
        gap: 1rem;
        padding-top: 1rem;
        padding-bottom: 1rem;
        padding-left: 0;
        padding-right: 0;
        max-width: 100%;
        justify-content: center;
    }

    .grid-item {
        padding: 2rem;
        width: 340px !important;
        height: 260px !important;
        max-width: 340px !important;
        min-width: 340px !important;
        max-height: 260px !important;
        min-height: 260px !important;
        background: transparent !important;
        background-color: transparent !important;
        box-sizing: border-box;
        flex-shrink: 0 !important;
        flex-grow: 0 !important;
    }

    .grid-icon {
        font-size: 3rem;
    }

    .modal-content {
        width: 95%;
        margin: 1rem;
    }

    .modal-header {
        padding: 1rem 1.5rem;
    }

    .modal-body {
        padding: 1.5rem;
    }

    .user-info-left-content {
        gap: 0.4rem;
        padding: 0.35rem 0.8rem;
    }

    .user-avatar {
        width: 24px;
        height: 24px;
    }

    .user-name {
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .login-btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }

    .grid-container {
        grid-template-columns: 320px !important;
        justify-content: center;
    }

    .grid-item {
        width: 320px !important;
        height: 240px !important;
        max-width: 320px !important;
        min-width: 320px !important;
        max-height: 240px !important;
        min-height: 240px !important;
        padding: 1.5rem;
        background: transparent !important;
        background-color: transparent !important;
        box-sizing: border-box;
        flex-shrink: 0 !important;
        flex-grow: 0 !important;
    }

    .grid-item h3 {
        font-size: 1.2rem;
    }

    .user-info-left-content {
        gap: 0.3rem;
        padding: 0.3rem 0.7rem;
    }

    .user-avatar {
        width: 22px;
        height: 22px;
    }

    .user-name {
        font-size: 0.8rem;
    }
    
    /* 移动端时间模块样式调整 */
    .time-module .time-clock {
        font-size: 2.5rem;
    }
    
    .time-module .time-date {
        font-size: 0.9rem;
    }

    /* 移动端翻译模块样式调整 */
    .translate-input-group {
        gap: 0.3rem;
    }

    .translate-btn {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
        min-width: 70px;
        margin-right: 0.05rem;
    }

    .translate-refresh-btn {
        width: 32px;
        height: 32px;
        min-width: 32px;
        padding: 0.4rem;
        font-size: 0.85rem;
        margin-left: -0.15rem;
    }

    .module-move-up-btn {
        top: 0.8rem;
        left: 0.8rem;
        width: 24px;
        height: 24px;
        font-size: 0.8rem;
    }

    .module-move-down-btn {
        top: 0.8rem !important;
        left: 3.2rem !important;
        bottom: auto !important;
        right: auto !important;
        width: 24px;
        height: 24px;
        font-size: 0.8rem;
    }

    .module-delete-btn {
        width: 24px;
        height: 24px;
        font-size: 1.2rem;
        top: 0.8rem;
        right: 0.8rem;
    }

    .edit-module-btn {
        width: 36px;
        height: 36px;
        font-size: 1.3rem;
        margin-right: 0.3rem;
    }
}

/* ============================================
   翻译模块样式
   ============================================ */
.translate-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow: visible; /* 确保子元素不被裁剪 */
}

.translate-input-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    flex-shrink: 0;
    overflow: visible; /* 确保刷新按钮不被裁剪 */
    min-width: 0; /* 允许flex子元素缩小 */
}

.translate-icon {
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.translate-input {
    flex: 1;
    min-width: 0; /* 允许输入框缩小，为按钮留出空间 */
    padding: 0.75rem;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.9);
    font-size: 0.95rem;
    outline: none;
    transition: all 0.3s ease;
}

.translate-input:focus {
    border-color: #4a90e2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.translate-btn {
    padding: 0.75rem 1.5rem;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    min-width: 80px;
    flex-shrink: 0;
    margin-right: 0.1rem; /* 让刷新按钮更靠近翻译按钮 */
}

.translate-btn:hover:not(:disabled) {
    background: rgba(0, 0, 0, 0.9);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.translate-btn:disabled {
    background: #ccc;
    border-color: #ccc;
    cursor: not-allowed;
    transform: none;
}

.translate-refresh-btn {
    padding: 0.5rem;
    background: transparent;
    color: rgba(0, 0, 0, 0.5);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    min-width: 36px;
    flex-shrink: 0;
    line-height: 1;
    opacity: 0.6;
    margin-left: -0.2rem;
    position: relative; /* 确保按钮在正常文档流中 */
    z-index: 1; /* 确保按钮可见 */
}

.translate-refresh-btn:hover {
    opacity: 0.8;
    color: rgba(0, 0, 0, 0.7);
    transform: rotate(180deg);
}

.translate-result {
    display: block;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    min-height: 3rem;
    word-wrap: break-word;
    line-height: 1.6;
    flex: 1;
    overflow-y: auto;
}

.translate-result:empty {
    display: none;
}

.translate-result .translate-text {
    color: #333;
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.translate-result .translate-full {
    color: #333;
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.translate-toggle {
    margin-top: 0.5rem;
    padding: 0.4rem 0.8rem;
    background: transparent;
    color: #4a90e2;
    border: 1px solid #4a90e2;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.translate-toggle:hover {
    background: #4a90e2;
    color: white;
}

/* ============================================
   常用网站模块样式
   ============================================ */

.favorite-sites-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: relative;
}

.website-module-icon {
    position: absolute;
    top: 0.25rem;
    left: 0.25rem;
    font-size: 1.5rem;
    z-index: 10;
    filter: drop-shadow(0 0 10px rgba(74, 144, 226, 0.3));
    line-height: 1;
}

.website-edit-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    z-index: 15;
    background: rgba(0, 0, 0, 0.8);
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    color: white;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transform: scaleX(-1); /* 左右翻转 */
    line-height: 1;
    padding: 0;
}

.website-edit-btn:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scaleX(-1) translateY(-2px) rotate(90deg); /* 保持翻转，同时应用hover效果：向上移动2px并旋转90度 */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.favorite-sites-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    flex: 1;
    overflow-y: auto;
    align-content: flex-start;
    align-items: flex-start;
    justify-content: flex-start;
}

.favorite-site-item {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    flex-shrink: 0;
}

.site-name-display {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    color: #333;
    text-align: center;
    word-break: break-all;
    line-height: 1.2;
    padding: 0.2rem;
}

.favorite-site-item:hover {
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px) scale(1.02);
}

.site-icon {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    flex-shrink: 0;
    object-fit: cover;
}

.site-name {
    font-size: 0.65rem;
    color: #333;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    line-height: 1.1;
}

.site-link {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

.site-delete-btn {
    position: absolute;
    top: 2px;
    right: 2px;
    z-index: 3;
    background: rgba(255, 107, 107, 0.95);
    border: 2px solid rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.7rem;
    color: white;
    transition: all 0.3s ease;
    flex-shrink: 0;
    padding: 0;
    line-height: 1;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.site-move-up-btn,
.site-move-down-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid rgba(255, 255, 255, 0.9);
    border-radius: 4px;
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0;
    color: white;
    transition: all 0.3s ease;
    flex-shrink: 0;
    padding: 0;
    line-height: 1;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    margin: 0;
    vertical-align: middle;
    overflow: hidden;
}

.site-move-up-btn::before,
.site-move-down-btn::before {
    content: '';
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 0.75rem;
    line-height: 1;
    transform: translateY(-1px);
}

.site-move-up-btn::before {
    content: '←';
}

.site-move-down-btn::before {
    content: '→';
}

.site-move-up-btn {
    left: 2px;
}

.site-move-down-btn {
    right: 2px;
}

.site-move-up-btn:hover,
.site-move-down-btn:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: translateY(-50%) scale(1.1);
}

.site-delete-btn:hover {
    background: #ff5252;
    transform: scale(1.1);
}

.favorite-sites-add-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    padding: 0;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.favorite-sites-add-btn:hover {
    background: rgba(255, 255, 255, 1);
    border-color: #4a90e2;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px) scale(1.02);
}

.add-icon {
    font-size: 1.8rem;
    color: #999;
    font-weight: 300;
    line-height: 1;
}

.favorite-sites-add-btn:hover .add-icon {
    color: #4a90e2;
}

.favorite-sites-form {
    display: none;
    flex-direction: column;
    gap: 0.8rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 14px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.site-form-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 11;
    background: #000000;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.5rem;
    color: #ffffff;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    padding: 0;
    line-height: 1;
    pointer-events: auto;
}

.site-form-close:hover {
    background: #1a1a1a !important;
    transform: scale(1.1) !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3) !important;
}

.site-icon-input-wrapper {
    width: 100%;
    max-width: 300px;
}

.site-name-input,
.site-url-input {
    width: 100%;
    max-width: 300px;
    padding: 0.6rem 0.8rem;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.95);
    font-size: 0.9rem;
    outline: none;
    transition: all 0.3s ease;
}

.site-icon-input {
    width: 100%;
    max-width: 300px;
    padding: 0.6rem 0.8rem;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.95);
    font-size: 0.9rem;
    outline: none;
    transition: all 0.3s ease;
}

.site-name-input:focus,
.site-url-input:focus {
    border-color: #4a90e2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.site-icon-input:focus {
    border-color: #4a90e2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.site-form-buttons {
    display: flex;
    gap: 0.8rem;
    width: 100%;
    max-width: 300px;
    justify-content: flex-start;
}

.site-form-show-icon {
    flex: 2;
    padding: 0.7rem 1.2rem;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
}

.site-form-buttons .site-icon-input {
    flex: 2;
    padding: 0.7rem 1.2rem;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    font-size: 0.85rem;
    background: rgba(255, 255, 255, 0.95);
    outline: none;
    transition: all 0.3s ease;
    min-width: 0;
    width: 0;
    max-width: none;
}

.site-form-buttons .site-icon-input:focus {
    border-color: #4a90e2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.site-form-show-icon:hover {
    background: rgba(255, 255, 255, 1);
    border-color: #4a90e2;
}

.site-form-submit,
.site-form-cancel {
    flex: 0 0 auto;
    padding: 0.7rem 1rem;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-left: auto;
}

.site-form-submit {
    background: #000000;
    color: white;
}

.site-form-submit:hover {
    background: #1a1a1a;
    transform: translateY(-1px);
}

.site-form-cancel {
    background: rgba(0, 0, 0, 0.05);
    color: #333;
}

.site-form-cancel:hover {
    background: rgba(0, 0, 0, 0.1);
}

/* ============================================
   收支模块样式
   ============================================ */

.income-expense-container {
    width: 100%;
    height: 100%;
    max-height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    overflow: hidden;
    text-align: left; /* 覆盖grid-item的text-align: center */
    box-sizing: border-box;
}

/* 收支模块的grid-item特殊处理 - 尺寸必须与其他卡片完全一致 */
.grid-item.income-expense-module {
    text-align: left !important;
    justify-content: flex-start !important;
    align-items: flex-start !important;
    padding: 1.5rem !important; /* 减少内边距，为内容留出更多空间 */
    overflow: hidden !important;
    box-sizing: border-box !important;
    width: 380px !important;
    height: 280px !important;
    max-width: 380px !important;
    min-width: 380px !important;
    max-height: 280px !important;
    min-height: 280px !important;
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
}

/* 确保收支模块的按钮可见 */
.income-expense-module .income-expense-add-btn {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.income-expense-header {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
    position: relative;
    z-index: 10;
}

.income-expense-add-btn {
    padding: 0.5rem 1rem;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 10;
    white-space: nowrap;
    flex-shrink: 0;
}

.income-expense-add-btn:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.income-expense-detail-btn {
    padding: 0.5rem 1rem;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 10;
    white-space: nowrap;
    flex-shrink: 0;
}

.income-expense-detail-btn:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* 收支明细弹窗样式 */
.income-expense-detail-modal {
    width: 380px;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

.income-expense-detail-close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 10;
    background: #000000 !important;
    border: none !important;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.5rem;
    color: #ffffff !important;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    padding: 0;
    line-height: 1;
    pointer-events: auto;
}

.income-expense-detail-close-btn:hover {
    background: #1a1a1a !important;
    transform: scale(1.1) !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3) !important;
}

.income-expense-detail-edit-mode-btn {
    position: absolute;
    top: 1rem;
    right: 3.5rem;
    z-index: 10;
    background: #000000 !important;
    border: none !important;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    color: #ffffff !important;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transform: scaleX(-1); /* 左右翻转 */
    line-height: 1;
    padding: 0;
    pointer-events: auto;
}

.income-expense-detail-edit-mode-btn:hover {
    background: #1a1a1a !important;
    transform: scaleX(-1) scale(1.1) !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3) !important;
}

.income-expense-detail-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    padding-top: 4rem;
    min-height: 0;
}

.income-expense-detail-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.income-expense-detail-item {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    padding: 0.6rem 0.75rem;
    transition: all 0.3s ease;
}

.income-expense-detail-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.income-expense-detail-item-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
}

.income-expense-status-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    flex-shrink: 0;
    accent-color: #000000;
}

.income-expense-detail-item.inactive {
    background: rgba(0, 0, 0, 0.05);
}

.income-expense-detail-item.inactive .income-expense-detail-item-text {
    color: #999;
    opacity: 1;
}

.income-expense-detail-item.inactive .income-expense-detail-amount {
    opacity: 0.6;
}

.income-expense-detail-item-text {
    flex: 1;
    font-size: 0.95rem;
    color: #333;
    line-height: 1.5;
    word-break: break-word;
    min-width: 0;
}

.income-expense-detail-amount {
    font-weight: 600;
}

.income-expense-detail-amount.income {
    color: #ff4d4f;
}

.income-expense-detail-amount.expense {
    color: #52c41a;
}

.income-expense-detail-item-left {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
}

.income-expense-detail-item-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.income-expense-detail-item-actions .income-expense-edit-btn,
.income-expense-detail-item-actions .income-expense-delete-btn {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: #666;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.income-expense-detail-item-actions .income-expense-edit-btn {
    transform: scaleX(-1);
}

.income-expense-detail-item-actions .income-expense-edit-btn:hover {
    background: transparent;
    color: #666;
}

.income-expense-detail-item-actions .income-expense-delete-btn:hover {
    background: transparent;
    color: #666;
}

.income-expense-detail-item-type {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: normal !important;
    white-space: nowrap;
    flex-shrink: 0;
}

.income-expense-detail-item-type.income {
    background: rgba(255, 77, 79, 0.1);
    color: #ff4d4f;
    font-weight: normal !important;
}

.income-expense-detail-item-type.expense {
    background: rgba(82, 196, 26, 0.1);
    color: #52c41a;
    font-weight: normal !important;
}

.income-expense-detail-item-info {
    flex: 1;
    min-width: 0;
}

.income-expense-detail-item-amount {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.income-expense-detail-item-amount.income {
    color: #ff4d4f;
}

.income-expense-detail-item-amount.expense {
    color: #52c41a;
}

.income-expense-detail-item-desc {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.5rem;
    word-break: break-word;
}

.income-expense-detail-item-meta {
    display: flex;
    gap: 0.75rem;
    font-size: 0.8rem;
    color: #999;
}

.income-expense-detail-item-date,
.income-expense-detail-item-frequency {
    white-space: nowrap;
}

/* 移动端收支明细弹窗样式 */
@media (max-width: 480px) {
    .income-expense-detail-modal {
        width: 100vw !important;
        max-width: 100vw !important;
        height: 100vh !important;
        max-height: 100vh !important;
        border-radius: 0 !important;
        margin: 0 !important;
    }

    .income-expense-detail-body {
        padding: 1rem;
    }

    .income-expense-detail-item {
        padding: 0.5rem 0.6rem;
    }

    .income-expense-detail-item-main {
        flex-direction: row;
        align-items: center;
        gap: 0.75rem;
    }

    .income-expense-detail-item-left {
        width: 100%;
        display: flex;
        align-items: center;
        gap: 0.75rem;
    }
    
    .income-expense-detail-item-text {
        flex: 1;
    }
}

.income-expense-stats {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.income-expense-stats-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    min-width: 0;
}

.stats-label {
    font-size: 0.9rem;
    color: #666;
    font-weight: normal;
}

.stats-value {
    font-size: 1rem;
    font-weight: 600;
}

.stats-value.income {
    color: #ff4d4f;
}

.stats-value.expense {
    color: #52c41a;
}

.income-expense-list {
    flex: 1;
    min-height: 0;
    max-height: 200px;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-right: 0.25rem;
}

.income-expense-list::-webkit-scrollbar {
    width: 4px;
}

.income-expense-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 2px;
}

.income-expense-list::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 2px;
}

.income-expense-list::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

.income-expense-empty {
    text-align: center;
    color: #999;
    padding: 2rem;
    font-size: 0.9rem;
}

.income-expense-item {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    padding: 0.75rem;
    transition: all 0.3s ease;
}

.income-expense-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.income-expense-item-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.income-expense-item-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
}

.income-expense-item-type {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: normal !important;
    white-space: nowrap;
    flex-shrink: 0;
}

.income-expense-item-type.income {
    background: rgba(255, 77, 79, 0.1);
    color: #ff4d4f;
    font-weight: normal !important;
}

.income-expense-item-type.expense {
    background: rgba(82, 196, 26, 0.1);
    color: #52c41a;
    font-weight: normal !important;
}

.income-expense-item-info {
    flex: 1;
    min-width: 0;
}

.income-expense-item-amount {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.income-expense-item-amount.income {
    color: #ff4d4f;
}

.income-expense-item-amount.expense {
    color: #52c41a;
}

.income-expense-item-desc {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 0.25rem;
    word-break: break-word;
}

.income-expense-item-meta {
    display: flex;
    gap: 0.75rem;
    font-size: 0.75rem;
    color: #999;
}

.income-expense-item-date,
.income-expense-item-frequency {
    white-space: nowrap;
}

.income-expense-item-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.income-expense-edit-btn,
.income-expense-delete-btn {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: #666;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.income-expense-edit-btn {
    transform: scaleX(-1);
}

.income-expense-edit-btn:hover {
    background: transparent;
    color: #666;
}

.income-expense-delete-btn:hover {
    background: transparent;
    color: #666;
}

/* 移动端收支模块样式调整 */
@media (max-width: 480px) {
    .income-expense-stats {
        flex-direction: column;
        gap: 0.5rem;
    }

    .income-expense-stats-item {
        min-width: auto;
    }

    .income-expense-item-main {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .income-expense-item-left {
        width: 100%;
    }

    .income-expense-item-actions {
        align-self: flex-end;
    }
}

/* 收支模块表单样式 */
.form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    align-items: flex-start;
}

.form-group-half {
    flex: 1;
    margin-bottom: 0;
    min-width: 0; /* 允许flex子元素缩小 */
}

/* 类型和金额行样式 */
.type-amount-row {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 1rem;
    width: 100%;
    box-sizing: border-box;
}

.type-radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    flex-shrink: 0;
    min-width: 0;
    align-items: flex-start;
}

.amount-input-group {
    flex: 0 0 auto;
    margin-bottom: 0;
    min-width: 0;
    max-width: 200px;
    width: 200px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
}

.description-submit-row {
    display: flex !important;
    gap: 0.5rem !important;
    align-items: center !important;
    margin-bottom: 0 !important;
    margin-top: 0.5rem !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.description-input-group {
    flex: 0 0 auto !important;
    margin: 0 !important;
    margin-bottom: 0 !important;
    margin-top: 0 !important;
    padding: 0 !important;
    min-width: 0 !important;
    max-width: 250px !important;
    width: 250px !important;
    display: flex !important;
    align-items: center !important;
    height: 44px !important;
    min-height: 44px !important;
    max-height: 44px !important;
    box-sizing: border-box !important;
}

.description-input-group .form-control {
    margin: 0 !important;
    box-sizing: border-box !important;
    height: 44px !important;
    min-height: 44px !important;
    max-height: 44px !important;
    line-height: 1.5 !important;
    font-size: 1rem !important;
    padding: 0.8rem 1rem !important;
    border: 1px solid var(--border-color) !important;
    width: 100% !important;
    vertical-align: middle !important;
}

.income-expense-submit-btn {
    flex-shrink: 0 !important;
    padding: 0.8rem 1rem !important;
    margin: 0 !important;
    white-space: nowrap !important;
    font-size: 1rem !important;
    font-weight: 500 !important;
    line-height: 1.5 !important;
    width: auto !important;
    box-sizing: border-box !important;
    border: none !important;
    border-radius: 10px !important;
    height: 44px !important;
    min-height: 44px !important;
    max-height: 44px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    vertical-align: middle !important;
}

.type-radio-item {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 0.4rem 0.8rem;
    border: none;
    border-radius: 8px;
    background: transparent;
    transition: all 0.3s ease;
    user-select: none;
    white-space: nowrap;
    flex-shrink: 0;
}

.type-radio-item:hover {
    background: transparent;
}

.type-radio-item input[type="radio"] {
    margin: 0;
    margin-right: 0.5rem;
    cursor: pointer;
}

.type-radio-item input[type="radio"]:checked {
    accent-color: #000000;
}

.type-radio-item input[type="radio"]:checked ~ span {
    font-weight: 600;
    color: #000000;
}

.type-radio-item.checked {
    background: transparent;
}

.type-radio-item.checked span {
    color: #000000;
    font-weight: 600;
}

.type-radio-item span {
    font-size: 0.9rem;
    color: #333;
    transition: all 0.3s ease;
}

.amount-input-group .form-control {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

/* 隐藏数字输入框的上下箭头 */
.amount-input-group input[type="number"]::-webkit-inner-spin-button,
.amount-input-group input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.amount-input-group input[type="number"] {
    -moz-appearance: textfield;
}

.frequency-radio-group {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.4rem;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
    width: 100%;
    justify-content: space-between;
}

.frequency-radio-group .frequency-radio-item {
    flex: 1;
    min-width: 0;
    box-sizing: border-box;
    overflow: hidden;
}

.frequency-radio-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    cursor: pointer;
    padding: 0.5rem 0.3rem;
    border: none;
    border-radius: 8px;
    background: transparent;
    transition: all 0.3s ease;
    user-select: none;
    gap: 0.3rem;
    text-align: center;
}

.frequency-radio-item:hover {
    background: transparent;
}

.frequency-radio-item input[type="radio"] {
    margin: 0;
    cursor: pointer;
    align-self: center;
    flex-shrink: 0;
}

.frequency-radio-item input[type="radio"]:checked {
    accent-color: #000000;
}

.frequency-radio-item input[type="radio"]:checked ~ span {
    font-weight: 600;
    color: #000000;
}

.frequency-radio-item.checked {
    background: transparent;
}

.frequency-radio-item.checked span {
    color: #000000;
    font-weight: 600;
}

.frequency-radio-item span {
    font-size: 0.9rem;
    color: #333;
    transition: all 0.3s ease;
    white-space: nowrap;
    text-align: center;
    width: 100%;
}

/* 移动端表单样式调整 */
@media (max-width: 480px) {
    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .form-group-half {
        margin-bottom: 1rem;
    }

    .frequency-radio-group {
        gap: 0.3rem;
        flex-wrap: nowrap;
    }

    .frequency-radio-item {
        padding: 0.4rem 0.2rem;
        font-size: 0.75rem;
        gap: 0.2rem;
    }
    
    .frequency-radio-item span {
        font-size: 0.75rem;
    }

    /* 类型和金额行在移动端的优化 */
    .type-amount-row {
        gap: 0.75rem;
        margin-bottom: 1rem;
        flex-wrap: nowrap;
    }

    .type-radio-group {
        flex-shrink: 0;
        gap: 0.4rem;
        flex-direction: row !important;
    }

    .type-radio-item {
        padding: 0.35rem 0.6rem;
        font-size: 0.85rem;
        min-width: auto;
    }

    .amount-input-group {
        flex: 1;
        min-width: 100px;
        max-width: 150px;
    }

    .amount-input-group .form-control {
        font-size: 0.9rem;
        padding: 0.6rem 0.8rem;
    }
    
    /* 描述和确定按钮行在移动端的优化 */
    .description-submit-row {
        flex-direction: row;
        align-items: center;
        gap: 0.5rem;
    }
    
    .description-input-group {
        flex: 1;
        min-width: 0;
        max-width: 180px;
    }
    
    .income-expense-submit-btn {
        flex-shrink: 0;
        white-space: nowrap;
        padding: 0.8rem 1rem !important;
        height: calc(1.5em + 1.6rem + 2px) !important;
    }

    /* 确保收支模块内容不溢出 - 尺寸必须与其他卡片完全一致 */
    .grid-item.income-expense-module {
        width: 320px !important;
        height: 240px !important;
        max-width: 320px !important;
        min-width: 320px !important;
        max-height: 240px !important;
        min-height: 240px !important;
        overflow: hidden !important;
        padding: 1rem !important;
        flex-shrink: 0 !important;
        flex-grow: 0 !important;
    }

    .income-expense-container {
        width: 100%;
        box-sizing: border-box;
        overflow: hidden;
        gap: 0.5rem;
    }

    .income-expense-list {
        max-height: 120px;
    }

    .income-expense-stats {
        margin-bottom: 0.25rem;
        padding: 0.75rem;
    }
}
