/* ==========================================================================
   中小企业财务系统 V2.0 - 公共样式
   基于 UI 设计稿：品牌蓝 #1677FF 主色 + 收入绿 #00B42A + 支出红 #F53F3F
   ========================================================================== */
:root {
  --primary: #1677FF;
  --primary-hover: #4096FF;
  --primary-active: #0958D9;
  --success: #00B42A;
  --warning: #FF7D00;
  --danger: #F53F3F;
  --info: #86909C;
  --title: #1D2129;
  --body: #4E5969;
  --secondary: #86909C;
  --border: #E5E6EB;
  --bg: #F2F3F5;
  --card: #FFFFFF;
  --shadow: 0 2px 8px rgba(0,0,0,.08);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--body);
  font-size: 14px;
  line-height: 22px;
  min-width: 1200px;
}
a { text-decoration: none; color: inherit; }

/* Top Nav */
.top-nav {
  height: 56px;
  background: var(--card);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  padding: 0 24px;
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
}
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 600;
  color: var(--title);
  width: 200px;
  cursor: pointer;
}
.logo-dot {
  width: 32px;
  height: 32px;
  background: var(--primary);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 18px;
  font-weight: 700;
}
.nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: auto;
}
.nav-user {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}
#userName { font-size: 14px; color: var(--title); }

/* Sidebar */
.sidebar {
  width: 200px;
  background: var(--card);
  position: fixed;
  top: 56px;
  left: 0;
  bottom: 0;
  border-right: 1px solid var(--border);
  padding: 12px 0;
  overflow-y: auto;
  z-index: 99;
}
.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 44px;
  padding: 0 24px;
  cursor: pointer;
  transition: all .15s;
  border-right: 3px solid transparent;
  text-decoration: none;
  color: var(--body);
}
.menu-item:hover { background: var(--bg); }
.menu-item.active {
  background: #E8F3FF;
  color: var(--primary);
  border-right-color: var(--primary);
  font-weight: 500;
}
.menu-item .icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.menu-item .label { font-size: 14px; }
.group-label {
  padding: 16px 24px 8px;
  font-size: 12px;
  color: var(--secondary);
  font-weight: 500;
}

/* Main Content */
.main-content {
  margin-left: 200px;
  margin-top: 56px;
  padding: 24px;
  min-height: calc(100vh - 56px);
}

/* Common Buttons */
.btn {
  padding: 8px 16px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--body);
  font-size: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all .15s;
  text-decoration: none;
}
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.btn-primary:hover { background: var(--primary-hover); color: #fff; }
.btn-danger { color: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: #FFF0F0; }
.btn-sm { padding: 4px 12px; font-size: 12px; height: 28px; }

/* Toast */
.toast {
  position: fixed;
  top: 72px;
  right: 24px;
  z-index: 9999;
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 14px;
  color: #fff;
  animation: toastIn .3s ease;
}
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.warning { background: var(--warning); }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,.4);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-box {
  background: #fff;
  border-radius: 8px;
  width: 520px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 8px 40px rgba(0,0,0,.15);
}
.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-header h3 { font-size: 16px; font-weight: 600; color: var(--title); }
.modal-close {
  width: 28px; height: 28px; border: none; background: none;
  cursor: pointer; font-size: 18px; color: var(--secondary);
}
.modal-body { padding: 20px; }

/* Form */
.form-row { margin-bottom: 16px; }
.form-row label {
  display: block;
  font-size: 13px;
  color: var(--body);
  margin-bottom: 6px;
}
.form-row input, .form-row select, .form-row textarea {
  width: 100%;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0 10px;
  font-size: 13px;
  color: var(--title);
}
.form-row textarea { height: 72px; padding: 8px 10px; resize: vertical; }
.form-row input:focus, .form-row select:focus, .form-row textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(22,119,255,.1);
}
.form-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 20px;
}
