:root{ --bg:#f7f7f7; --txt:#222; --muted:#666; --primary:#0d6efd; --border:#e5e5e5; --success:#28a745; --danger:#dc3545; --warning:#ffc107; --info:#17a2b8; --active:#6c8e23; }
*{ box-sizing: border-box; }
body{ margin:0; font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,"Noto Sans","Apple Color Emoji","Segoe UI Emoji"; color:var(--txt); background:var(--bg);} 
.container{ max-width: 1200px; margin: 0 auto; padding: 16px; }

/* 紧凑导航栏 */
.navbar{ 
  display:flex; 
  align-items:center; 
  justify-content:space-between; 
  padding:8px 16px; 
  background:#fff; 
  border-bottom:1px solid var(--border); 
  position:sticky; 
  top:0; 
  z-index:10; 
  box-shadow: 0 1px 2px rgba(0,0,0,0.05); 
  height: 50px;
  max-width: 1200px;
  margin: 0 auto;
}

/* 顶部导航外层包裹，撑满宽度，背景色和阴影 */
.navbar-outer {
  width: 100%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  position: sticky;
  top: 0;
  z-index: 10;
}
.nav-title{ font-weight:600; font-size:16px; }
.nav-buttons{ display:flex; gap:6px; }
.nav-btn{ 
  color:#fff; 
  text-decoration:none; 
  padding:6px 14px; 
  border-radius:4px; 
  font-size:13px; 
  transition: all 0.2s; 
  background: var(--primary);
  border: 1px solid var(--primary);
  font-weight: 500;
}
.nav-btn:hover{ 
  opacity: 0.85;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.nav-btn.active{
  background: var(--active);
  border-color: var(--active);
}
.nav-user-info{ display: flex; align-items: center; gap: 12px; }
.nav-user{ color:var(--muted); font-size:13px; white-space: nowrap; }
.navbar .nav-buttons{ margin-right: 1ch; }

.btn{ background:#fff; border:1px solid var(--border); padding:8px 16px; border-radius:6px; cursor:pointer; font-size:14px; transition: all 0.2s; }
.btn:hover{ background:var(--bg); }
.btn.primary{ background: var(--primary); color:#fff; border-color: var(--primary); }
.btn.primary:hover{ opacity: 0.9; background: var(--primary); }
.btn.btn-sm{ padding:4px 10px; font-size:12px; }
.btn.btn-danger{ background: var(--danger); color:#fff; border-color: var(--danger); }
.btn.btn-danger:hover{ opacity: 0.9; background: var(--danger); }
.btn:disabled{ opacity:0.5; cursor:not-allowed; }
.card{ background:#fff; border:1px solid var(--border); border-radius:8px; padding:20px; margin:16px 0; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.card h2{ margin:0 0 8px 0; font-size:32px; }
.card h3{ margin:0 0 16px 0; font-size:18px; font-weight:600; }
.grid{ display:grid; gap:16px; }
.grid.cols-2{ grid-template-columns: repeat(2,1fr); }
.grid.cols-3{ grid-template-columns: repeat(3,1fr); }
.grid.cols-4{ grid-template-columns: repeat(4,1fr); }
table{ width:100%; border-collapse: collapse; margin-top:12px; }
th,td{ padding:10px 8px; border-bottom:1px solid var(--border); text-align:center; font-size:14px; }
th{ background:var(--bg); font-weight:600; }
tr:hover{ background:rgba(0,0,0,0.02); }

/* Modal preview */
.modal-backdrop{ position: fixed; inset:0; background: rgba(0,0,0,0.5); display:flex; align-items:center; justify-content:center; z-index: 1000; padding: 12px; }
.modal{ background:#fff; border-radius:10px; padding:0; max-width: 92vw; max-height: 86vh; overflow:hidden; box-shadow:0 14px 38px rgba(0,0,0,0.35); }
.modal-header{ display:flex; align-items:center; justify-content:space-between; border-bottom:1px solid var(--border); padding: 12px 16px; }
.modal .modal-body{ padding: 12px 16px; }
.modal .modal-actions{ display:flex; justify-content:flex-end; gap:8px; padding: 12px 16px; border-top:1px solid var(--border); }
input,select,textarea{ padding:8px 12px; border:1px solid var(--border); border-radius:6px; width:100%; font-size:14px; transition: border 0.2s; }
input:focus,select:focus,textarea:focus{ outline:none; border-color:var(--primary); }
input[type="file"]{ padding:4px; }
label{ display:block; margin-bottom:4px; font-size:14px; font-weight:500; color:var(--muted); }
.row{ display:flex; gap:8px; align-items:center; }
.row > *{ flex:1; }
.muted{ color:var(--muted); font-size:13px; }
.list{ list-style:none; padding:0; margin:0; }
.list li{ padding:10px 0; border-bottom:1px solid var(--border); }
.list li:last-child{ border-bottom:none; }
.list a{ color:var(--primary); text-decoration:none; }
.list a:hover{ text-decoration:underline; }
.tag{ font-size:12px; padding:2px 8px; border:1px solid var(--border); border-radius:4px; background:var(--bg); }
.hidden{ display:none; }
a{ color:var(--primary); }
a:hover{ text-decoration:none; }

/* Toast通知 - Node.js风格 */
.toast-container{ 
  position: fixed; 
  top: 60px; 
  right: 20px; 
  z-index: 9999; 
  display: flex; 
  flex-direction: column; 
  gap: 10px;
  max-width: 400px;
}
.toast{ 
  padding: 12px 16px; 
  border-radius: 4px; 
  color: #fff; 
  font-size: 14px; 
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  animation: slideIn 0.3s ease;
  font-family: 'Courier New', monospace;
  border-left: 4px solid rgba(255,255,255,0.5);
}
.toast-success{ background: var(--success); }
.toast-error{ background: var(--danger); }
.toast-warning{ background: var(--warning); color: #333; }
.toast-info{ background: var(--info); }

@keyframes slideIn {
  from { transform: translateX(400px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* 登录页面样式 */
.login-container{ 
  min-height: 100vh; 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  background: var(--bg); 
  padding: 20px;
}
.login-card{ 
  background: #fff; 
  border: 1px solid var(--border); 
  border-radius: 8px; 
  padding: 40px; 
  width: 100%; 
  max-width: 420px; 
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.login-title{ 
  margin: 0 0 24px 0; 
  font-size: 24px; 
  font-weight: 600; 
  text-align: center; 
  color: var(--txt);
}
.form-group{ 
  margin-bottom: 16px;
}
.form-group:last-child{ 
  margin-bottom: 0; 
  margin-top: 24px;
}
.error-msg{ 
  background: #fee; 
  color: var(--danger); 
  padding: 10px 12px; 
  border-radius: 6px; 
  margin-bottom: 16px; 
  font-size: 14px; 
  border: 1px solid #fcc;
}
.btn-block{ 
  width: 100%; 
  padding: 10px;
}
