/* ============================================================
   安吉企业系统门户 — 样式表
   无锡安吉环保科技有限公司 · 安吉企业系统门户
   纯静态、零外部依赖（不引用任何 CDN / 字体 / 统计脚本）
   ============================================================ */

:root {
  --bg: #eef2f7;
  --bg-grad-a: #e8eff7;
  --bg-grad-b: #f6f8fb;
  --surface: #ffffff;
  --ink: #14202e;
  --ink-2: #45566b;
  --ink-3: #7b8a9c;
  --line: #dfe6ef;
  --line-strong: #c9d4e2;

  --brand: #0b3d5c;
  --brand-2: #0e6690;
  --brand-ink: #ffffff;

  --ok: #0f7b52;
  --ok-bg: #e6f5ee;
  --ok-line: #b6e0cd;

  --pend: #8a6100;
  --pend-bg: #fdf4de;
  --pend-line: #ecd9a8;

  --build: #5b6675;
  --build-bg: #eef1f5;
  --build-line: #d8dfe8;

  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(20, 32, 46, .05), 0 8px 24px -12px rgba(20, 32, 46, .18);
  --shadow-hover: 0 2px 4px rgba(20, 32, 46, .06), 0 18px 36px -16px rgba(11, 61, 92, .30);
  --wrap: 1180px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background:
    radial-gradient(1200px 600px at 12% -10%, #ffffff 0%, rgba(255,255,255,0) 60%),
    linear-gradient(180deg, var(--bg-grad-a) 0%, var(--bg-grad-b) 42%, var(--bg) 100%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Source Han Sans SC",
               "Noto Sans CJK SC", "WenQuanYi Micro Hei", system-ui, -apple-system,
               "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 24px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--brand);
  color: var(--brand-ink);
  padding: 10px 16px;
  border-radius: 0 0 var(--radius-sm) 0;
  z-index: 100;
}
.skip-link:focus { left: 0; }

/* ---------------- 页眉 ---------------- */
.site-header {
  background: linear-gradient(135deg, #0b3d5c 0%, #10587f 55%, #0e6690 100%);
  color: var(--brand-ink);
  box-shadow: 0 10px 30px -18px rgba(11, 61, 92, .8);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-top: 26px;
  padding-bottom: 26px;
}

.brand { display: flex; align-items: center; gap: 16px; min-width: 0; }

.brand-mark {
  flex: none;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .22);
  color: #ffffff;
}

.brand-text { min-width: 0; }

.brand-company {
  display: block;
  font-size: 14px;
  letter-spacing: .06em;
  color: rgba(255, 255, 255, .82);
  margin: 0 0 2px;
}

.brand-title {
  margin: 0;
  font-size: 26px;
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: .02em;
  color: #ffffff;
}

.header-meta { display: flex; gap: 8px; flex: none; }

.meta-chip {
  font-size: 12.5px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .22);
  color: rgba(255, 255, 255, .94);
  white-space: nowrap;
}

/* ---------------- 提示条 ---------------- */
.notice {
  margin: 22px 0 0;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand-2);
  border-radius: var(--radius-sm);
  padding: 13px 16px;
  font-size: 14px;
  color: var(--ink-2);
  box-shadow: 0 1px 2px rgba(20, 32, 46, .04);
}

.notice strong { color: var(--ink); }

.notice-text { flex: 1 1 auto; min-width: 0; }

.notice-dot {
  flex: none;
  width: 8px; height: 8px;
  margin-top: 8px;
  border-radius: 50%;
  background: var(--brand-2);
}

/* ---------------- 主内容 ---------------- */
main { flex: 1 0 auto; padding-bottom: 40px; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin: 34px 0 16px;
}

.section-title {
  margin: 0;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: .02em;
  color: var(--ink);
  position: relative;
  padding-left: 13px;
}
.section-title::before {
  content: "";
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 4px; height: 18px;
  border-radius: 2px;
  background: var(--brand-2);
}

.section-desc { margin: 0; font-size: 13.5px; color: var(--ink-3); }

/* ---------------- 卡片网格 ---------------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 20px 18px;
  box-shadow: var(--shadow);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--card-accent, var(--line-strong));
}
.card.is-online::before { background: var(--card-accent, linear-gradient(90deg, var(--brand-2), #16a37a)); }
.card.is-lan::before    { background: var(--card-accent, linear-gradient(90deg, #6a7f95, #93a7ba)); }
.card.is-building::before { background: var(--card-accent, linear-gradient(90deg, #aab6c4, #c6d0db)); }

.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); border-color: var(--line-strong); }

.card-top {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.card-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 42px; height: 42px;
  border-radius: 11px;
  background: #f2f6fa;
  border: 1px solid var(--line);
  color: var(--card-accent, var(--brand-2));
}
.card.is-building .card-icon { background: #f5f7fa; }

.card-name {
  margin: 0;
  font-size: 16.5px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--ink);
  word-break: break-word;
}

.badge {
  flex: none;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
  border: 1px solid transparent;
}
.badge-online   { color: var(--ok);    background: var(--ok-bg);    border-color: var(--ok-line); }
.badge-pending  { color: var(--pend);  background: var(--pend-bg);  border-color: var(--pend-line); }
.badge-building { color: var(--build); background: var(--build-bg); border-color: var(--build-line); }
.badge-lan      { color: #3d5a76;      background: #eaf0f6;         border-color: #cbd9e6; }

.card-body { flex: 1 1 auto; min-width: 0; }

.card-summary {
  margin: 0 0 12px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ink-2);
}

.state-msg {
  margin: 22px 0 0;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink-2);
  font-size: 14px;
  text-align: center;
}
.state-msg.is-error { border-color: #f0c9c9; background: #fdf5f5; color: #a63a3a; }

.card-meta { margin: 0 0 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }

.meta-row {
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 10px;
  align-items: baseline;
}
.meta-row dt {
  font-size: 13px;
  color: var(--ink-3);
  white-space: nowrap;
}
.meta-row dd {
  margin: 0;
  font-size: 14px;
  color: var(--ink-2);
  min-width: 0;
  word-break: break-word;
}

.addr-link {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 13.5px;
  color: var(--brand-2);
  font-weight: 600;
}

.addr-reserved { color: var(--ink-3); font-style: normal; }

.tag-lan,
.tag-planned {
  display: inline-block;
  font-size: 13px;
  padding: 2px 9px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #f6f8fa;
  color: var(--ink-2);
}
.tag-planned { color: var(--build); background: var(--build-bg); border-color: var(--build-line); }

.card-foot { margin-top: auto; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background .16s ease, box-shadow .16s ease, transform .12s ease;
  -webkit-tap-highlight-color: transparent;
}

.btn-primary {
  background: linear-gradient(135deg, #0e6690, #0b3d5c);
  color: #ffffff;
  box-shadow: 0 6px 16px -8px rgba(11, 61, 92, .85);
}
.btn-primary:hover { box-shadow: 0 10px 22px -8px rgba(11, 61, 92, .9); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:focus-visible { outline: 3px solid rgba(14, 102, 144, .45); outline-offset: 2px; }

.btn-disabled {
  background: #f1f4f8;
  color: var(--ink-3);
  border-color: var(--line);
  cursor: not-allowed;
  user-select: none;
}

/* ---------------- 页脚 ---------------- */
.site-footer {
  flex: none;
  margin-top: 20px;
  background: #ffffff;
  border-top: 1px solid var(--line);
  padding: 20px 0 26px;
}
.footer-inner { display: flex; flex-direction: column; gap: 6px; }
.footer-company { margin: 0; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.footer-note { margin: 0; font-size: 12.5px; color: var(--ink-3); line-height: 1.7; }
.footer-build { margin-left: 8px; color: var(--ink-3); white-space: nowrap; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 720px) {
  .wrap { padding: 0 16px; }
  .header-inner { flex-direction: column; align-items: flex-start; gap: 14px; padding-top: 20px; padding-bottom: 20px; }
  .brand { gap: 13px; }
  .brand-mark { width: 48px; height: 48px; border-radius: 12px; }
  .brand-company { font-size: 13px; }
  .brand-title { font-size: 21px; }
  .header-meta { flex-wrap: wrap; }
  .notice { margin-top: 16px; font-size: 13.5px; }
  .section-head { margin: 24px 0 14px; }
  .section-title { font-size: 17.5px; }
  .card-grid { grid-template-columns: 1fr; gap: 14px; }
  .card { padding: 16px 16px 15px; }
  .card-name { font-size: 16px; }
  .meta-row { grid-template-columns: 68px 1fr; gap: 8px; }
  body { font-size: 15px; }
}

@media (max-width: 400px) {
  .card-top { grid-template-columns: auto 1fr; row-gap: 10px; }
  .card-top .badge { grid-column: 2; justify-self: start; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

@media print {
  .site-header { background: #0b3d5c !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .card { break-inside: avoid; box-shadow: none; }
}
