/* ==================== 全局 Reset ==================== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: #f0f2f5;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ==================== 登录界面 ==================== */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-card {
  background: #fff;
  border-radius: 20px;
  padding: 40px 36px;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  animation: slideUp 0.4s ease;
}

@keyframes slideUp {
  from { transform: translateY(30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.login-card h1 {
  text-align: center;
  font-size: 1.6rem;
  color: #333;
  margin-bottom: 4px;
}

.login-card .subtitle {
  text-align: center;
  font-size: 0.85rem;
  color: #999;
  margin-bottom: 32px;
}

.login-screen .form-group {
  margin-bottom: 18px;
}

.login-screen .form-group label {
  display: block;
  font-size: 0.85rem;
  color: #555;
  margin-bottom: 6px;
  font-weight: 500;
}

.login-screen .form-group input {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid #e0e0e0;
  border-radius: 12px;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.login-screen .form-group input:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.error-msg {
  color: #e74c3c;
  font-size: 0.82rem;
  text-align: center;
  margin-bottom: 12px;
  min-height: 20px;
}

.login-btn {
  width: 100%;
  padding: 13px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 8px;
}

.login-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.login-btn:active { transform: translateY(0); }
.login-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; box-shadow: none; }

/* ==================== App 壳 ==================== */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ---- 侧边栏 ---- */
.sidebar {
  width: 240px;
  background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: transform 0.3s ease;
}

.sidebar-logo {
  padding: 24px 20px;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-nav {
  flex: 1;
  padding: 12px 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  font-size: 0.92rem;
  transition: all 0.15s;
  border-left: 3px solid transparent;
}

.nav-item:hover {
  color: #fff;
  background: rgba(255,255,255,0.06);
}

.nav-item.active {
  color: #fff;
  background: rgba(102,126,234,0.25);
  border-left-color: #667eea;
}

.nav-icon { font-size: 1.1rem; width: 24px; text-align: center; }

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.logout-btn {
  width: 100%;
  padding: 10px;
  background: rgba(231,76,60,0.15);
  color: rgba(255,255,255,0.7);
  border: none;
  border-radius: 8px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

.logout-btn:hover {
  background: rgba(231,76,60,0.35);
  color: #fff;
}

/* ---- 主区域 ---- */
.main-area {
  flex: 1;
  margin-left: 240px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left 0.3s ease;
}

.topbar {
  background: #fff;
  padding: 16px 28px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 16px;
}

.user-info {
  font-size: 0.9rem;
  color: #555;
  white-space: nowrap;
}

.logout-btn-top {
  padding: 6px 16px;
  background: #f5f5f5;
  color: #666;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-size: 0.85rem;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.logout-btn-top:hover {
  background: #e8e8e8;
  color: #333;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  padding: 4px 8px;
  color: #555;
}

.page-title {
  font-size: 1.15rem;
  color: #333;
  font-weight: 600;
}

.page-content {
  flex: 1;
  padding: 24px 28px;
  animation: pageIn 0.25s ease;
}

@keyframes pageIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==================== 通用组件样式 ==================== */

/* ---- 工具栏 ---- */
.toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.search-input {
  flex: 1;
  min-width: 180px;
  padding: 11px 16px;
  border: 1.5px solid #e0e0e0;
  border-radius: 10px;
  font-size: 0.92rem;
  outline: none;
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102,126,234,0.1);
}

/* ---- autocomplete 下拉 ---- */
.ac-wrapper { position: relative; }
.ac-wrapper .search-input { width: 100%; box-sizing: border-box; }
.ac-dropdown {
  position: absolute; top: 100%; left: 0; right: 0;
  background: #fff; border: 1px solid #e0e0e0; border-top: none;
  border-radius: 0 0 8px 8px; max-height: 180px; overflow-y: auto;
  z-index: 1050; display: none; box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.ac-dropdown.show { display: block; }
.ac-item {
  padding: 7px 12px; cursor: pointer; font-size: 0.85rem;
  transition: background 0.15s;
}
.ac-item:hover, .ac-item.active { background: #f0f0ff; color: #667eea; }
.ac-no-match { padding: 8px 12px; color: #999; font-size: 0.82rem; }

.search-select {
  min-width: 150px;
  padding: 11px 16px;
  border: 1.5px solid #e0e0e0;
  border-radius: 10px;
  font-size: 0.92rem;
  outline: none;
  background: #fff;
  color: #333;
  cursor: pointer;
  transition: border-color 0.2s;
}

.search-select:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102,126,234,0.1);
}

.search-date {
  min-width: 140px;
  max-width: 150px;
  flex: 0 0 auto;
}

.date-sep {
  font-size: 0.85rem;
  color: #999;
  white-space: nowrap;
  user-select: none;
}

.btn-primary {
  padding: 11px 20px;
  background: #667eea;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.btn-primary:hover { background: #5a6fd6; transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }

.btn-search {
  padding: 11px 20px;
  background: #667eea;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.btn-search:hover { background: #5a6fd6; transform: translateY(-1px); }
.btn-search:active { transform: translateY(0); }

.btn-reset {
  padding: 11px 20px;
  background: #fff;
  color: #666;
  border: 1.5px solid #e0e0e0;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.btn-reset:hover { border-color: #999; color: #333; background: #f5f5f5; }

.btn-export {
  padding: 11px 20px;
  background: #fff;
  color: #333;
  border: 1.5px solid #e0e0e0;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.btn-export:hover { border-color: #27ae60; color: #27ae60; background: #f0faf4; }
.btn-export:disabled { opacity: 0.5; cursor: not-allowed; }

.filter-select {
  padding: 11px 14px;
  border: 1.5px solid #e0e0e0;
  border-radius: 10px;
  font-size: 0.9rem;
  outline: none;
  background: #fff;
  cursor: pointer;
  min-width: 100px;
  transition: border-color 0.2s;
}

.filter-select:focus { border-color: #667eea; }

/* ---- 统计栏 ---- */
.stats {
  display: flex;
  justify-content: space-between;
  color: #888;
  font-size: 0.82rem;
  margin-bottom: 14px;
  padding: 0 4px;
}

/* ---- 卡片列表 ---- */
.card-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.card {
  background: #fff;
  border-radius: 12px;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  transition: all 0.2s;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.1); }

.card-body { flex: 1; min-width: 0; }

.card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.card-title {
  font-size: 0.95rem;
  color: #333;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-id {
  font-size: 0.72rem;
  color: #bbb;
  flex-shrink: 0;
}

.card-info {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.8rem;
  color: #777;
  margin-bottom: 4px;
}

.card-time {
  font-size: 0.72rem;
  color: #bbb;
}

.card-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  margin-left: 16px;
}

.btn-edit, .btn-delete {
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 0.78rem;
  transition: all 0.2s;
}

.btn-edit { color: #667eea; }
.btn-edit:hover { background: #f0f0ff; }
.btn-delete { color: #e74c3c; }
.btn-delete:hover { background: #fff0f0; }
.btn-edit.disabled, .btn-delete.disabled { color: #ccc !important; cursor: not-allowed !important; background: none !important; }

/* ---- 数据表格 ---- */
.table-wrapper {
  background: #fff;
  border-radius: 12px;
  overflow-x: auto;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.data-table thead {
  background: #f8f9fb;
}

.data-table th {
  padding: 13px 16px;
  text-align: left;
  color: #666;
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 2px solid #eef0f5;
  white-space: nowrap;
}

.data-table td {
  padding: 14px 16px;
  color: #333;
  border-bottom: 1px solid #f0f2f5;
  vertical-align: middle;
}

.data-table tbody tr {
  transition: background 0.15s;
}

.data-table tbody tr:hover {
  background: #fafbfd;
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.cell-name {
  font-weight: 500;
  color: #222;
}

.cell-actions {
  white-space: nowrap;
}

/* ---- 分页 ---- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 4px 4px;
  gap: 12px;
  flex-wrap: wrap;
}

.page-size-box {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: #888;
  white-space: nowrap;
}

.page-size-select {
  padding: 6px 10px;
  border: 1.5px solid #e0e0e0;
  border-radius: 8px;
  font-size: 0.82rem;
  background: #fff;
  color: #333;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s;
}

.page-size-select:focus { border-color: #667eea; }

.page-btns {
  display: flex;
  align-items: center;
  gap: 4px;
}

.page-btn {
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  border: 1.5px solid #e0e0e0;
  border-radius: 8px;
  background: #fff;
  color: #555;
  font-size: 0.84rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.page-btn:hover:not(:disabled):not(.active) {
  border-color: #667eea;
  color: #667eea;
}

.page-btn.active {
  background: #667eea;
  color: #fff;
  border-color: #667eea;
  font-weight: 600;
}

.page-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.page-dots {
  width: 34px;
  text-align: center;
  color: #bbb;
  font-size: 0.84rem;
}

/* ---- Badges ---- */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.68rem;
  font-weight: 600;
  flex-shrink: 0;
}

.badge-confirm, .badge-success { background: #e8f5e9; color: #2e7d32; }
.badge-draft, .badge-pending { background: #fff3e0; color: #e65100; }
.badge-archive { background: #e3f2fd; color: #1565c0; }
.badge-active { background: #e8f5e9; color: #2e7d32; }

/* ---- Loading / Error / Empty ---- */
.loading {
  text-align: center;
  color: #999;
  padding: 40px;
  font-size: 0.9rem;
}

.error {
  text-align: center;
  background: #fff0f0;
  color: #e74c3c;
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 16px;
  font-size: 0.85rem;
}

.empty {
  text-align: center;
  color: #bbb;
  padding: 60px 20px;
  font-size: 0.95rem;
}

/* ==================== 待办事项专用 ==================== */
.add-form {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.add-form input {
  flex: 1;
  padding: 11px 16px;
  border: 1.5px solid #e0e0e0;
  border-radius: 10px;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}

.add-form input:focus { border-color: #667eea; }

.todo-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.todo-item {
  background: #fff;
  border-radius: 12px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  transition: all 0.2s;
  animation: slideIn 0.3s ease;
}

.todo-item:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.1); }

.todo-item.completed .todo-title {
  text-decoration: line-through;
  color: #bbb;
}

.todo-checkbox {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #ddd;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.todo-item.completed .todo-checkbox {
  background: #667eea;
  border-color: #667eea;
}

.todo-item.completed .todo-checkbox::after {
  content: "✓";
  color: #fff;
  font-size: 12px;
  font-weight: bold;
}

.todo-title { flex: 1; font-size: 0.93rem; color: #333; word-break: break-word; }

.todo-actions { display: flex; gap: 4px; flex-shrink: 0; }

/* 编辑模式 */
.todo-item.editing .todo-title { display: none; }
.todo-item.editing .todo-actions { display: none; }
.todo-item .edit-input { display: none; }
.todo-item .edit-btns { display: none; }
.todo-item.editing .edit-input { display: block; flex: 1; padding: 6px 10px; border: 2px solid #667eea; border-radius: 6px; font-size: 0.93rem; outline: none; }
.todo-item.editing .edit-btns { display: flex; gap: 6px; }

.btn-save { color: #27ae60; background: none; border: none; cursor: pointer; padding: 4px 8px; border-radius: 6px; font-size: 0.78rem; }
.btn-save:hover { background: #f0fff4; }
.btn-cancel { color: #95a5a6; background: none; border: none; cursor: pointer; padding: 4px 8px; border-radius: 6px; font-size: 0.78rem; }
.btn-cancel:hover { background: #f5f5f5; }

/* ==================== 弹窗 ==================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: #fff;
  border-radius: 16px;
  padding: 28px 30px;
  width: 90%;
  max-width: 480px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  animation: slideUp 0.3s ease;
}

.modal h2 {
  font-size: 1.1rem;
  color: #333;
  margin-bottom: 20px;
}

.modal .form-group {
  margin-bottom: 14px;
}

.modal .form-group label {
  display: block;
  font-size: 0.82rem;
  color: #666;
  margin-bottom: 5px;
}

.modal .form-group .required { color: #e74c3c; }

.modal .form-group input,
.modal .form-group select {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid #e0e0e0;
  border-radius: 8px;
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.2s;
  background: #fff;
}

.modal .form-group input:focus,
.modal .form-group select:focus {
  border-color: #667eea;
}

.form-row {
  display: flex;
  gap: 12px;
}

.form-row .form-group { flex: 1; min-width: 0; }

.modal-btns {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.modal-btns .btn-cancel {
  padding: 10px 20px;
  background: #f0f0f0;
  border: none;
  border-radius: 8px;
  color: #666;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.2s;
}

.modal-btns .btn-cancel:hover { background: #e0e0e0; }

/* ==================== 编号生成面板 ==================== */
.generate-panel {
  background: #fff;
  border-radius: 14px;
  padding: 20px 24px;
  margin-bottom: 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.generate-panel h3 {
  font-size: 0.92rem;
  color: #333;
  margin-bottom: 14px;
}

.generate-btns {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-generate {
  flex: 1;
  min-width: 140px;
  padding: 11px 14px;
  border: none;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  color: #fff;
  transition: all 0.2s;
}

.btn-generate:nth-child(1) { background: linear-gradient(135deg, #667eea, #764ba2); }
.btn-generate:nth-child(2) { background: linear-gradient(135deg, #f093fb, #f5576c); }
.btn-generate:nth-child(3) { background: linear-gradient(135deg, #4facfe, #00f2fe); }

.btn-generate:hover { transform: translateY(-1px); opacity: 0.9; }
.btn-generate:active { transform: translateY(0); }

.gen-result {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  background: #f8f9fa;
  font-size: 1rem;
  font-weight: 600;
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.gen-result small { font-weight: 400; font-size: 0.75rem; color: #aaa; }

/* ==================== Toast ==================== */
.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 28px;
  border-radius: 10px;
  font-size: 0.88rem;
  color: #fff;
  z-index: 2000;
  animation: fadeIn 0.2s ease;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.toast-success { background: #27ae60; }
.toast-error { background: #e74c3c; }

/* ==================== 数据字典布局 ==================== */

.dict-layout {
  display: flex;
  gap: 0;
  min-height: calc(100vh - 200px);
  border: 1px solid #e8e8e8;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.dict-left {
  width: 320px;
  min-width: 320px;
  border-right: 1px solid #eee;
  display: flex;
  flex-direction: column;
  background: #fafbfc;
}

.dict-left-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #eee;
}

.dict-left-header h3 {
  margin: 0;
  font-size: 1rem;
  color: #333;
}

.dict-left .search-input {
  margin: 10px 12px;
  width: calc(100% - 48px);
  padding: 5px 10px;
  font-size: 0.8rem;
  border-radius: 6px;
}

.dict-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 8px 8px;
}

.dict-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
  margin-bottom: 2px;
}

.dict-item:hover {
  background: #eef0f6;
}

.dict-item.active {
  background: #667eea;
  color: #fff;
}

.dict-item.active .dict-item-desc {
  color: rgba(255,255,255,0.7);
}

.dict-item.active .btn-edit,
.dict-item.active .btn-delete {
  color: #fff;
  border-color: rgba(255,255,255,0.4);
}

.dict-item.active .btn-edit:hover,
.dict-item.active .btn-delete:hover {
  background: rgba(255,255,255,0.15);
}

.dict-item-info {
  flex: 1;
  min-width: 0;
}

.dict-item-name {
  display: block;
  font-weight: 500;
  font-size: 0.92rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dict-item-desc {
  display: block;
  font-size: 0.78rem;
  color: #999;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dict-item-actions {
  display: flex;
  gap: 4px;
  margin-left: 8px;
  flex-shrink: 0;
}

.btn-xs {
  padding: 2px 6px;
  font-size: 0.75rem;
  border-radius: 4px;
  border: 1px solid #ddd;
  background: transparent;
  cursor: pointer;
  line-height: 1.2;
}

.btn-xs.btn-delete {
  color: #e74c3c;
  border-color: #e74c3c;
}

.dict-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.dict-right-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid #eee;
}

.dict-right-header h3 {
  margin: 0;
  font-size: 1rem;
  color: #333;
}

.dict-desc {
  font-size: 0.82rem;
  color: #999;
  margin-left: 8px;
}

.dict-detail-table {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px;
}

.dict-empty-hint {
  color: #bbb;
  font-size: 0.9rem;
  text-align: center;
  padding: 60px 0;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.82rem;
}

/* ==================== 移动端工具 ==================== */
.mobile-filter-bar { display: none; }
.mobile-search-input { flex: 1; min-width: 0; }
.btn-filter {
  padding: 10px 16px; background: #fff; border: 1.5px solid #e0e0e0;
  border-radius: 10px; color: #667eea; font-size: 0.88rem; cursor: pointer;
  white-space: nowrap; transition: all 0.2s;
}
.btn-filter:hover { border-color: #667eea; background: #f5f7ff; }
.btn-mobile-add {
  width: 42px; height: 42px; padding: 0; font-size: 1.4rem; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.toolbar-header { display: none; }
.toolbar-body { display: contents; }
.toolbar-footer { display: flex; gap: 10px; flex-wrap: wrap; flex: none; }
.mobile-card-list { display: none; flex-direction: column; gap: 12px; padding: 0; }
.ship-card {
  background: #fff; border-radius: 14px; padding: 16px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.07); animation: slideIn 0.3s ease;
}
.ship-card-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid #f0f0f0;
}
.ship-card-number { font-weight: 600; font-size: 0.92rem; color: #333; }
.ship-card-body { display: flex; flex-direction: column; gap: 8px; }
.ship-card-row { display: flex; justify-content: space-between; font-size: 0.85rem; }
.ship-card-row span:first-child { color: #888; }
.ship-card-row span:last-child { color: #333; font-weight: 500; text-align: right; }
.ship-card-actions { display: flex; gap: 8px; margin-top: 12px; padding-top: 10px; border-top: 1px solid #f0f0f0; }
.ship-card-actions .btn-edit,
.ship-card-actions .btn-delete { flex: 1; text-align: center; padding: 10px; border-radius: 8px; font-size: 0.85rem; }
.ship-card-actions .btn-edit.disabled,
.ship-card-actions .btn-delete.disabled { color: #ccc !important; cursor: not-allowed !important; background: none !important; }
.load-more { text-align: center; padding: 16px; color: #999; font-size: 0.82rem; }

/* ==================== 响应式 ==================== */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-area {
    margin-left: 0;
  }

  .menu-toggle {
    display: block;
  }

  .sidebar.open + .main-area::after {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.3);
    z-index: 90;
  }

  .topbar { padding: 14px 16px; gap: 8px; }
  .user-info { font-size: 0.8rem; }
  .logout-btn-top { font-size: 0.75rem; padding: 4px 10px; }
  .page-content { padding: 12px; }
  .card { flex-direction: column; align-items: flex-start; gap: 10px; }
  .card-actions { margin-left: 0; align-self: flex-end; }

  /* 移动端：隐藏桌面工具栏，显示筛选条 */
  .toolbar {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    z-index: 1100; background: rgba(0,0,0,0.4);
    display: none; flex-direction: column; padding: 0;
    margin: 0; border-radius: 0;
  }
  .toolbar.drawer-open { display: flex; }
  .toolbar-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 16px 18px 12px; background: #fff; border-radius: 16px 16px 0 0;
    font-weight: 600; font-size: 1rem;
  }
  .btn-close-drawer {
    background: none; border: none; font-size: 1.5rem; color: #999;
    cursor: pointer; padding: 0 4px; line-height: 1;
  }
  .toolbar-body { display: flex; flex-direction: column; gap: 10px; padding: 0 18px; overflow-y: auto; flex: 1; }
  .toolbar-body .search-input,
  .toolbar-body .search-select { width: 100%; min-width: 0; flex: none; }
  .toolbar-body .ac-wrapper { width: 100%; min-width: 0; flex: none; }
  .toolbar-body .search-date { max-width: none; }
  .toolbar-footer {
    background: #fff; padding: 12px 18px 20px;
    border-top: 1px solid #f0f0f0;
    display: flex; gap: 10px;
    flex-wrap: wrap;
  }
  .toolbar-footer .btn-search,
  .toolbar-footer .btn-reset { flex: 1; text-align: center; }
  .toolbar-footer .btn-primary,
  .toolbar-footer .btn-export { display: block; flex: 1; text-align: center; }
  .mobile-filter-bar { display: flex; gap: 8px; margin-bottom: 12px; align-items: center; }

  /* 移动端：隐藏表格，显示卡片 */
  .table-wrapper { display: none; }
  .pagination { display: none !important; }
  .mobile-card-list { display: flex; }
  .stats { margin-bottom: 8px; }
  #totalCount { font-size: 0.82rem; }

  /* 移动端弹窗全屏 */
  .modal { width: 100%; max-width: none; max-height: 100vh; border-radius: 0; height: 100vh; padding: 20px 16px; }
  .modal-overlay { align-items: flex-end; }
  .form-row { flex-direction: column; gap: 0; }
  .modal-btns { flex-direction: column; }
  .modal-btns .btn-cancel,
  .modal-btns .btn-primary,
  .modal-btns .btn-draft { width: 100%; text-align: center; }

  .dict-layout { flex-direction: column; min-height: auto; }
  .dict-left { width: 100%; min-width: auto; border-right: none; border-bottom: 1px solid #eee; max-height: 300px; }
  .dict-right { min-height: 300px; }
  .dict-right-header { padding: 12px 16px; }
  .dict-detail-table { padding: 12px 16px; }
}
