/* ============================================================
   横贯咖啡 · 管理系统 2.0 — 设计系统基础 base.css
   多子系统共用：配色 / 排版 / 按钮 / 卡片 / 通用组件
   品牌色：#4A2C17 深棕（主） #8A5A2B 咖啡棕 #FBF3E8 米色底
   ============================================================ */

:root{
  --brand-dark:#4A2C17;
  --brand:#8A5A2B;
  --brand-light:#C9A97C;
  --bg:#F5F0E8;
  --bg-card:#FFFFFF;
  --text-main:#2B2B2B;
  --text-sub:#7A6A58;
  --line:#E5DCCE;
  --ok:#3A7D44;
  --warn:#B0623A;
  --link:#2563eb;
}

*{ margin:0; padding:0; box-sizing:border-box; }
body{
  font-family:"Microsoft YaHei","PingFang SC",sans-serif;
  background:var(--bg);
  color:var(--text-main);
  line-height:1.6;
}

/* 页面切换 */
.page{ display:none; min-height:100vh; }
.page.active{ display:block; }

/* ============================================================
   第一页 · 欢迎页（视觉照搬老系统 v55，原样保留）
   ============================================================ */
#welcome{
  background:#ffffff;
  min-height:100vh;
  display:flex;
  flex-direction:column;
  align-items:center;
  padding:80px 48px 40px;
  text-align:center;
  justify-content:flex-start;
}
.welcome-logo-area{
  width:100%;
  flex:1;
  display:flex;
  align-items:center;
  justify-content:center;
}
.welcome-logo-img{
  width:min(500px, 60vw);
  height:auto;
  display:block;
  margin:0 auto;
}
.welcome-brand{
  font-size:14px;
  font-weight:bold;
  color:#000;
  letter-spacing:4px;
  margin-top:16px;
  margin-bottom:4px;
}
.welcome-title{
  font-size:32px;
  font-weight:bold;
  color:#000;
  margin-top:40px;
  margin-bottom:8px;
}
.welcome-enter-btn{
  margin-top:40px;
  padding:0;
  background:transparent;
  color:#2563eb;
  border:none;
  border-radius:0;
  font-size:18px;
  font-weight:normal;
  letter-spacing:2px;
  cursor:pointer;
}
.welcome-enter-btn:hover{ opacity:0.6; }
.welcome-copyright{
  margin-top:auto;
  padding-top:60px;
  font-size:13px;
  color:#999;
  font-weight:bold;
}

/* ============================================================
   第二页 · 子系统选择
   ============================================================ */
#dept-select{
  padding:48px 24px 60px;
  max-width:1100px;
  margin:0 auto;
}
.ds-head{ text-align:center; margin-bottom:40px; }
.ds-title{
  font-size:28px;
  font-weight:bold;
  color:var(--brand-dark);
  letter-spacing:2px;
}
.ds-sub{ color:var(--text-sub); margin-top:8px; font-size:14px; }

.dept-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(300px,1fr));
  gap:20px;
}
.dept-card{
  background:var(--bg-card);
  border:1px solid var(--line);
  border-radius:12px;
  padding:24px;
  transition:transform .15s, box-shadow .15s;
  position:relative;
}
.dept-card.ready{
  cursor:pointer;
  border-color:var(--brand-light);
  box-shadow:0 2px 10px rgba(138,90,43,.12);
}
.dept-card.ready:hover{
  transform:translateY(-3px);
  box-shadow:0 8px 24px rgba(138,90,43,.22);
  border-color:var(--brand);
}
.dept-card.wait{ opacity:.72; }
.dept-badge{
  display:inline-block;
  color:#fff;
  font-size:12px;
  font-weight:bold;
  padding:3px 14px;
  border-radius:20px;
  margin-bottom:12px;
  letter-spacing:2px;
}
.dept-name{
  font-size:18px;
  font-weight:bold;
  color:var(--brand-dark);
  margin-bottom:6px;
}
.dept-desc{ font-size:13px; color:var(--text-sub); margin-bottom:16px; }
.dept-status{ font-size:13px; font-weight:bold; }
.dept-status.ok{ color:var(--ok); }
.dept-status.no{ color:#A09080; }
.ds-foot{
  margin-top:44px;
  text-align:center;
  font-size:13px;
  color:var(--text-sub);
  border-top:1px dashed var(--line);
  padding-top:20px;
}

/* ============================================================
   通用组件（子系统共用）
   ============================================================ */
.btn{
  display:inline-block;
  padding:8px 20px;
  border:none;
  border-radius:6px;
  background:var(--brand);
  color:#fff;
  font-size:14px;
  cursor:pointer;
  transition:opacity .15s;
}
.btn:hover{ opacity:.85; }
.btn.ghost{ background:#fff; color:var(--brand-dark); border:1px solid var(--brand-light); }
.btn.small{ padding:5px 12px; font-size:13px; }
.btn.danger{ background:#B03A2E; }

.card{
  background:var(--bg-card);
  border:1px solid var(--line);
  border-radius:10px;
  padding:18px 20px;
}

h1,h2,h3{ color:var(--brand-dark); }

/* 表格 */
table.data{
  width:100%;
  border-collapse:collapse;
  background:#fff;
  font-size:13px;
}
table.data th{
  background:var(--brand-dark);
  color:#fff;
  padding:8px 10px;
  text-align:left;
  font-weight:bold;
  white-space:nowrap;
}
table.data td{
  padding:7px 10px;
  border-bottom:1px solid var(--line);
  vertical-align:middle;
}
table.data tr:nth-child(even){ background:#FAF6EF; }
table.data tr:hover{ background:#F3E9D8; }

/* 弹层 */
.overlay{
  position:fixed; inset:0;
  background:rgba(0,0,0,.4);
  display:none;
  align-items:center;
  justify-content:center;
  z-index:999;
}
.overlay.show{ display:flex; }
.modal{
  background:#fff;
  border-radius:12px;
  padding:24px;
  min-width:420px;
  max-width:92vw;
  max-height:86vh;
  overflow:auto;
  box-shadow:0 10px 40px rgba(0,0,0,.25);
}
.modal h3{ margin-bottom:14px; }

/* 表单 */
label.fld{ display:block; margin-bottom:12px; font-size:13px; color:var(--text-main); }
label.fld input, label.fld select, label.fld textarea{
  width:100%;
  padding:8px 10px;
  margin-top:4px;
  border:1px solid var(--line);
  border-radius:6px;
  font-size:14px;
}
label.fld input:focus, label.fld select:focus, label.fld textarea:focus{
  outline:none;
  border-color:var(--brand);
}

/* 状态徽标 */
.tag{
  display:inline-block;
  padding:2px 10px;
  border-radius:12px;
  font-size:12px;
  font-weight:bold;
}
.tag.ok{ background:#E4F2E6; color:var(--ok); }
.tag.warn{ background:#FBE9DC; color:var(--warn); }
.tag.err{ background:#F9E2E0; color:#B03A2E; }
.tag.gray{ background:#EFECE6; color:#7A6A58; }

/* ===== 移动端通用适配（全站生效） ===== */
@media (max-width:768px){
  /* 弹窗：手机宽度下全宽显示 */
  .modal{ min-width:0; width:94vw; padding:18px 14px; }
  /* 表格：超宽横向滚动，不挤压页面 */
  table{ display:block; width:100%; overflow-x:auto; -webkit-overflow-scrolling:touch; }
  table th{ white-space:nowrap; }
  /* 表单控件触控友好 */
  label.fld input, label.fld select, label.fld textarea{ font-size:16px; padding:10px; }
  .btn{ padding:8px 14px; }
}
@media (max-width:480px){
  .modal{ width:96vw; padding:16px 10px; max-height:90vh; }
}
