/* hddzjxc - 进销存管理系统 样式 */
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei",
               Roboto, Arial, sans-serif;
  background: #f5f6fa; color: #2c3e50;
  font-size: 14px;
}
a { color: #2d6cdf; text-decoration: none; }
a:hover { text-decoration: underline; }

/* 顶栏 */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 24px; background: #2d3748; color: #fff;
  position: sticky; top: 0; z-index: 50;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.topbar .brand { font-weight: 700; font-size: 18px; color: #fff; white-space: nowrap; }
.topbar .brand-edit {
  color: #a0aec0; font-size: 13px; cursor: pointer; margin-left: 8px;
  padding: 2px 5px; border-radius: 3px; transition: all 0.12s;
}
.topbar .brand-edit:hover { color: #fff; background: rgba(255,255,255,0.15); }
.nav-links {
  display: flex; align-items: center; flex-wrap: nowrap; gap: 4px;
}
.nav-links a {
  color: #cbd5e0; margin-left: 10px; font-size: 14px; white-space: nowrap;
}
.nav-links a:hover { color: #fff; text-decoration: none; }

.db-banner {
  background: #fff8e1; padding: 10px 24px;
  border-bottom: 1px solid #ffeeba;
  color: #856404; font-size: 13px;
}
.db-banner code { background: rgba(0,0,0,0.06); padding: 1px 4px; border-radius: 3px; }

.main { max-width: 1180px; margin: 0 auto; padding: 24px; }

/* 主菜单 */
.menu-card {
  background: #fff; padding: 36px 24px; border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  max-width: 600px; margin: 40px auto;
}
.menu-card h1 { margin-top: 0; text-align: center; color: #2d3748; }
.menu-list { list-style: none; padding: 0; }
.menu-list li {
  padding: 18px 24px; margin: 12px 0;
  background: #f8fafc; border: 1px solid #e2e8f0;
  border-radius: 6px; text-align: center; font-size: 16px;
  transition: all 0.15s;
}
.menu-list li:hover {
  background: #2d6cdf; border-color: #2d6cdf;
}
.menu-list li:hover a { color: #fff; text-decoration: none; }
.db-info { margin-top: 24px; text-align: center; color: #718096; font-size: 13px; }

/* 通用页面 */
.page-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.page-head h2 { margin: 0; font-size: 20px; }
.page-head .actions { display: flex; gap: 8px; align-items: center; }
.page-head .actions input, .page-head .actions select {
  padding: 6px 10px; border: 1px solid #cbd5e0; border-radius: 4px;
  font-size: 13px;
}
.page-head .actions label { font-size: 13px; color: #4a5568; }

.btn {
  display: inline-block; padding: 6px 14px;
  border: 1px solid #cbd5e0; background: #fff;
  color: #4a5568; border-radius: 4px;
  cursor: pointer; font-size: 13px;
  transition: all 0.12s;
}
.btn:hover { background: #edf2f7; }
.btn-primary { background: #2d6cdf; color: #fff; border-color: #2d6cdf; }
.btn-primary:hover { background: #1f5fcc; }
.btn-danger { background: #e53e3e; color: #fff; border-color: #e53e3e; }
.btn-danger:hover { background: #c53030; }
.btn-sm { padding: 3px 10px; font-size: 12px; }

/* 表格 */
.data-table {
  width: 100%; border-collapse: collapse;
  background: #fff; border-radius: 6px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  overflow: hidden;
}
.data-table th, .data-table td {
  padding: 10px 12px; text-align: center;
  border-bottom: 1px solid #edf2f7; font-size: 13px;
}
.data-table th {
  background: #f7fafc; color: #4a5568; font-weight: 600;
}
.data-table tr:hover td { background: #f7fafc; }
.data-table .empty { color: #a0aec0; padding: 30px 0; }
.data-table .hl { color: #e53e3e; font-weight: 700; font-size: 15px; }

/* 表单 */
.form-card, .export-card {
  background: #fff; padding: 24px; border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  margin-bottom: 18px;
}
.export-card h3, .form-row h4 { margin-top: 20px; }
.form-row { margin: 12px 0; display: flex; flex-direction: column; max-width: 480px; }
.form-row.inline { flex-direction: row; align-items: center; max-width: none; gap: 8px; }
.form-row label { font-size: 13px; color: #4a5568; margin-bottom: 4px; font-weight: 500; }
.form-row input, .form-row select, .form-row textarea {
  padding: 8px 10px; border: 1px solid #cbd5e0; border-radius: 4px;
  font-size: 14px;
}
.form-row input[type="checkbox"] { width: auto; }
.form-row input[type="radio"] { width: auto; padding: 0; border: none; margin: 0; }
.form-row select[multiple] {
  min-height: 38px; height: auto; overflow: auto;
  background: #fff;
}
.form-row select[multiple] option { padding: 6px 10px; }
.form-row select[multiple] option:checked { background: #2d6cdf linear-gradient(0deg, #2d6cdf 0%, #2d6cdf 100%); color: #fff; }
.form-row label.radio {
  display: inline-flex; align-items: center; gap: 4px;
  font-weight: normal; margin-bottom: 0; cursor: pointer;
  margin-right: 16px;
}
.form-row label.radio input { margin: 0; }
.selected-toggle { color: #e53e3e; font-weight: 500; }
.form-row input:focus, .form-row select:focus, .form-row textarea:focus {
  outline: none; border-color: #2d6cdf; box-shadow: 0 0 0 2px rgba(45,108,223,0.15);
}
.hint { color: #718096; font-size: 12px; }
.summary {
  margin-top: 16px; padding: 14px; background: #f7fafc;
  border-radius: 6px; font-size: 14px;
  display: flex; align-items: center; gap: 12px;
}
.summary b { color: #e53e3e; font-size: 18px; }
.summary span { color: #4a5568; }
.summary span.sep { margin-left: 18px; }
.summary .btn-primary { margin-left: auto; }

/* 模态框 */
.modal-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,0.45);
  display: none; align-items: center; justify-content: center;
  z-index: 100;
}
.modal {
  background: #fff; border-radius: 8px; min-width: 480px; max-width: 96vw;
  max-height: 88vh; overflow: hidden; display: flex; flex-direction: column;
}
.modal.big { min-width: 760px; }
.modal.huge { min-width: 1520px; }
/* 单价/数量输入框更窄 */
.data-table input.qty, .data-table input.price {
  max-width: 80px;
}
.data-table input.price-narrow {
  max-width: 80px; /* 约为原来的 1/3 */
}
/* 销售制单整张卡片加宽，商品列表更舒展 */
.wide-card {
  max-width: 1520px;
  margin-left: auto;
  margin-right: auto;
}
.modal-head {
  padding: 12px 20px; border-bottom: 1px solid #edf2f7;
  display: flex; align-items: center; justify-content: space-between;
}
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-close {
  cursor: pointer; font-size: 22px; color: #a0aec0;
}
.modal-close:hover { color: #2d3748; }
.modal-body { padding: 18px 20px; overflow: auto; }
.modal-foot {
  padding: 12px 20px; border-top: 1px solid #edf2f7;
  text-align: right;
}
.modal-foot .btn { margin-left: 8px; }

/* 自动补全下拉 */
.autocomplete { position: relative; }
.autocomplete input { width: 100%; }
.autocomplete-list {
  position: absolute; top: 100%; left: 0; right: 0;
  background: #fff; border: 1px solid #cbd5e0; border-radius: 4px;
  max-height: 180px; overflow: auto; z-index: 200;
  display: none; box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.autocomplete-list.show { display: block; }
.autocomplete-item {
  padding: 8px 12px; cursor: pointer; font-size: 14px;
  border-bottom: 1px solid #f0f0f0;
}
.autocomplete-item:last-child { border-bottom: none; }
.autocomplete-item:hover { background: #ebf4ff; }

/* 标签 */
.tag {
  padding: 2px 8px; border-radius: 10px; font-size: 12px;
}
.tag-ok    { background: #c6f6d5; color: #22543d; }
.tag-warn  { background: #fefcbf; color: #744210; }
.tag-muted { background: #e2e8f0; color: #4a5568; }
.low-stock { color: #e53e3e; font-weight: 700; }

/* 统计卡片 */
.stat-cards {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px;
  margin: 16px 0;
}
.stat {
  background: #fff; padding: 16px 20px; border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  display: flex; justify-content: space-between; align-items: center;
}
.stat span { color: #718096; font-size: 13px; }
.stat b { font-size: 22px; color: #2d3748; }
.stat.warning b { color: #e53e3e; }

.qty {
  width: 70px; text-align: center;
  padding: 4px 6px; font-size: 14px;
  margin: 0 6px; border: 1px solid #cbd5e0; border-radius: 4px;
}

.data-table.selectable .qty { width: 80px; }

/* 登录页面 */
.login-wrap {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; background: #f5f6fa;
}
.login-card {
  background: #fff; padding: 40px 36px; border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  max-width: 400px; width: 90%;
}
.login-card h1 { margin: 0 0 8px; font-size: 22px; text-align: center; color: #2d3748; }
.login-sub { text-align: center; color: #718096; font-size: 14px; margin: 0 0 24px; }
.login-form .form-row { max-width: none; }
.login-btn { width: 100%; padding: 10px; font-size: 15px; margin-top: 8px; }
.login-msg { color: #e53e3e; font-size: 13px; min-height: 18px; margin-top: 4px; }

/* 顶栏用户信息 */
.nav-user {
  color: #a0aec0; font-size: 14px; margin-left: 10px;
  display: inline-flex; align-items: center; gap: 4px; white-space: nowrap;
}
.nav-links .logout-link {
  color: #fc8181; cursor: pointer; text-decoration: none;
}
.nav-links .logout-link:hover { color: #f56565; text-decoration: underline; }
