/* 南沙街商会后台管理系统 - 蓝白官方风格 */

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

html, body {
    height: 100%;
    overflow: hidden !important;
    position: relative;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Helvetica Neue", Arial, sans-serif;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

/* 官方蓝色主题色 */
:root {
    --primary-blue: #3b82f6;       /* 主蓝色 - 改为浅蓝 */
    --light-blue: #60a5fa;         /* 浅蓝色 */
    --dark-blue: #2563eb;          /* 深蓝色 */
    --bg-blue: #3b82f6;              /* 背景蓝色 */
    --border-blue: #93c5fd;         /* 边框蓝色 - 更浅 */
    --hover-blue: #2563eb;          /* 悬停蓝色 */
    --white: #ffffff;               /* 白色 */
    --gray-50: #f9fafb;             /* 浅灰 */
    --gray-100: #f3f4f6;            /* 灰色背景 */
    --gray-200: #e5e7eb;            /* 边框灰色 */
    --gray-300: #d1d5db;            /* 分割线灰色 */
    --gray-600: #4b5563;            /* 文字灰色 */
    --gray-800: #1f2937;            /* 深色文字 */
    --success: #10b981;             /* 成功绿色 */
    --danger: #ef4444;              /* 危险红色 */
    --warning: #f59e0b;             /* 警告橙色 */
}

/* 登录页面样式 */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--dark-blue) 100%);
    padding: 20px;
}

.login-box {
    background: var(--white);
    border-radius: 8px;
    border: 2px solid var(--primary-blue);
    box-shadow: 0 20px 60px rgba(59, 130, 246, 0.3);
    padding: 50px;
    width: 100%;
    max-width: 400px;
}

.login-header {
    text-align: center;
    margin-bottom: 40px;
}

.login-header h1 {
    font-size: 28px;
    font-weight: 600;
    color: var(--primary-blue);
    margin-bottom: 10px;
}

.login-header p {
    font-size: 14px;
    color: var(--gray-600);
}

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

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-800);
    margin-bottom: 8px;
}

.form-control {
    width: 100%;
    height: 44px;
    padding: 0 16px;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    font-size: 14px;
    color: var(--gray-800);
    background-color: var(--white);
    transition: all 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
}

.btn-primary {
    background-color: var(--primary-blue);
    color: var(--white);
    width: 100%;
    border: 1px solid var(--border-blue);
}

.btn-primary:hover {
    background-color: var(--hover-blue);
    border-color: var(--hover-blue);
}

.btn-primary:disabled {
    background-color: var(--gray-300);
    cursor: not-allowed;
}

/* 后台主框架 */
.admin-container {
    display: flex;
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
}

/* 侧边栏 */
.sidebar {
    width: 240px;
    background-color: var(--primary-blue);
    color: var(--white);
    flex-shrink: 0;
    border-right: 1px solid var(--border-blue);
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow-y: auto;
    position: fixed;
    left: 0;
    top: 0;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
    position: sticky;
    top: 0;
    background-color: var(--primary-blue);
    z-index: 10;
}

.sidebar-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--white);
}

.sidebar-nav {
    padding: 0;
    overflow-y: visible;
    flex: 1;
}

/* 侧边栏滚动条样式 */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

.nav-item {
    padding: 12px 20px;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    display: flex;
    align-items: center;
    transition: all 0.3s;
    border-left: 3px solid transparent;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    white-space: nowrap;
}

.nav-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--white);
    border-left-color: var(--light-blue);
}

.nav-item.active {
    background-color: rgba(255, 255, 255, 0.15);
    color: var(--white);
    border-left-color: var(--white);
}

.nav-icon {
    margin-right: 10px;
}

/* 主内容区 */
.main-content {
    flex: 1;
    background-color: var(--gray-50);
    margin-left: 240px;
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* 顶部导航栏 */
.top-nav {
    background-color: var(--white);
    padding: 16px 24px;
    border-bottom: 2px solid var(--primary-blue);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.1);
    flex-shrink: 0;
}

.top-nav-left h1 {
    font-size: 20px;
    font-weight: 600;
    color: var(--gray-800);
}

.top-nav-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-name {
    font-size: 14px;
    color: var(--gray-600);
}

.logout-btn {
    color: var(--danger);
    text-decoration: none;
    font-size: 14px;
}

.logout-btn:hover {
    text-decoration: underline;
}

/* 内容区域 */
.content-area {
    padding: 24px;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

/* 主内容区滚动条样式 */
.main-content::-webkit-scrollbar {
    width: 8px;
}

.main-content::-webkit-scrollbar-track {
    background: var(--gray-100);
}

.main-content::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 4px;
}

.main-content::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

/* 卡片样式 */
.card {
    background: var(--white);
    border-radius: 8px;
    border: 1px solid var(--gray-200);
    box-shadow: 0 1px 3px rgba(59, 130, 246, 0.1);
    padding: 20px;
    margin-bottom: 20px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--gray-200);
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-800);
}

/* 表格样式 */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    background-color: var(--gray-50);
    padding: 12px 16px;
    text-align: left;
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-600);
    border-bottom: 1px solid var(--gray-200);
}

.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--gray-200);
    font-size: 14px;
    color: var(--gray-800);
}

.data-table tr:hover {
    background-color: var(--gray-50);
}

/* 状态标签 */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.status-pending {
    background-color: #fef3c7;
    color: #92400e;
}

.status-active {
    background-color: #d1fae5;
    color: #065f46;
}

.status-frozen {
    background-color: #fee2e2;
    color: #991b1b;
}

.status-expired {
    background-color: #f3f4f6;
    color: #6b7280;
}

/* 操作按钮组 */
.action-buttons {
    display: flex;
    gap: 8px;
}

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

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

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

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

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

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

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

.btn-secondary {
    background-color: var(--gray-600);
    color: var(--white);
}

.btn-secondary:hover {
    background-color: var(--gray-800);
}

/* 筛选栏 */
.filter-bar {
    background-color: var(--white);
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.filter-select {
    height: 36px;
    padding: 0 12px;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    background-color: var(--white);
    font-size: 14px;
    color: var(--gray-800);
    min-width: 120px;
}

.filter-input {
    height: 36px;
    padding: 0 12px;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    background-color: var(--white);
    font-size: 14px;
    color: var(--gray-800);
    min-width: 150px;
}

.filter-input:focus,
.filter-select:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* 详情模态框 */
.modal-overlay {
    display: none !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999 !important;
    align-items: center !important;
    justify-content: center !important;
}

.modal-overlay.active {
    display: flex !important;
}

.modal-content {
    background: var(--white);
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    margin: auto !important;
    flex-shrink: 0;
    position: relative;
    z-index: 10000;
}

.modal-lg {
    max-width: 800px;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-800);
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--gray-400);
    cursor: pointer;
}

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

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* 信息列表 */
.info-list {
    list-style: none;
}

.info-list li {
    padding: 8px 0;
    border-bottom: 1px solid var(--gray-100);
    display: flex;
}

.info-label {
    font-weight: 500;
    color: var(--gray-600);
    width: 120px;
    flex-shrink: 0;
}

.info-value {
    color: var(--gray-800);
    flex: 1;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -240px;
        z-index: 100;
        transition: left 0.3s;
    }

    .sidebar.active {
        left: 0;
    }

    .main-content {
        margin-left: 0;
    }

    .mobile-menu-btn {
        display: block;
    }
}

@media (min-width: 769px) {
    .mobile-menu-btn {
        display: none;
    }
}

/* 加载动画 */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--gray-600);
}

.spinner {
    border: 3px solid var(--gray-300);
    border-top: 3px solid var(--primary-blue);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

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

/* Toast 提示 */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 4px;
    background-color: var(--gray-800);
    color: var(--white);
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s;
}

.toast.show {
    opacity: 1;
}

.toast.success {
    background-color: var(--success);
}

.toast.error {
    background-color: var(--danger);
}

/* 文本辅助类 */
.text-muted {
    color: var(--gray-600);
    font-size: 12px;
}

/* 卡片统计信息 */
.card-stats {
    display: flex;
    gap: 16px;
    font-size: 14px;
    color: var(--gray-600);
}

/* 详情样式 */
.showcase-detail,
.activity-detail,
.supply-detail {
    padding: 10px;
}

/* 搜索输入框 */
.filter-input {
    height: 36px;
    padding: 0 12px;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    background-color: var(--white);
    font-size: 14px;
    color: var(--gray-800);
    min-width: 200px;
}

.filter-input:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* 图片上传和预览 */
.image-preview {
    position: relative;
}

.image-preview img {
    border: 1px solid var(--gray-300);
    border-radius: 4px;
}

.current-image {
    position: relative;
}

.current-image img {
    border: 1px solid var(--gray-300);
    border-radius: 4px;
}

input[type="file"].form-control {
    padding: 8px 16px;
    height: auto;
}

.text-muted {
    color: var(--gray-600);
    font-size: 12px;
}
