/* css/style.css —— 响水物业管理后台 */

:root {
  --brand: #3a7af3;
  --brand-dark: #2f63d0;
  --bg: #f4f6fb;
  --card: #ffffff;
  --text: #2b2f38;
  --muted: #8a909c;
  --line: #e8ebf1;
  --sidebar: #1f2735;
  --sidebar-hover: #2b3547;
  --green: #12b57c;
  --orange: #f5901f;
  --red: #e64a4a;
  --blue: #3a7af3;
  --gray: #9aa1ad;
  --radius: 12px;
  --shadow: 0 6px 24px rgba(31, 39, 53, 0.08);
}

* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', 'PingFang SC', sans-serif;
  color: var(--text);
  background: var(--bg);
  font-size: 14px;
}
.hidden {
  display: none !important;
}
a {
  color: var(--brand);
  text-decoration: none;
}

/* ---------- 入口 gate ---------- */
.gate {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1f2735 0%, #33415c 100%);
  z-index: 50;
}
.gate-card {
  width: 400px;
  max-width: calc(100vw - 40px);
  background: #fff;
  border-radius: 18px;
  padding: 40px 36px 28px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  text-align: center;
}
.gate-logo {
  font-size: 44px;
}
.gate-card h1 {
  font-size: 20px;
  margin: 12px 0 4px;
}
.gate-sub {
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 24px;
}
.gate-field {
  display: block;
  text-align: left;
  margin-bottom: 16px;
}
.gate-field span {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}
.gate-field input {
  width: 100%;
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 14px;
  outline: none;
}
.gate-field input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(58, 122, 243, 0.12);
}
.gate-err {
  color: var(--red);
  font-size: 13px;
  min-height: 18px;
  text-align: left;
  margin-bottom: 8px;
}
.gate-tip {
  color: var(--muted);
  font-size: 12px;
  margin: 16px 0 0;
}

/* ---------- 布局 ---------- */
.layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}
.sidebar {
  width: 226px;
  flex-shrink: 0;
  background: var(--sidebar);
  color: #cfd6e4;
  display: flex;
  flex-direction: column;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
.brand-logo {
  font-size: 26px;
}
.brand-text b {
  display: block;
  color: #fff;
  font-size: 16px;
}
.brand-text span {
  font-size: 12px;
  color: #8b95a8;
}
.nav {
  flex: 1;
  padding: 12px 10px;
  overflow-y: auto;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 10px;
  cursor: pointer;
  color: #c3cbdb;
  font-size: 14px;
  margin-bottom: 4px;
  user-select: none;
}
.nav-item:hover {
  background: var(--sidebar-hover);
  color: #fff;
}
.nav-item.active {
  background: var(--brand);
  color: #fff;
}
.nav-item .nav-icon {
  font-size: 17px;
}
.sidebar-foot {
  padding: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}
.conn {
  font-size: 12px;
  color: #8b95a8;
  margin-bottom: 10px;
  text-align: center;
}
.conn.ok {
  color: #4ade80;
}

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.topbar {
  height: 60px;
  flex-shrink: 0;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 26px;
}
.topbar h2 {
  font-size: 18px;
  margin: 0;
}
.base-info {
  font-size: 12px;
  color: var(--muted);
}
.view {
  flex: 1;
  overflow-y: auto;
  padding: 22px 26px 40px;
}

/* ---------- 卡片 / 工具条 ---------- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.actions {
  display: flex;
  gap: 10px;
}
/* ---------- 表单输入框 ----------
   统一规格：**高 32px、圆角 4px**（后面新做的表单都按这个来，别再各页面各写一遍）
   - 纵向布局（.fld-col）必须配 flex:none：.fld .inp{flex:1} 在纵向容器里
     接管的是**高度**，不放掉的话 height 不参与计算，输入框会被压扁
   - 多行文本（textarea）单独放高一些，否则只剩一行没法用 */
.inp {
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 14px;
  background: #fff;
  outline: none;
  color: var(--text);
}
select.inp {
  padding-right: 26px;
}
.inp:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(58, 122, 243, 0.1);
}
textarea.inp {
  height: auto;
  min-height: 64px;
  padding: 8px 10px;
  line-height: 1.5;
  resize: vertical;
}

/* ---------- 按钮 ---------- */
.btn {
  height: 38px;
  padding: 0 16px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: 9px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.btn:hover {
  border-color: #cfd6e4;
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn-primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.btn-primary:hover {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
}
.btn-danger {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}
.btn-danger:hover {
  filter: brightness(0.95);
}
.btn-success {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}
.btn-ghost {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.2);
  color: #cfd6e4;
}
.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.08);
}
.btn-sm {
  height: 32px;
  padding: 0 12px;
  font-size: 13px;
}
.btn-block {
  width: 100%;
}
.btn-link {
  border: none;
  background: none;
  color: var(--brand);
  padding: 4px 6px;
  height: auto;
  font-size: 13px;
}
.btn-link.danger {
  color: var(--red);
}

/* ---------- 表格 ---------- */
.table-wrap {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow-x: auto;
}
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.table th,
.table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table th {
  background: #fafbfe;
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
}
.table tbody tr:hover {
  background: #f7f9ff;
}
.table tbody tr:last-child td {
  border-bottom: none;
}
.table .cell-wrap {
  white-space: normal;
  max-width: 320px;
}
.empty {
  padding: 56px 0;
  text-align: center;
  color: var(--muted);
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ---------- 徽标 ---------- */
.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 20px;
  font-size: 12px;
  line-height: 18px;
}
.badge-green {
  background: #e4f8f0;
  color: var(--green);
}
.badge-orange {
  background: #fef2e2;
  color: #d97706;
}
.badge-red {
  background: #fdeaea;
  color: var(--red);
}
.badge-blue {
  background: #e8f1fe;
  color: var(--blue);
}
.badge-gray {
  background: #eef0f4;
  color: #6b7280;
}

/* ---------- 分页 ---------- */
.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
}
.pager-info {
  color: var(--muted);
  font-size: 13px;
}
.pager-btns {
  display: flex;
  gap: 8px;
}

/* ---------- 概览 ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}
.stat-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  background: #eef3ff;
}
.stat-num {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.1;
}
.stat-label {
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
}
.section-title {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 12px;
}
.quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}
.quick-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  cursor: pointer;
  text-align: center;
  transition: transform 0.12s;
}
.quick-card:hover {
  transform: translateY(-2px);
}
.quick-card .qc-icon {
  font-size: 28px;
}
.quick-card .qc-label {
  margin-top: 8px;
  font-size: 14px;
}

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(20, 26, 38, 0.5);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 60px 16px;
  overflow-y: auto;
  z-index: 40;
}
.modal {
  width: 560px;
  max-width: 100%;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
  animation: pop 0.16s ease-out;
}
@keyframes pop {
  from {
    transform: translateY(-8px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}
.modal-head h3 {
  margin: 0;
  font-size: 16px;
}
.modal-close {
  border: none;
  background: none;
  font-size: 24px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
}
.modal-body {
  padding: 22px;
  max-height: 62vh;
  overflow-y: auto;
}
.modal-foot {
  padding: 14px 22px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.confirm-text {
  margin: 4px 0;
  line-height: 1.6;
}

/* ---------- 表单 ---------- */
.form {
  display: block;
}
.fld {
  display: flex;
  align-items: center;
  margin-bottom: 14px;
}
.fld-label {
  width: 110px;
  flex-shrink: 0;
  color: #4b5361;
  font-size: 13.5px;
}
.fld .inp {
  flex: 1;
}
.fld-col {
  flex-direction: column;
  align-items: stretch;
}
/* 纵向布局下 flex:1 接管的是高度，会把 32px 的输入框压扁 —— 必须放掉 */
.fld-col .inp {
  flex: none;
}
.fld-col .fld-label {
  width: auto;
  margin-bottom: 8px;
}
.fld-check {
  gap: 8px;
  align-items: center;
}
.fld-check input {
  width: 16px;
  height: 16px;
}
.fld-check span {
  color: #4b5361;
  font-size: 13.5px;
}
.req {
  color: var(--red);
  font-style: normal;
}
.detail-grid {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 10px 14px;
  font-size: 13.5px;
}
.detail-grid .dk {
  color: var(--muted);
}
.detail-grid .dv {
  color: var(--text);
  word-break: break-all;
}
.detail-imgs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}
.detail-imgs img {
  width: 90px;
  height: 90px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
  cursor: pointer;
}
.detail-sub {
  margin: 18px 0 8px;
  font-weight: 600;
  font-size: 14px;
}
.tag-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ---------- 提示 toast ---------- */
.toast-root {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}
.toast {
  padding: 10px 18px;
  border-radius: 10px;
  color: #fff;
  font-size: 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transform: translateY(-8px);
  transition: all 0.25s;
}
.toast.show {
  opacity: 1;
  transform: translateY(0);
}
.toast-info {
  background: #374151;
}
.toast-success {
  background: var(--green);
}
.toast-warn {
  background: var(--orange);
}
.toast-error {
  background: var(--red);
}
