/* =============================================
   法律法规数据库 - 公共样式
   ============================================= */
:root {
  --primary: #1a56db;
  --primary-light: #e8edfb;
  --danger: #dc2626;
  --success: #16a34a;
  --warning: #d97706;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.1);
}

* { 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(--gray-800); background: var(--gray-50); line-height: 1.6; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* 状态标签 */
.tag { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.tag-active { background: #dcfce7; color: #166534; }
.tag-repealed { background: #fee2e2; color: #991b1b; }
.tag-revised { background: #ffedd5; color: #9a3412; }
.tag-partial { background: #fef9c3; color: #854d0e; }
.tag-pending { background: #f3f4f6; color: #4b5563; }

/* 按钮 */
.btn { display: inline-flex; align-items: center; gap: 4px; padding: 8px 16px; border: 1px solid var(--gray-300); border-radius: var(--radius); background: #fff; color: var(--gray-700); font-size: 14px; cursor: pointer; transition: all 0.15s; }
.btn:hover { background: var(--gray-100); border-color: var(--gray-400); }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: #1648b8; }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover { background: #b91c1c; }
.btn-sm { padding: 4px 10px; font-size: 12px; }

/* 表单 */
.form-group { margin-bottom: 16px; }
.form-label { display: block; margin-bottom: 4px; font-weight: 500; color: var(--gray-700); font-size: 13px; }
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 8px 12px; border: 1px solid var(--gray-300); border-radius: var(--radius);
  font-size: 14px; color: var(--gray-800); background: #fff; transition: border-color 0.15s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26,86,219,0.1); }
.form-textarea { resize: vertical; min-height: 100px; font-family: inherit; }

/* 表格 */
.table-wrap { overflow-x: auto; border: 1px solid var(--gray-200); border-radius: var(--radius); background: #fff; }
table { width: 100%; border-collapse: collapse; }
th { background: var(--gray-50); padding: 10px 12px; text-align: left; font-weight: 500; color: var(--gray-600); font-size: 13px; border-bottom: 2px solid var(--gray-200); white-space: nowrap; }
td { padding: 10px 12px; border-bottom: 1px solid var(--gray-100); }
tr:hover td { background: var(--gray-50); }

/* 分页 */
.pagination { display: flex; align-items: center; gap: 4px; margin-top: 16px; justify-content: center; }
.pagination button { padding: 6px 12px; border: 1px solid var(--gray-300); border-radius: 4px; background: #fff; cursor: pointer; font-size: 13px; }
.pagination button.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination button:disabled { opacity: 0.5; cursor: not-allowed; }

/* 消息提示 */
.toast { position: fixed; top: 20px; right: 20px; padding: 12px 20px; border-radius: var(--radius); color: #fff; font-size: 14px; z-index: 9999; animation: slideIn 0.3s ease; }
.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* 模态框 */
.modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.4); z-index: 1000; display: flex; align-items: center; justify-content: center; }
.modal { background: #fff; border-radius: 12px; width: 90%; max-width: 600px; max-height: 80vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,0.2); }
.modal-header { padding: 16px 20px; border-bottom: 1px solid var(--gray-200); display: flex; justify-content: space-between; align-items: center; }
.modal-header h3 { font-size: 16px; }
.modal-body { padding: 20px; }
.modal-footer { padding: 12px 20px; border-top: 1px solid var(--gray-200); display: flex; justify-content: flex-end; gap: 8px; }
.modal-close { background: none; border: none; font-size: 20px; cursor: pointer; color: var(--gray-400); }
.modal-close:hover { color: var(--gray-700); }

/* 空状态 */
.empty { text-align: center; padding: 40px; color: var(--gray-400); }

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