/**
 * 公共样式 - 所有页面共用
 * 包含：布局、侧边栏、弹窗、按钮、表单等基础样式
 */

/* 基础重置 */
* { 
    box-sizing: border-box; 
    -webkit-tap-highlight-color: transparent; 
}
body { 
    margin: 0; 
    padding: 0; 
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; 
}

/* 应用容器 */
.app-container { 
    display: flex; 
    height: 100vh; 
    width: 100%; 
}

/* 主内容区 */
.main-content { 
    flex: 1; 
    display: flex; 
    flex-direction: column; 
    overflow: hidden; 
    background: #f5f5f5; 
}
.page { 
    flex: 1; 
    display: flex; 
    flex-direction: column; 
    overflow: hidden; 
}

/* 固定头部 */
.fixed-header { 
    position: sticky; 
    top: 0; 
    z-index: 50; 
    background: #fff; 
}

/* 顶部栏 */
.top-bar { 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    padding: 14px 18px; 
    background: #fff; 
    border-bottom: 1px solid #eee; 
}
.top-bar-title { 
    font-size: 19px; 
    font-weight: 700; 
    color: #333; 
}
.top-bar-actions { 
    display: flex; 
    gap: 12px; 
    align-items: center; 
    position: relative; 
    z-index: 10; 
}

/* 搜索栏 */
.search-bar { 
    margin: 12px 18px !important; 
    background: #fff; 
    border-radius: 12px; 
    padding: 10px 16px; 
    display: flex; 
    align-items: center; 
    gap: 10px; 
    border: 1px solid #eee; 
}
.search-bar input { 
    flex: 1; 
    border: none; 
    outline: none; 
    font-size: 15px; 
    background: transparent; 
    min-width: 0; 
}

/* 按钮样式 */
.btn { 
    padding: 14px 22px; 
    font-size: 15px; 
    border-radius: 12px; 
    font-weight: 600; 
    cursor: pointer; 
    border: none;
    transition: all 0.2s;
}
.btn:hover { 
    opacity: 0.9; 
}
.btn:active { 
    transform: scale(0.98); 
}
.btn-primary { 
    background: linear-gradient(135deg, #4a5568, #2d3748); 
    color: #fff; 
}
.btn-secondary { 
    background: #f5f5f5; 
    color: #666; 
}
.btn-success { 
    background: linear-gradient(135deg, #10b981, #059669); 
    color: #fff; 
}
.btn-danger { 
    background: #fee; 
    color: #c00; 
}
.btn-sm { 
    padding: 8px 12px; 
    font-size: 12px; 
    border-radius: 8px; 
}
.btn-full { 
    width: 100%; 
}

/* 弹窗样式 */
.modal-overlay { 
    position: fixed; 
    top: 0; 
    left: 0; 
    right: 0; 
    bottom: 0; 
    background: rgba(0,0,0,0.5); 
    z-index: 1000; 
    display: none; 
    align-items: center; 
    justify-content: center; 
}
.modal-overlay.show { 
    display: flex !important; 
}
.modal-content { 
    background: #fff; 
    border-radius: 18px; 
    padding: 24px; 
    width: 90%; 
    max-width: 420px; 
    max-height: 85vh; 
    overflow-y: auto; 
    box-shadow: 0 12px 48px rgba(0,0,0,0.3); 
}
.modal-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 18px; 
}
.modal-header h2 { 
    font-size: 20px; 
    font-weight: 600; 
    margin: 0; 
}
.modal-close { 
    width: 40px; 
    height: 40px; 
    border-radius: 50%; 
    background: #f5f5f5; 
    border: none; 
    font-size: 20px; 
    cursor: pointer; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
}
.modal-close:active { 
    background: #eee; 
}

/* Toast 提示 */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.toast {
    padding: 14px 20px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    animation: toastIn 0.3s ease;
}
.toast.success { background: #d1fae5; color: #065f46; }
.toast.error { background: #fee2e2; color: #991b1b; }
.toast.info { background: #dbeafe; color: #1e40af; }
@keyframes toastIn {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* 空状态 */
.empty-state { 
    text-align: center; 
    padding: 60px 20px; 
    color: #999; 
}
.empty-icon { 
    font-size: 48px; 
    margin-bottom: 12px; 
    opacity: 0.5; 
}
.empty-title { 
    font-size: 16px; 
    font-weight: 600; 
    color: #666; 
    margin-bottom: 6px; 
}
.empty-desc { 
    font-size: 13px; 
}

/* 表单样式 */
.form-group { margin-bottom: 16px; }
.form-label { 
    display: block; 
    font-size: 13px; 
    font-weight: 600; 
    color: #374151; 
    margin-bottom: 6px; 
}
.form-input { 
    width: 100%; 
    padding: 12px 14px; 
    border: 2px solid #e5e7eb; 
    border-radius: 10px; 
    font-size: 14px; 
    transition: all 0.2s; 
    background: #f9fafb; 
}
.form-input:focus { 
    border-color: #4a5568; 
    background: #fff; 
    box-shadow: 0 0 0 4px rgba(74,85,104,0.1); 
    outline: none; 
}
.form-textarea { 
    min-height: 80px; 
    resize: vertical; 
}
.form-select {
    cursor: pointer;
}

/* 表单状态 */
.form-input.error {
    border-color: #f43f5e;
    background: #fff5f7;
    box-shadow: 0 0 0 4px rgba(244,63,94,0.1);
}
.form-input.success {
    border-color: #10b981;
    background: #ecfdf5;
    box-shadow: 0 0 0 4px rgba(16,185,129,0.1);
}
.form-input:disabled {
    opacity: 0.55;
    background: #f3f4f6;
    cursor: not-allowed;
    border-color: #d1d5db;
}
.form-input:disabled:hover {
    opacity: 0.55;
}
.form-hint {
    display: block;
    font-size: 12px;
    color: #6b7280;
    margin-top: 4px;
}
.form-error-text {
    display: block;
    font-size: 12px;
    color: #f43f5e;
    margin-top: 4px;
    font-weight: 500;
}
.form-success-text {
    display: block;
    font-size: 12px;
    color: #059669;
    margin-top: 4px;
    font-weight: 500;
}

/* 卡片容器 - 隐藏滚动条 */
.card-container { 
    flex: 1; 
    overflow-y: auto; 
    padding: 0 6px 18px; 
    -webkit-overflow-scrolling: touch; 
    scrollbar-width: none; 
    -ms-overflow-style: none; 
}
.card-container::-webkit-scrollbar { 
    display: none; 
}

/* 统计面板 */
.stats-panel {
    display: flex;
    gap: 12px;
    padding: 16px 18px;
    background: #fff;
    border-bottom: 1px solid #eee;
    overflow-x: auto;
}
.stat-card {
    flex: 1;
    min-width: 80px;
    text-align: center;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 12px;
}
.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #333;
}
.stat-label {
    font-size: 12px;
    color: #888;
    margin-top: 4px;
}

/* Tab栏 */
.tab-bar {
    display: flex;
    background: #fff;
    border-bottom: 1px solid #eee;
}
.tab-item {
    flex: 1;
    padding: 14px;
    text-align: center;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    color: #888;
    transition: all 0.2s;
}
.tab-item.active {
    color: #4a5568;
    font-weight: 600;
}
.tab-icon {
    font-size: 18px;
    display: block;
    margin-bottom: 2px;
}
