/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Microsoft YaHei", "Comic Sans MS", Arial, sans-serif;
}

/* 全局变量 */
:root {
    --pink-primary: #ff85a2;
    --pink-light: #fce7f3;
    --pink-dark: #e8708e;
    --white: #ffffff;
    --gray-light: #f5f5f5;
    --gray: #999999;
    --gray-dark: #666666;
    --green: #4ade80;
    --yellow: #facc15;
    --red: #ef4444;
    --blue: #60a5fa;
    --border-radius: 20px;
    --shadow: 0 4px 15px rgba(255, 133, 162, 0.2);
}

/* 主体样式 */
body {
    background-color: var(--white);
    color: var(--gray-dark);
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

/* 移动端导航开关 */
.mobile-nav-toggle {
    display: none;
    position: fixed;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background-color: var(--pink-primary);
    border-radius: 50%;
    color: white;
    font-size: 20px;
    text-align: center;
    line-height: 50px;
    cursor: pointer;
    box-shadow: var(--shadow);
    z-index: 1000;
}

/* 侧边栏样式 */
.sidebar {
    width: 260px;
    background-color: var(--pink-light);
    border-right: 2px solid var(--pink-primary);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    overflow-y: auto;
    z-index: 999;
}

/* 二次元滚动条 */
.sidebar::-webkit-scrollbar {
    width: 8px;
}

.sidebar::-webkit-scrollbar-track {
    background: var(--pink-light);
    border-radius: 10px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--pink-primary);
    border-radius: 10px;
}

.sidebar-header {
    background-color: var(--pink-primary);
    color: white;
    padding: 20px;
    text-align: center;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
}

.sidebar-header h1 {
    font-size: 18px;
    margin-bottom: 5px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

.sidebar-header p {
    font-size: 12px;
    opacity: 0.9;
}

.sidebar-nav {
    padding: 20px;
}

.sidebar-nav ul {
    list-style: none;
}

.sidebar-nav li {
    margin-bottom: 10px;
}

.nav-link {
    display: block;
    padding: 12px 15px;
    color: var(--gray-dark);
    text-decoration: none;
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.nav-link.active {
    background-color: var(--white);
    border-color: var(--pink-primary);
    box-shadow: var(--shadow);
    color: var(--pink-primary);
    font-weight: bold;
}

.nav-link:hover:not(.active) {
    background-color: var(--pink-light);
    border-color: var(--pink-primary);
    color: var(--pink-primary);
}

.nav-link i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 20px;
    text-align: center;
    font-size: 12px;
    color: var(--gray);
    border-top: 1px solid var(--pink-primary);
    margin-top: 20px;
}

/* 主内容区域 */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 30px;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

/* 卡片样式（粉色椭圆区块） */
.card {
    background-color: var(--white);
    border: 2px solid var(--pink-primary);
    border-radius: var(--border-radius);
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
}

.card h2 {
    color: var(--pink-primary);
    margin-bottom: 20px;
    font-size: 18px;
    display: flex;
    align-items: center;
}

.card h2 i {
    margin-right: 10px;
    font-size: 20px;
}

.card h3 {
    color: var(--pink-primary);
    margin: 15px 0 10px 0;
    font-size: 16px;
}

/* 表单样式 */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: var(--gray-dark);
    font-weight: bold;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--pink-primary);
    border-radius: var(--border-radius);
    background-color: var(--white);
    color: var(--gray-dark);
    font-size: 14px;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 133, 162, 0.2);
}

/* 按钮样式（粉色椭圆） */
.btn {
    padding: 12px 20px;
    border: 2px solid var(--pink-primary);
    border-radius: var(--border-radius);
    background-color: var(--pink-primary);
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.btn:hover {
    background-color: var(--pink-dark);
    transform: scale(1.02);
}

.btn:active {
    transform: scale(0.98);
}

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

.btn-secondary:hover {
    background-color: var(--pink-light);
}

.btn-success {
    background-color: var(--green);
    border-color: var(--green);
}

.btn-success:hover {
    background-color: #34d399;
}

.btn-warning {
    background-color: var(--yellow);
    border-color: var(--yellow);
    color: var(--gray-dark);
}

.btn-warning:hover {
    background-color: #fbbf24;
}

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

.btn-danger:hover {
    background-color: #dc2626;
}

.btn-group {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.mt-2 {
    margin-top: 10px;
}

.mt-3 {
    margin-top: 15px;
}

/* 计时面板样式 */
.timer-card {
    text-align: center;
}

.timer-display {
    font-size: 48px;
    font-weight: bold;
    color: var(--pink-primary);
    margin: 20px 0;
    text-shadow: 2px 2px 4px rgba(255, 133, 162, 0.2);
}

.cost-display {
    font-size: 16px;
    margin-bottom: 20px;
    color: var(--gray-dark);
}

.cost-display span {
    color: var(--pink-primary);
    font-weight: bold;
}

/* 排行/列表样式 */
.ranking-list,
.account-list,
.records-list,
.details-list {
    margin-top: 15px;
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--pink-light);
    border-radius: var(--border-radius);
    padding: 10px;
}

/* 列表滚动条 */
.ranking-list::-webkit-scrollbar,
.account-list::-webkit-scrollbar,
.records-list::-webkit-scrollbar,
.details-list::-webkit-scrollbar {
    width: 8px;
}

.ranking-list::-webkit-scrollbar-track,
.account-list::-webkit-scrollbar-track,
.records-list::-webkit-scrollbar-track,
.details-list::-webkit-scrollbar-track {
    background: var(--white);
    border-radius: 10px;
}

.ranking-list::-webkit-scrollbar-thumb,
.account-list::-webkit-scrollbar-thumb,
.records-list::-webkit-scrollbar-thumb,
.details-list::-webkit-scrollbar-thumb {
    background: var(--pink-primary);
    border-radius: 10px;
}

.ranking-item,
.account-item,
.record-item,
.detail-item {
    padding: 10px;
    border-bottom: 1px solid var(--pink-light);
    border-radius: 10px;
    margin-bottom: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ranking-item:last-child,
.account-item:last-child,
.record-item:last-child,
.detail-item:last-child {
    border-bottom: none;
}

.ranking-item .rank {
    font-weight: bold;
    color: var(--pink-primary);
    margin-right: 10px;
}

.ranking-item .balance {
    font-weight: bold;
    color: var(--green);
}

.account-item .price {
    color: var(--pink-primary);
    font-weight: bold;
}

.account-item .account-info {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.account-item .delete-btn {
    background-color: var(--red);
    color: white;
    border: none;
    border-radius: 8px;
    width: 32px;
    height: 32px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    margin-left: 10px;
}

.account-item .delete-btn:hover {
    background-color: #dc2626;
    transform: scale(1.1);
}

.account-item .delete-btn:active {
    transform: scale(0.95);
}

.record-item .type {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    color: white;
    margin-right: 10px;
}

.record-item .income {
    background-color: var(--green);
}

.record-item .expense {
    background-color: var(--red);
}

.empty-tip {
    text-align: center;
    color: var(--gray);
    padding: 20px;
}

/* 老板信息样式 */
.boss-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 10px;
    background-color: var(--pink-light);
    border-radius: var(--border-radius);
}

.boss-name {
    font-size: 16px;
    font-weight: bold;
    color: var(--pink-primary);
}

.boss-balance {
    color: var(--green);
    font-weight: bold;
}

/* 统计样式 */
.stat-period {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.period-btn {
    flex: 1;
    min-width: 80px;
}

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

.date-picker-container {
    display: flex;
    gap: 10px;
    align-items: center;
    flex: 2;
    min-width: 200px;
}

.date-picker {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--gray-light);
    border-radius: var(--border-radius);
    background-color: white;
    font-size: 14px;
    transition: all 0.3s ease;
}

.date-picker:focus {
    outline: none;
    border-color: var(--pink-primary);
    box-shadow: 0 0 0 2px rgba(255, 107, 129, 0.2);
}

.date-range-display {
    background-color: var(--pink-light);
    padding: 10px 15px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    font-size: 14px;
    color: var(--gray-dark);
    border-left: 4px solid var(--pink-primary);
}

.date-range-display i {
    color: var(--pink-primary);
    margin-right: 8px;
}

.ranking-list {
    max-height: 300px;
    overflow-y: auto;
}

.ranking-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    margin-bottom: 8px;
    background-color: var(--pink-light);
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
}

.ranking-item:hover {
    background-color: rgba(255, 107, 129, 0.1);
    transform: translateY(-2px);
}

.ranking-item .rank {
    background-color: var(--pink-primary);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    margin-right: 10px;
}

.ranking-item .name {
    font-weight: bold;
    color: var(--gray-dark);
}

.ranking-item .balance {
    color: var(--green);
    font-weight: bold;
}

.stat-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.stat-item {
    padding: 15px;
    background-color: var(--pink-light);
    border-radius: var(--border-radius);
    text-align: center;
}

.stat-item .label {
    display: block;
    font-size: 14px;
    color: var(--gray-dark);
    margin-bottom: 5px;
}

.stat-item .value {
    font-size: 24px;
    font-weight: bold;
}

.income {
    color: var(--green);
}

.expense {
    color: var(--red);
}

.net-income {
    color: var(--pink-primary);
}

.detail-item .amount {
    font-weight: bold;
}

.detail-item .income {
    color: var(--green);
}

.detail-item .expense {
    color: var(--red);
}

.detail-item .time {
    font-size: 12px;
    color: var(--gray);
    margin-top: 5px;
}

/* 同步页面样式 */
.sync-status {
    margin-bottom: 20px;
    padding: 10px;
    background-color: var(--pink-light);
    border-radius: var(--border-radius);
    color: var(--gray-dark);
}

.sync-tip {
    margin-top: 15px;
    padding: 10px;
    background-color: var(--pink-light);
    border-radius: var(--border-radius);
    font-size: 12px;
    color: var(--gray-dark);
}

.sync-tip p {
    margin-bottom: 5px;
}

/* 提示弹窗 */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    padding: 15px 25px;
    background-color: var(--pink-primary);
    color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1000;
}

.toast.show {
    opacity: 1;
}

.toast i {
    margin-right: 10px;
    font-size: 18px;
}

/* 响应式适配 */
@media (max-width: 768px) {
    .mobile-nav-toggle {
        display: block;
    }

    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        padding: 20px;
        margin-top: 70px;
    }

    .stat-summary {
        grid-template-columns: 1fr;
    }

    .btn-group {
        flex-direction: column;
    }

    .timer-display {
        font-size: 36px;
    }
    
    .stat-period {
        flex-direction: column;
        gap: 8px;
    }
    
    .date-picker-container {
        flex-direction: column;
        min-width: auto;
    }
    
    .date-picker {
        width: 100%;
    }
    
    .ranking-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .ranking-item > div {
        display: flex;
        align-items: center;
        width: 100%;
    }
    
    .ranking-item .balance {
        align-self: flex-end;
    }
}

@media (max-width: 480px) {
    .main-content {
        padding: 15px 10px 70px 10px;
    }
    
    .card {
        padding: 12px;
    }
    
    .page-header h1 {
        font-size: 18px;
    }
    
    .stat-item .value {
        font-size: 20px;
    }
    
    .date-range-display {
        font-size: 12px;
        padding: 8px 12px;
    }
}

/* 数据管理页面样式 */
.data-info {
    margin-bottom: 20px;
    padding: 15px;
    background: linear-gradient(135deg, #ff85a2, #fce7f3);
    border-radius: var(--border-radius);
    color: white;
    text-align: center;
    box-shadow: var(--shadow);
}

.data-info i {
    font-size: 24px;
    margin-right: 10px;
}

.data-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.import-controls {
    margin-bottom: 20px;
}

.import-options {
    display: flex;
    gap: 20px;
    margin-top: 15px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: var(--gray-dark);
}

.checkbox-label input[type="radio"] {
    margin-right: 8px;
    accent-color: var(--pink-primary);
}

.danger-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.danger-controls .btn {
    flex: 1;
    min-width: 150px;
}

/* 二次元可爱风格增强 */
.card h2 {
    position: relative;
    padding-left: 40px;
}

.card h2 i {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 24px;
    color: var(--pink-primary);
}

.sync-tip {
    background: linear-gradient(135deg, #fce7f3, #fff0f5);
    border-left: 4px solid var(--pink-primary);
    border-radius: 10px;
}

.sync-tip p {
    margin-bottom: 8px;
    line-height: 1.4;
}

.sync-tip strong {
    color: var(--pink-dark);
}

/* 按钮图标样式 */
.btn i {
    margin-right: 8px;
    font-size: 14px;
}

/* 文件输入样式 */
#import-file-input {
    display: none;
}

/* 数据管理页面特定响应式 */
@media (max-width: 768px) {
    .data-controls,
    .danger-controls {
        flex-direction: column;
    }
    
    .import-options {
        flex-direction: column;
        gap: 10px;
    }
    
    .data-info {
        font-size: 14px;
    }
}

/* 二次元风格密码访问页面 */
.password-page {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #ff85a2, #fce7f3, #fff0f5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.5s ease;
}

.anime-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    max-width: 400px;
    width: 90%;
    padding: 40px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 30px;
    box-shadow: 0 20px 40px rgba(255, 133, 162, 0.3);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 133, 162, 0.3);
}

.anime-character {
    position: relative;
    width: 120px;
    height: 150px;
    animation: bounce 2s infinite ease-in-out;
}

.character-head {
    width: 80px;
    height: 80px;
    background: #ff85a2;
    border-radius: 50%;
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    box-shadow: 0 4px 15px rgba(255, 133, 162, 0.4);
}

.character-face {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 40px;
}

.character-eyes {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.eye {
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    position: relative;
    animation: blink 3s infinite;
}

.eye::after {
    content: '';
    position: absolute;
    top: 5px;
    left: 5px;
    width: 8px;
    height: 8px;
    background: #333;
    border-radius: 50%;
}

.character-mouth {
    width: 30px;
    height: 10px;
    background: white;
    border-radius: 0 0 15px 15px;
    margin: 0 auto;
    animation: mouthMove 2s infinite alternate;
}

.character-body {
    position: absolute;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 70px;
    background: #ff85a2;
    border-radius: 0 0 30px 30px;
}

.character-arms {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    display: flex;
    justify-content: space-between;
}

.arm {
    width: 20px;
    height: 30px;
    background: #ff85a2;
    border-radius: 10px;
    animation: wave 3s infinite ease-in-out;
}

.left-arm {
    animation-delay: 0s;
}

.right-arm {
    animation-delay: 1.5s;
}

.password-form {
    text-align: center;
    width: 100%;
}

.anime-title {
    font-size: 24px;
    color: #ff85a2;
    margin-bottom: 10px;
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(255, 133, 162, 0.3);
}

.anime-title i {
    margin-right: 10px;
    animation: spin 3s infinite linear;
}

.anime-subtitle {
    color: #666;
    margin-bottom: 30px;
    font-size: 16px;
}

.input-group {
    position: relative;
    margin-bottom: 25px;
}

.input-group i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #ff85a2;
    font-size: 18px;
    z-index: 2;
}

#password-input {
    width: 100%;
    padding: 15px 15px 15px 45px;
    border: 2px solid #ff85a2;
    border-radius: 25px;
    font-size: 16px;
    background: white;
    transition: all 0.3s ease;
    outline: none;
}

#password-input:focus {
    box-shadow: 0 0 0 3px rgba(255, 133, 162, 0.3);
    transform: scale(1.02);
}

.anime-button {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #ff85a2, #ff6b81);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 133, 162, 0.4);
}

.anime-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 133, 162, 0.6);
}

.anime-button:active {
    transform: translateY(0);
}

.anime-button i {
    margin-right: 8px;
    animation: paw 2s infinite;
}

.error-message {
    color: #ef4444;
    font-size: 14px;
    margin-top: 10px;
    min-height: 20px;
    animation: shake 0.5s ease;
}

.anime-hint {
    margin-top: 20px;
    color: #999;
    font-size: 14px;
}

.anime-hint i {
    margin-right: 5px;
    animation: light 2s infinite alternate;
}

.hidden {
    display: none !important;
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes blink {
    0%, 90%, 100% { transform: scaleY(1); }
    95% { transform: scaleY(0.1); }
}

@keyframes mouthMove {
    0% { height: 10px; }
    100% { height: 5px; }
}

@keyframes wave {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(20deg); }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes paw {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

@keyframes light {
    0% { opacity: 0.5; }
    100% { opacity: 1; }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}