/* 全局样式 */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif; background: #f5f6fa; color: #1a1a2e; }

/* 登录页 */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.login-container { background: #fff; border-radius: 12px; padding: 40px; width: 400px; box-shadow: 0 20px 60px rgba(0,0,0,0.15); }
.login-container h1 { text-align: center; margin-bottom: 4px; font-size: 24px; }
.login-container .subtitle { text-align: center; color: #95a5a6; margin-bottom: 28px; font-size: 14px; }
.form-group { margin-bottom: 18px; }
.form-group label { display: block; margin-bottom: 6px; font-size: 14px; color: #555; }
.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group input[type="time"],
.form-group input[type="date"],
.form-group select,
.form-group textarea { width: 100%; padding: 10px 12px; border: 1px solid #ddd; border-radius: 6px; font-size: 14px; outline: none; transition: border 0.2s; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: #667eea; }
button { padding: 10px 20px; border: none; border-radius: 6px; font-size: 14px; cursor: pointer; transition: all 0.2s; }
button[type="submit"], .btn-primary { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: #fff; width: 100%; padding: 12px; font-size: 16px; }
button[type="submit"]:hover, .btn-primary:hover { opacity: 0.9; }
.btn { background: #f0f0f0; color: #333; }
.btn:hover { background: #e0e0e0; }
.error-msg { background: #ffeaea; color: #e74c3c; padding: 10px 14px; border-radius: 6px; margin-bottom: 16px; font-size: 14px; display: none; }

/* 弹窗 */
.modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 1000; display: flex; align-items: center; justify-content: center; }
.modal-content { background: #fff; border-radius: 12px; width: 90%; max-width: 600px; max-height: 90vh; overflow-y: auto; }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 24px; border-bottom: 1px solid #eee; font-size: 16px; font-weight: bold; }
.modal-close { font-size: 24px; cursor: pointer; color: #999; }
.modal-close:hover { color: #333; }
.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid #eee; display: flex; justify-content: flex-end; gap: 8px; }
.modal-footer .btn-primary { width: auto; }

/* 表格 */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { background: #f8f9fa; padding: 10px 12px; text-align: left; border-bottom: 2px solid #e9ecef; font-weight: 600; }
td { padding: 10px 12px; border-bottom: 1px solid #e9ecef; }
tr:hover td { background: #f8f9fa; }

/* Badge */
.badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 12px; }
.badge-admin { background: #e74c3c22; color: #e74c3c; }
.badge-editor { background: #3498db22; color: #3498db; }
.badge-viewer { background: #2ecc7122; color: #2ecc71; }
.badge-user { background: #95a5a622; color: #95a5a6; }
.status-ok { color: #2ecc71; font-weight: bold; }
.status-err { color: #e74c3c; font-weight: bold; }

/* Switch */
.switch { position: relative; display: inline-block; width: 44px; height: 24px; vertical-align: middle; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background: #ccc; transition: .3s; border-radius: 24px; }
.switch .slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px; background: #fff; transition: .3s; border-radius: 50%; }
.switch input:checked + .slider { background: #2ecc71; }
.switch input:checked + .slider:before { transform: translateX(20px); }

/* 操作按钮 */
.action-btn { background: none; border: none; cursor: pointer; font-size: 13px; padding: 4px 8px; border-radius: 4px; }
.action-btn.edit { color: #3498db; }
.action-btn.edit:hover { background: #3498db22; }
.action-btn.delete { color: #e74c3c; }
.action-btn.delete:hover { background: #e74c3c22; }
.action-btn.reset { color: #f39c12; }
.action-btn.reset:hover { background: #f39c122; }
.action-btn.toggle { color: #2ecc71; }
.action-btn.toggle:hover { background: #2ecc7122; }

/* 分页 */
.pager { display: flex; gap: 4px; align-items: center; justify-content: center; }
.pager button { padding: 6px 12px; border: 1px solid #ddd; background: #fff; cursor: pointer; border-radius: 4px; }
.pager button.active { background: #667eea; color: #fff; border-color: #667eea; }
.pager button:disabled { opacity: 0.5; cursor: not-allowed; }
