/* assets/style.css */

/* Naive UI 风格变量系统 */
:root {
    --n-primary: #18a058;
    --n-primary-hover: #36ad6a;
    --n-primary-active: #0c7a43;
    --n-primary-suppl: #36ad6a;

    --n-text-1: #333639;
    --n-text-2: #666666;
    --n-text-3: #999999;

    --n-border: #efeff5;
    --n-border-hover: #18a058;

    --n-bg-1: #ffffff;
    --n-bg-2: #f9fafb;
    --n-bg-modal: #ffffff;

    --n-radius: 4px;
    /* Naive UI 倾向于更小的方圆角 */
    --n-shadow: 0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 9px 28px 8px rgba(0, 0, 0, 0.05);

    --n-danger: #d03050;
    --n-success: #18a058;
    --n-warning: #f0a020;
    --n-info: #2080f0;
}

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

html,
body {
    height: 100%;
    font-family: v-sans, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    background: #fcfcfc;
    color: var(--n-text-1);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* 图标样式 */
.icon {
    display: inline-flex;
    width: 24px;
    height: 24px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    flex-shrink: 0;
}

.icon-dashboard {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2318a058'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6'%3E%3C/path%3E%3C/svg%3E");
}

.icon-lightning {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2318a058'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M13 10V3L4 14h7v7l9-11h-7z'%3E%3C/path%3E%3C/svg%3E");
}

.icon-chart {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2318a058'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z'%3E%3C/path%3E%3C/svg%3E");
}

.icon-users {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2318a058'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M12 4.354a4 4 0 110 5.292M15 21H3v-1a6 6 0 0112 0v1zm0 0h6v-1a6 6 0 00-9-5.197M13 7a4 4 0 11-8 0 4 4 0 018 0z'%3E%3C/path%3E%3C/svg%3E");
}

.icon-document {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2318a058'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z'%3E%3C/path%3E%3C/svg%3E");
}

.icon-warning {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23f59e0b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z'%3E%3C/path%3E%3C/svg%3E");
}

.icon-user {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2318a058'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z'%3E%3C/path%3E%3C/svg%3E");
}

.icon-cog {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2318a058'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z'%3E%3C/path%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M15 12a3 3 0 11-6 0 3 3 0 016 0z'%3E%3C/path%3E%3C/svg%3E");
}

.icon-megaphone {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2318a058'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M11 5.882V19.24a1.76 1.76 0 01-3.417.592l-2.147-6.15M18 13a3 3 0 100-6M5.436 13.683A4.001 4.001 0 017 6h1.832c4.1 0 7.625-1.234 9.168-3v14c-1.543-1.766-5.067-3-9.168-3H7a3.988 3.988 0 01-1.564-.317z'%3E%3C/path%3E%3C/svg%3E");
}

/* 仪表板样式 - Naive UI风格 */
.dashboard-header {
    text-align: left;
    margin-bottom: 32px;
    padding: 24px 24px 24px 16px;
    background: linear-gradient(135deg, #18a058 0%, #36ad6a 100%);
    color: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(24, 160, 88, 0.15);
}

.dashboard-header h2 {
    margin: 0 0 8px 0;
    font-size: 24px;
    font-weight: 600;
}

.dashboard-subtitle {
    margin: 0;
    opacity: 0.9;
    font-size: 14px;
    text-align: left;
}

/* Naive UI 2/4 布局 */
.dashboard-layout {
    display: grid;
    grid-template-columns: 2fr 4fr;
    gap: 24px;
    margin-bottom: 32px;
}

/* 左侧列 */
.dashboard-left {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* 右侧列 */
.dashboard-right {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Naive UI 卡片样式 */
.n-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
    padding-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.n-card:hover {
    border-color: #18a058;
    box-shadow: 0 4px 12px rgba(24, 160, 88, 0.12);
}

.n-card-header {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f0f0;
    gap: 12px;
}

.n-card-header .icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.n-card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

.n-card-icon {
    font-size: 24px;
    margin-right: 12px;
    color: #18a058;
}

.n-card-content {
    color: #4b5563;
}

/* 快捷操作网格 */
.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.quick-action-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    text-decoration: none;
    color: #374151;
    font-size: 14px;
    transition: all 0.2s ease;
    gap: 8px;
}

.quick-action-item:hover {
    background: #f1f5f9;
    border-color: #18a058;
    color: #18a058;
}

.quick-action-item .icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* 统计数据 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

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

.stat-label {
    color: #6b7280;
    font-size: 14px;
}

.stat-value {
    font-size: 16px;
    font-weight: 600;
    color: #18a058;
}

/* 在线用户 */
.online-users-display {
    text-align: center;
    padding: 20px 0 24px 0;
}

.online-count {
    font-size: 36px;
    font-weight: 700;
    color: #18a058;
    margin-bottom: 8px;
}

.online-label {
    color: #6b7280;
    font-size: 14px;
}

.online-list {
    margin-top: 16px;
    padding: 12px;
    background: #fafafa;
    border-radius: 6px;
    max-height: 120px;
    overflow-y: auto;
    margin-bottom: 24px;
}

.online-user-item {
    padding: 8px 0;
    font-size: 13px;
    color: #4b5563;
    border-bottom: 1px solid #f0f0f0;
}

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

/* 活动列表 */
.activity-list {
    max-height: 300px;
    overflow-y: auto;
    padding: 4px;
    margin-bottom: 24px;
}

.activity-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 13px;
}

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

.activity-content {
    flex: 1;
    margin-right: 12px;
}

.activity-action {
    color: #1f2937;
    font-weight: 500;
    margin-bottom: 4px;
}

.activity-time {
    color: #9ca3af;
    font-size: 12px;
}

.activity-meta {
    color: #6b7280;
    font-size: 12px;
}

/* 待处理事项 */
.pending-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pending-item {
    display: flex;
    align-items: center;
    padding: 16px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    border-left: 4px solid #f59e0b;
    transition: all 0.2s;
}

.pending-item:hover {
    border-color: #f59e0b;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.1);
}

.pending-item.high {
    border-left-color: #ef4444;
}

.pending-item.high:hover {
    border-color: #ef4444;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.1);
}

.pending-item.medium {
    border-left-color: #f59e0b;
}

.pending-item.low {
    border-left-color: #3b82f6;
}

.pending-content {
    flex: 1;
    margin-right: 16px;
}

.pending-title {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 4px;
    font-size: 14px;
}

.pending-desc {
    color: #6b7280;
    font-size: 13px;
    line-height: 1.4;
}

.pending-actions {
    display: flex;
    gap: 8px;
}

.pending-time {
    color: #9ca3af;
    font-size: 12px;
    white-space: nowrap;
}

/* Naive UI 按钮样式 */
.n-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    background: white;
    color: #374151;
    text-decoration: none;
}

.n-button:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

.n-button--primary {
    background: #18a058;
    color: white;
    border-color: #18a058;
}

.n-button--primary:hover {
    background: #36ad6a;
    border-color: #36ad6a;
}

.n-button--secondary {
    background: #6b7280;
    color: white;
    border-color: #6b7280;
}

.n-button--secondary:hover {
    background: #4b5563;
    border-color: #4b5563;
}

.n-button--small {
    padding: 6px 12px;
    font-size: 13px;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .dashboard-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .dashboard-left,
    .dashboard-right {
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .dashboard-header {
        padding: 20px;
        margin-bottom: 24px;
    }
    
    .dashboard-header h2 {
        font-size: 20px;
    }
    
    .quick-actions-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .online-count {
        font-size: 28px;
    }
    
    .n-card {
        padding: 16px;
    }
    
    .n-card-header {
        padding-bottom: 8px;
        margin-bottom: 12px;
    }
}

.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px 80px;
}

@media (max-width: 480px) {
    .app-container {
        padding: 0 12px 60px;
    }
}

/* 顶部导航 - Naive UI 风格 (Header) */
.top-bar {
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    margin-bottom: 24px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--n-border);
}

.top-bar-title {
    font-size: 18px;
    font-weight: 500;
    color: var(--n-text-1);
}

/* 头像与下拉 */
.user-info-wrapper {
    position: relative;
}

.avatar-container {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid var(--n-border);
    transition: border-color 0.3s;
}

.avatar-container:hover {
    border-color: var(--n-primary);
}

.avatar-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 200px;
    background: #fff;
    border-radius: var(--n-radius);
    box-shadow: var(--n-shadow);
    border: 1px solid var(--n-border);
    padding: 6px;
    display: none;
    flex-direction: column;
    z-index: 1001;
}

.dropdown-item {
    padding: 8px 12px;
    font-size: 14px;
    color: var(--n-text-2);
    border-radius: var(--n-radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dropdown-item:hover {
    background: #f3f3f5;
    color: var(--n-primary);
}

.dropdown-item.danger {
    color: var(--n-danger);
}

.dropdown-item.danger:hover {
    background: #fff1f0;
}

/* 核心：Naive UI 风格 Table */
.table-wrapper {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--n-border);
    border-radius: var(--n-radius);
}

.n-table {
    width: 100%;
    border-spacing: 0;
    border-collapse: separate;
    /* 改为 separate 以支持圆角 */
    border-radius: var(--n-radius);
    overflow: hidden;
    /* 确保圆角生效 */
    background: #fff;
    text-align: left;
    border: 1px solid var(--n-border);
    /* 外边框 */
}

.n-table th {
    background: #fafafc;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--n-text-1);
    border-bottom: 1px solid var(--n-border);
    white-space: nowrap;
    /* 表头不换行 */
}

.n-table td {
    padding: 12px 16px;
    font-size: 14px;
    color: var(--n-text-2);
    border-bottom: 1px solid var(--n-border);
    transition: background-color 0.3s;
}

.n-table tr:last-child td {
    border-bottom: none;
}

.n-table tr:hover td {
    background-color: #f3fcf8;
    /* 悬停颜色调整为极淡的绿色以呼应主色 */
}

/* Form 控件 */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 14px;
    margin-bottom: 8px;
    font-weight: 400;
    color: var(--n-text-1);
}

input[type="text"],
input[type="number"],
input[type="password"],
input[type="email"],
select,
textarea {
    width: 100%;
    padding: 8px 12px;
    border-radius: var(--n-radius);
    border: 1px solid var(--n-border);
    background: #fff;
    color: var(--n-text-1);
    font-size: 14px;
    transition: border-color 0.3s, box-shadow 0.3s;
    outline: none;
}

input:hover,
select:hover,
textarea:hover {
    border-color: var(--n-primary-hover);
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--n-primary);
    box-shadow: 0 0 0 3px rgba(24, 160, 88, 0.2);
}

/* 按钮系统 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    /* 稍微缩小默认内边距 */
    border-radius: var(--n-radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--n-border);
    background: #fff;
    color: var(--n-text-2);
    user-select: none;
    line-height: 1;
    white-space: nowrap;
    /* 防止按钮内文字折行 */
}

@media (max-width: 480px) {
    .btn {
        padding: 8px 12px;
        font-size: 13px;
    }

    .btn-sm {
        padding: 4px 8px;
        font-size: 12px;
    }
}

.btn:hover {
    color: var(--n-primary-hover);
    border-color: var(--n-primary-hover);
    background: #f9f9f9;
}

.btn:active {
    transform: scale(0.97);
    background: #f3f3f5;
}

.btn-primary {
    background: var(--n-primary);
    border-color: var(--n-primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--n-primary-hover);
    border-color: var(--n-primary-hover);
    color: #fff;
}

.btn-primary:active {
    background: var(--n-primary-active);
}

.btn-danger {
    background: #fff;
    color: var(--n-danger);
    border-color: var(--n-danger);
}

.btn-danger:hover {
    background: var(--n-danger);
    color: #fff;
}

.btn-full {
    width: 100% !important;
}

/* 轮播图系统 */
.carousel {
    position: relative;
    width: 100%;
    height: 200px;
    /* 稍微缩小高度以适应小屏幕 */
    background: #f3f3f5;
    border-radius: var(--n-radius);
    overflow: hidden;
    /* 强制裁剪溢出内容 */
    margin-bottom: 16px;
    border: 1px solid var(--n-border);
}

.carousel-inner {
    display: flex;
    height: 100%;
    width: 100%;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.carousel-item {
    flex: 0 0 100%;
    height: 100%;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* 确保图片不失真且充满容器 */
    cursor: pointer;
    display: block;
}

.carousel-dots {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 15;
}

.dot {
    width: 6px;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: all 0.3s;
}

.dot.active {
    background: #fff;
    width: 14px;
}

.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    background: rgba(0, 0, 0, 0.25);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 50%;
    z-index: 20;
    transition: background 0.3s, opacity 0.3s;
    user-select: none;
    font-size: 14px;
    backdrop-filter: blur(2px);
}

.carousel-arrow:hover {
    background: rgba(0, 0, 0, 0.5);
}

.arrow-left {
    left: 8px;
}

.arrow-right {
    right: 8px;
}

/* 卡片 */
.card {
    background: #fff;
    border: 1px solid var(--n-border);
    border-radius: var(--n-radius);
    padding: 24px;
    margin-bottom: 24px;
}

.card-header {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-header::before {
    content: "";
    display: inline-block;
    width: 4px;
    height: 18px;
    background: var(--n-primary);
    border-radius: 2px;
}

/* 统计网格 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: #fff;
    padding: 16px;
    border: 1px solid var(--n-border);
    border-radius: var(--n-radius);
    transition: border-color 0.3s;
}

.stat-card:hover {
    border-color: var(--n-primary);
}

.stat-label {
    font-size: 13px;
    color: var(--n-text-3);
    margin-bottom: 4px;
}

.stat-value {
    font-size: 24px;
    font-weight: 500;
    color: var(--n-text-1);
}

/* Tabs */
.tabs {
    display: flex;
    gap: 0;
    border: 1px solid var(--n-border);
    border-radius: var(--n-radius);
    overflow: hidden;
    width: fit-content;
    margin-bottom: 24px;
}

.tab-item {
    padding: 8px 16px;
    font-size: 14px;
    cursor: pointer;
    background: #fff;
    border-right: 1px solid var(--n-border);
    transition: all 0.3s;
}

.tab-item:last-child {
    border-right: none;
}

.tab-item:hover {
    color: var(--n-primary);
}

.tab-item.active {
    background: #f3f3f5;
    color: var(--n-primary);
    font-weight: 500;
}

/* 专用：消费记录分色 */
.text-danger {
    color: var(--n-danger);
    font-weight: 500;
}

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

/* 移动端 */
@media (max-width: 640px) {
    .app-container {
        padding: 0 12px 40px;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .stat-value {
        font-size: 20px;
    }

    .tabs {
        width: 100%;
        overflow-x: auto;
    }
}

/* Modal 改进 */
/* 模态框 (Modal) 强化修复 */
.modal-overlay {
    background: rgba(0, 0, 0, 0.65) !important;
    /* 加深遮罩，突出内容 */
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 3000;
    /* 确保在最顶层 */
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
    /* 轻微模糊背景 */
}

.modal-content {
    background: #ffffff !important;
    /* 强制纯白背景 */
    color: var(--n-text-1) !important;
    border-radius: 12px !important;
    /* 更大的圆角 */
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04) !important;
    /* 更深的阴影 */
    max-width: 600px !important;
    /* 增加最大宽度 */
    width: 90% !important;
    /* 增加宽度比例 */
    max-height: 85vh !important;
    overflow: auto;
    padding: 32px !important;
    /* 增加内边距 */
    position: relative;
    animation: modalSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    visibility: visible !important;
    opacity: 1 !important;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes modalSlideOut {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

    to {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
}

.modal-overlay.closing {
    animation: modalFadeOut 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.modal-content.closing {
    animation: modalSlideOut 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

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

/* 分隔线优化 */
hr {
    border: none;
    border-top: 1px solid var(--n-border);
    margin: 20px 0;
}

/* 公告列表适配 */
.notice-list {
    list-style: none;
}

.notice-item {
    padding: 12px 0;
    border-bottom: 1px dotted var(--n-border);
    cursor: pointer;
    transition: color 0.3s;
}

.notice-item:hover {
    color: var(--n-primary);
}

/* Sidebar Layout - Naive UI Style */
.layout-container {
    display: flex;
    min-height: 100vh;
    background: #fcfcfc;
}

.layout-sider {
    width: 240px;
    background: #fff;
    border-right: 1px solid var(--n-border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
}

.sider-brand {
    padding: 20px;
    font-size: 20px;
    font-weight: 600;
    color: var(--n-primary);
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--n-border);
}

.sider-user {
    padding: 20px;
    border-bottom: 1px solid var(--n-border);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sider-user .avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--n-primary);
}

.sider-user .info {
    flex: 1;
    overflow: hidden;
}

.sider-user .name {
    font-weight: 500;
    font-size: 15px;
    color: var(--n-text-1);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sider-user .sub {
    font-size: 12px;
    color: var(--n-text-3);
}

/* 侧边栏菜单 */
.n-menu {
    flex: 1;
    padding: 12px;
    overflow-y: auto;
}

.n-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    margin-bottom: 4px;
    border-radius: var(--n-radius);
    color: var(--n-text-2);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 15px;
}

.n-menu-item:hover {
    background: #f3f3f5;
    color: var(--n-text-1);
}

.n-menu-item.active {
    background: rgba(24, 160, 88, 0.1);
    color: var(--n-primary);
    font-weight: 500;
}

.n-menu-item .icon {
    font-size: 18px;
}

.layout-content {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    background: #fcfcfc;
}

/* 移动端汉堡菜单 */
.mobile-toggle {
    display: none;
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 2000;
    width: 40px;
    height: 40px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
}

.mobile-mask {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

@media (max-width: 768px) {
    .layout-sider {
        position: fixed;
        height: 100%;
        transform: translateX(-100%);
    }

    .layout-sider.show {
        transform: translateX(0);
    }

    .mobile-toggle {
        display: flex;
    }

    .mobile-mask.show {
        display: block;
    }

    .layout-content {
        padding: 60px 16px 20px;
        /* 留出顶部空间给 toggle */
    }
}

/* 商店商品卡片 */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.product-card {
    background: #fff;
    border: 1px solid var(--n-border);
    border-radius: var(--n-radius);
    overflow: hidden;
    transition: shadow 0.3s;
}

.product-card:hover {
    box-shadow: var(--n-shadow);
}

.p-img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    background: #f5f5f5;
}

.p-body {
    padding: 12px;
}

.p-title {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.p-price {
    color: var(--n-danger);
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 8px;
}

.p-stock {
    font-size: 12px;
    color: var(--n-text-3);
    margin-bottom: 12px;
}

input[type="date"] {
    position: relative;
    font-family: inherit;
}

input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.3s;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

/* 登录页辅助 */
.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-header h1 {
    font-size: 28px;
    font-weight: 500;
    color: var(--n-primary);
}

.login-header p {
    color: var(--n-text-3);
    font-size: 14px;
}