/**
 * 党建服务系统 - 现代大气风格
 */
:root {
    --primary: #C62828;
    --primary-light: #EF5350;
    --primary-dark: #B71C1C;
    --primary-bg: #FFEBEE;
    --gold: #FFD54F;
    --text-dark: #212121;
    --text-main: #424242;
    --text-secondary: #757575;
    --text-light: #9E9E9E;
    --border: #E0E0E0;
    --bg-body: #F5F5F5;
    --bg-white: #FFFFFF;
    --success: #4CAF50;
    --warning: #FF9800;
    --danger: #F44336;
    --info: #2196F3;
    --radius: 8px;
    --radius-lg: 12px;
    --shadow: 0 2px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.15);
    --transition: all 0.3s ease;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: 14px; color: var(--text-main); background: var(--bg-body); line-height: 1.6;
}
a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-dark); }
ul, ol { list-style: none; }

/* 登录页 */
.login-page {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #B71C1C 0%, #C62828 50%, #D32F2F 100%);
    position: relative; overflow: hidden;
}
.login-page::before {
    content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    animation: bgMove 30s linear infinite;
}
@keyframes bgMove { 0% { transform: translate(0,0); } 100% { transform: translate(30px,30px); } }
.login-container { position: relative; z-index: 1; width: 100%; max-width: 420px; padding: 20px; }
.login-card { background: var(--bg-white); border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,0.3); overflow: hidden; }
.login-header {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    padding: 40px 30px; text-align: center; position: relative;
}
.login-header::after {
    content: ''; position: absolute; bottom: -20px; left: 50%; transform: translateX(-50%);
    width: 40px; height: 40px; background: var(--bg-white); border-radius: 50%;
}
.login-logo {
    width: 100px; height: 100px; 
    background: transparent;
    border-radius: 50%;
    margin: 0 auto 20px; 
    display: flex; align-items: center; justify-content: center;
    font-size: 40px; color: var(--gold);
    position: relative;
}
.login-header h1 { color: #fff; font-size: 28px; font-weight: 700; letter-spacing: 3px; margin-bottom: 8px; }
.login-header p { color: rgba(255,255,255,0.8); font-size: 13px; }
.login-body { padding: 50px 40px 40px; }
.login-body h2 { text-align: center; font-size: 20px; color: var(--text-dark); margin-bottom: 30px; font-weight: 600; }

.input-group { position: relative; margin-bottom: 24px; }
.input-group .icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--text-light); font-size: 18px; }
.input-group input {
    width: 100%; height: 50px; padding: 0 16px 0 48px; border: 2px solid var(--border);
    border-radius: var(--radius); font-size: 15px; transition: var(--transition); background: var(--bg-body);
}
.input-group input:focus { outline: none; border-color: var(--primary); background: var(--bg-white); box-shadow: 0 0 0 4px rgba(198,40,40,0.1); }
.input-group input:hover { border-color: var(--primary-light); }

/* 按钮 */
.btn {
    display: inline-flex; align-items: center; justify-content: center; padding: 12px 24px;
    font-size: 14px; font-weight: 600; border: none; border-radius: var(--radius);
    cursor: pointer; transition: var(--transition); gap: 8px;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%); color: #fff; box-shadow: 0 4px 15px rgba(198,40,40,0.35); }
.btn-primary:hover { box-shadow: 0 8px 25px rgba(198,40,40,0.5); }
.btn-block { width: 100%; height: 50px; font-size: 16px; letter-spacing: 2px; }
.btn-success { background: linear-gradient(135deg, var(--success) 0%, #66BB6A 100%); color: #fff; box-shadow: 0 4px 12px rgba(76,175,80,0.3); }
.btn-success:hover { box-shadow: 0 6px 20px rgba(76,175,80,0.45); }
.btn-default { background: var(--bg-body); color: var(--text-main); border: 1px solid var(--border); }
.btn-default:hover { background: var(--border); transform: translateY(-1px); }
.btn-sm { padding: 10px 20px; font-size: 13px; }
.btn-danger { background: linear-gradient(135deg, var(--danger) 0%, #E57373 100%); color: #fff; }
.login-footer { text-align: center; padding: 20px; color: rgba(255,255,255,0.7); font-size: 12px; }
.error-msg { background: #FFEBEE; color: var(--danger); padding: 12px 16px; border-radius: var(--radius); margin-bottom: 20px; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.error-msg::before { content: '⚠'; font-size: 16px; }

/* 顶部导航 */
.top-header {
    height: 60px; background: linear-gradient(90deg, var(--primary-dark) 0%, var(--primary) 100%);
    display: flex; align-items: center; justify-content: space-between; padding: 0 24px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}
.top-logo { display: flex; align-items: center; gap: 12px; }
.top-logo .icon {
    width: 44px; height: 44px; 
    background: transparent;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center; 
    font-size: 22px; color: var(--gold);
}
.top-logo h1 { color: #fff; font-size: 20px; font-weight: 700; letter-spacing: 2px; }
.top-user { display: flex; align-items: center; gap: 20px; color: rgba(255,255,255,0.9); font-size: 14px; }
.top-user .avatar { width: 36px; height: 36px; background: rgba(255,255,255,0.2); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 16px; }
.top-user a { color: rgba(255,255,255,0.85); padding: 8px 16px; background: rgba(255,255,255,0.1); border-radius: 20px; font-size: 13px; transition: var(--transition); }
.top-user a:hover { background: rgba(255,255,255,0.25); color: #fff; transform: scale(1.05); }

/* 左侧菜单 */
.sidebar { width: 240px; background: #fff; height: 100%; overflow-y: auto; border-right: 1px solid var(--border); }
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.menu-section { padding: 16px 12px; }
.menu-section-title { font-size: 11px; color: var(--text-light); text-transform: uppercase; letter-spacing: 1px; padding: 8px 16px; margin-bottom: 4px; font-weight: 600; }
.menu-item { margin-bottom: 2px; }
.menu-link {
    display: flex; align-items: center; padding: 14px 16px; color: var(--text-main);
    border-radius: var(--radius); transition: var(--transition); cursor: pointer; font-size: 14px; font-weight: 500;
}
.menu-link:hover { background: var(--primary-bg); color: var(--primary); transform: translateX(4px); }
.menu-link .icon { width: 24px; margin-right: 12px; font-size: 18px; text-align: center; }
.menu-link .arrow { margin-left: auto; font-size: 10px; transition: var(--transition); color: var(--text-light); }
.menu-item.active > .menu-link, .menu-item.open > .menu-link {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: #fff; box-shadow: 0 4px 12px rgba(198,40,40,0.3);
}
.menu-item.open > .menu-link .arrow { transform: rotate(90deg); color: #fff; }
.sub-menu { display: none; padding: 4px 0 8px 32px; }
.menu-item.open .sub-menu { display: block; }
.sub-menu a {
    display: block; padding: 12px 16px; color: var(--text-secondary); font-size: 13px;
    border-radius: var(--radius); margin: 2px 8px; transition: var(--transition); position: relative;
}
.sub-menu a::before { content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 6px; height: 6px; background: var(--border); border-radius: 50%; transition: var(--transition); }
.sub-menu a:hover, .sub-menu a.active { color: var(--primary); background: var(--primary-bg); transform: translateX(4px); }
.sub-menu a:hover::before, .sub-menu a.active::before { background: var(--primary); transform: translateY(-50%) scale(1.3); }

/* 页面内容 */
.page-wrapper { padding: 24px; min-height: calc(100vh - 60px); background: var(--bg-body); }
.page-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.page-title h2 { font-size: 24px; font-weight: 700; color: var(--text-dark); display: flex; align-items: center; gap: 12px; }
.page-title h2::before { content: ''; width: 5px; height: 28px; background: linear-gradient(180deg, var(--primary) 0%, var(--primary-light) 100%); border-radius: 3px; }
.breadcrumb { font-size: 13px; color: var(--text-secondary); }
.breadcrumb a { color: var(--primary); font-weight: 500; }
.breadcrumb a:hover { text-decoration: underline; }

/* 卡片 */
.card { background: var(--bg-white); border-radius: var(--radius-lg); box-shadow: var(--shadow); overflow: hidden; margin-bottom: 24px; transition: var(--transition); }
.card:hover { box-shadow: var(--shadow-lg); }
.card-header {
    padding: 20px 24px; border-bottom: 1px solid var(--border); display: flex;
    align-items: center; justify-content: space-between; background: linear-gradient(180deg, #FAFAFA 0%, #fff 100%);
}
.card-header h3 { font-size: 17px; font-weight: 700; color: var(--text-dark); display: flex; align-items: center; gap: 8px; }
.card-header h3::before { content: ''; width: 4px; height: 18px; background: var(--primary); border-radius: 2px; }
.card-body { padding: 24px; }
.card-body.no-padding { padding: 0; }

/* 统计卡片 */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; margin-bottom: 24px; }
.stat-card {
    background: var(--bg-white); border-radius: var(--radius-lg); padding: 24px;
    box-shadow: var(--shadow); position: relative; overflow: hidden; transition: var(--transition); cursor: pointer;
}
.stat-card:hover { transform: translateY(-6px) scale(1.02); box-shadow: var(--shadow-lg); }
.stat-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%); }
.stat-card.blue::before { background: linear-gradient(90deg, #1976D2 0%, #42A5F5 100%); }
.stat-card.green::before { background: linear-gradient(90deg, #388E3C 0%, #66BB6A 100%); }
.stat-card.orange::before { background: linear-gradient(90deg, #F57C00 0%, #FFB74D 100%); }
.stat-icon { width: 60px; height: 60px; border-radius: var(--radius); display: flex; align-items: center; justify-content: center; font-size: 32px; margin-bottom: 16px; background: var(--primary-bg); color: var(--primary); }
.stat-card.blue .stat-icon { background: #E3F2FD; color: #1976D2; }
.stat-card.green .stat-icon { background: #E8F5E9; color: #388E3C; }
.stat-card.orange .stat-icon { background: #FFF3E0; color: #F57C00; }
.stat-number { font-size: 42px; font-weight: 800; color: var(--text-dark); line-height: 1; margin-bottom: 8px; }
.stat-label { font-size: 15px; color: var(--text-secondary); font-weight: 500; }

/* 表格 */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 16px 20px; text-align: left; border-bottom: 1px solid var(--border); }
.table th { background: #FAFAFA; font-weight: 700; color: var(--text-dark); font-size: 13px; text-transform: uppercase; letter-spacing: 0.5px; }
.table tbody tr { transition: var(--transition); }
.table tbody tr:hover { background: linear-gradient(90deg, var(--primary-bg) 0%, #fff 100%); transform: scale(1.005); }
.table tbody tr:last-child td { border-bottom: none; }
.table .title-cell { font-size: 15px; font-weight: 600; color: var(--text-dark); }
.table .actions { display: flex; gap: 12px; }
.table .actions a { color: var(--primary); font-weight: 600; font-size: 13px; padding: 6px 12px; border-radius: 4px; transition: var(--transition); }
.table .actions a:hover { background: var(--primary-bg); transform: scale(1.1); }
.table .actions a.delete { color: var(--danger); }
.table .actions a.delete:hover { background: #FFEBEE; }
.empty-data { text-align: center; padding: 60px 20px; color: var(--text-light); }
.empty-data .icon { font-size: 56px; margin-bottom: 16px; opacity: 0.5; }
.empty-data p { font-size: 16px; }

/* 状态标签 */
.badge { display: inline-flex; align-items: center; padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 700; gap: 6px; }
.badge::before { content: ''; width: 8px; height: 8px; border-radius: 50%; }
.badge-success { background: #E8F5E9; color: #2E7D32; }
.badge-success::before { background: #4CAF50; }
.badge-warning { background: #FFF3E0; color: #E65100; }
.badge-warning::before { background: #FF9800; }
.badge-danger { background: #FFEBEE; color: #C62828; }
.badge-danger::before { background: #F44336; }
.badge-info { background: #E3F2FD; color: #1565C0; }
.badge-info::before { background: #2196F3; }

/* 表单 */
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 8px; color: var(--text-dark); font-size: 14px; font-weight: 600; }
.form-group label .required { color: var(--danger); margin-left: 4px; font-size: 16px; }
.form-control {
    width: 100%; height: 46px; padding: 0 16px; border: 2px solid var(--border);
    border-radius: var(--radius); font-size: 14px; color: var(--text-main);
    background: var(--bg-white); transition: var(--transition);
}
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(198,40,40,0.1); }
.form-control:hover { border-color: var(--primary-light); }
textarea.form-control { height: auto; min-height: 120px; padding: 14px 16px; resize: vertical; line-height: 1.6; }
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23757575' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 16px center; padding-right: 40px; }
.form-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.form-actions { display: flex; gap: 12px; margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--border); }

/* 搜索栏 */
.toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.search-form { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.search-form .form-control { width: 200px; height: 42px; }
.search-form select.form-control { width: 150px; }

/* 分页 */
.pagination { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 24px; padding: 20px 0; }
.pagination a, .pagination span {
    display: inline-flex; align-items: center; justify-content: center; min-width: 40px; height: 40px;
    padding: 0 14px; border: 2px solid var(--border); border-radius: var(--radius);
    color: var(--text-secondary); font-size: 14px; font-weight: 600; transition: var(--transition);
}
.pagination a:hover { background: var(--primary-bg); border-color: var(--primary); color: var(--primary); transform: translateY(-2px); }
.pagination .active { background: var(--primary); border-color: var(--primary); color: #fff; }
.pagination .disabled { opacity: 0.5; cursor: not-allowed; }
.pagination .page-info { padding: 0 16px; color: var(--text-secondary); font-weight: 500; }
.pagination .total { margin-left: 16px; color: var(--text-light); font-size: 13px; }

/* 提示消息 */
.alert { padding: 16px 20px; border-radius: var(--radius); margin-bottom: 24px; display: flex; align-items: center; gap: 12px; font-size: 14px; font-weight: 500; animation: slideIn 0.3s ease; }
@keyframes slideIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
.alert-success { background: #E8F5E9; color: #2E7D32; border: 1px solid #A5D6A7; }
.alert-success::before { content: '✓'; font-weight: bold; font-size: 16px; }
.alert-danger { background: #FFEBEE; color: #C62828; border: 1px solid #EF9A9A; }
.alert-danger::before { content: '✕'; font-weight: bold; font-size: 16px; }
.alert-warning { background: #FFF3E0; color: #E65100; border: 1px solid #FFCC80; }
.alert-info { background: #E3F2FD; color: #1565C0; border: 1px solid #90CAF9; }

/* 快捷面板 */
.quick-panel { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.data-list { padding: 0; }
.data-list-item { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); transition: var(--transition); cursor: pointer; }
.data-list-item:last-child { border-bottom: none; }
.data-list-item:hover { background: linear-gradient(90deg, var(--primary-bg) 0%, #fff 100%); padding-left: 24px; }
.data-list-item .title { font-size: 14px; color: var(--text-main); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-right: 16px; font-weight: 500; }
.data-list-item .date { font-size: 12px; color: var(--text-light); white-space: nowrap; font-weight: 500; }

/* 弹窗 */
.modal-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5);
    display: none; align-items: center; justify-content: center; z-index: 1000;
    backdrop-filter: blur(4px); animation: fadeIn 0.2s ease;
}
.modal-overlay.show { display: flex; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
    background: var(--bg-white); border-radius: var(--radius-lg); width: 90%; max-width: 600px;
    max-height: 90vh; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: slideUp 0.3s ease;
}
@keyframes slideUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
.modal-header {
    padding: 20px 24px; border-bottom: 1px solid var(--border); display: flex;
    align-items: center; justify-content: space-between;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
}
.modal-header h3 { font-size: 18px; font-weight: 700; color: #fff; }
.modal-close {
    width: 36px; height: 36px; border: none; background: rgba(255,255,255,0.2);
    border-radius: 50%; cursor: pointer; font-size: 20px; color: #fff;
    display: flex; align-items: center; justify-content: center; transition: var(--transition);
}
.modal-close:hover { background: rgba(255,255,255,0.3); transform: rotate(90deg); }
.modal-body { padding: 24px; max-height: calc(90vh - 140px); overflow-y: auto; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 12px; background: #FAFAFA; }

/* 响应式 */
@media (max-width: 1200px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 768px) {
    .stats-grid { grid-template-columns: 1fr; }
    .quick-panel { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .toolbar { flex-direction: column; align-items: stretch; }
    .modal { width: 95%; max-width: none; }
}

/* 工具类 */
.text-center { text-align: center; }
.text-primary { color: var(--primary); font-weight: 600; }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); font-weight: 600; }
.text-bold { font-weight: 700; }
.text-large { font-size: 16px; }
.mb-24 { margin-bottom: 24px; }


/* 文件上传组件 */
.file-upload { display: flex; align-items: center; gap: 12px; }
.file-upload-btn { display: inline-flex; align-items: center; gap: 6px; padding: 10px 16px; background: var(--bg-body); border: 2px dashed var(--border); border-radius: var(--radius); cursor: pointer; transition: var(--transition); font-size: 14px; color: var(--text-secondary); }
.file-upload-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-bg); }
.file-item { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; background: #E8F5E9; border-radius: var(--radius); font-size: 13px; color: #2E7D32; }
.file-item .file-icon { font-size: 16px; }
.file-item .file-name { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-download { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; background: var(--primary-bg); color: var(--primary); border-radius: var(--radius); font-size: 13px; font-weight: 600; transition: var(--transition); }
.file-download:hover { background: var(--primary); color: #fff; }
