/* 联桥 LinkBridge · 共享原子类与通用组件（权威，移植自 linkbridge-prototype.html:58-398 中跨端复用部分）
   依赖 tokens.css。端特定外壳（appwin/side/admin/maker/mobile 外壳）由各端页面样式自理。 */

/* ---- 卡片与头部 ---- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: var(--sh-1); }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px 0; }
.card-h h3 { font-size: 13px; font-weight: 600; letter-spacing: .01em; }
.card-h .sub { font-size: 12px; color: var(--ink3); }
.phead { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.phead h2 { font-size: 22px; font-weight: 600; letter-spacing: -.022em; line-height: 1.25; }
.phead p { font-size: 12.5px; color: var(--ink3); margin-top: 5px; }
.phead .acts { display: flex; gap: 8px; flex: 0 0 auto; }

/* ---- 布局 ---- */
.g2 { display: grid; grid-template-columns: 1.42fr 1fr; gap: 14px; }
.g3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.g4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.pad { padding: 16px 18px; }

/* ---- 按钮 ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 32px;
  padding: 0 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  transition: background .15s ease, border-color .15s ease, transform .1s ease;
  flex: 0 0 auto;
  white-space: nowrap;
}
.btn:hover { background: #F7F7F9; }
.btn:active { transform: scale(.985); }
.btn.primary { background: var(--accent); border-color: transparent; color: #fff; }
.btn.primary:hover { background: var(--accent2); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--accent); }
.btn.ghost:hover { background: var(--accent-soft); }
.btn.sm { height: 27px; padding: 0 10px; font-size: 12px; border-radius: 7px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

/* ---- 开关 ---- */
.switch { position: relative; display: inline-flex; width: 42px; height: 25px; flex: 0 0 auto; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch i { position: absolute; inset: 0; background: #D8D8DD; border-radius: 99px; transition: background .2s ease; }
.switch i::after { content: ""; position: absolute; top: 2.5px; left: 2.5px; width: 20px; height: 20px; background: #fff; border-radius: 50%; box-shadow: 0 1px 3px rgba(0, 0, 0, .18); transition: transform .2s cubic-bezier(.3, 1.4, .5, 1); }
.switch input:checked + i { background: var(--green); }
.switch input:checked + i::after { transform: translateX(17px); }
.switch input:focus-visible + i { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---- 标签 ---- */
.tag { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 11.5px; font-weight: 500; letter-spacing: .01em; }
.tag.green { background: var(--green-soft); color: var(--green); }
.tag.grey { background: rgba(0, 0, 0, .045); color: var(--ink2); }
.tag.blue { background: var(--accent-soft); color: var(--accent2); }
.tag.amber { background: var(--amber-soft); color: var(--amber); }
.tag.red { background: var(--red-soft); color: var(--red); }
.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: 0 0 auto; }

/* ---- 进度 ---- */
.bar { height: 5px; border-radius: 99px; background: rgba(0, 0, 0, .07); overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 99px; background: var(--accent); transition: width .45s cubic-bezier(.4, 0, .2, 1); }

/* ---- 表单 ---- */
.field { height: 34px; border: 1px solid var(--line); border-radius: 8px; padding: 0 11px; font-size: 13px; background: #fff; width: 100%; outline: none; }
.field:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0, 113, 227, .14); }
.field.lg { height: 44px; font-size: 15px; letter-spacing: .22em; text-align: center; }
.sel { height: 36px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; font-size: 13px; background: #fff; width: 100%; outline: none; appearance: none; background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2386868B' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; }
.chips { display: flex; gap: 7px; flex-wrap: wrap; }
.chip { height: 30px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line); font-size: 12.5px; color: var(--ink2); background: #fff; }
.chip.on { border-color: var(--accent); color: var(--accent2); background: var(--accent-soft); font-weight: 500; }
.fgroup { margin-top: 16px; }
.fgroup label { display: block; font-size: 12px; color: var(--ink2); margin-bottom: 6px; }
.f2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.msearch { display: flex; align-items: center; gap: 8px; height: 36px; border-radius: 10px; background: rgba(0, 0, 0, .05); padding: 0 11px; color: var(--ink3); font-size: 13px; }

/* ---- 表格 ---- */
.tblwrap { background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.tbl th { text-align: left; font-weight: 500; font-size: 11.5px; color: var(--ink3); padding: 10px 14px; background: #FBFBFD; border-bottom: 1px solid var(--line); letter-spacing: .02em; white-space: nowrap; }
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line2); vertical-align: middle; white-space: nowrap; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tbody tr:hover { background: #FCFCFD; }
.tbl .k { font-family: "SF Mono", ui-monospace, Menlo, monospace; font-size: 12px; letter-spacing: .02em; }

/* ---- 弹窗 ---- */
.modal { position: fixed; inset: 0; background: rgba(20, 20, 22, .34); display: none; place-items: center; z-index: 80; padding: 24px; }
.modal.on { display: grid; }
.mcard2 { width: 508px; max-height: 88vh; overflow: auto; background: #fff; border-radius: 16px; box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .5); padding: 22px; }
.mcard2 h3 { font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.mcard2 p.sub { font-size: 12.5px; color: var(--ink3); margin-top: 5px; line-height: 1.55; }

/* ---- 列表行 ---- */
.trow { display: grid; grid-template-columns: 26px minmax(0, 1fr) 96px 58px; gap: 12px; align-items: center; padding: 11px 18px; border-top: 1px solid var(--line2); }
.trow:first-of-type { border-top: none; }
.trow .tn { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trow .tm { font-size: 11.5px; color: var(--ink3); margin-top: 3px; }
.trow .tp { font-size: 11.5px; color: var(--ink2); text-align: right; }
.devrow { display: flex; align-items: center; gap: 12px; padding: 14px 18px; }
.devic { width: 38px; height: 38px; border-radius: 10px; background: #F3F3F6; display: grid; place-items: center; color: var(--ink2); flex: 0 0 auto; }
.devic.dark { background: var(--ink); color: #fff; }
.devmeta { min-width: 0; flex: 1; }
.devmeta b { display: block; font-size: 13.5px; font-weight: 500; }
.devmeta span { display: block; font-size: 11.5px; color: var(--ink3); margin-top: 2px; }
.qtile { text-align: left; padding: 15px 16px; border: 1px solid var(--line); border-radius: var(--r-m); background: #fff; transition: border-color .15s, box-shadow .15s, transform .1s; }
.qtile:hover { border-color: rgba(0, 0, 0, .16); box-shadow: 0 6px 16px -10px rgba(0, 0, 0, .3); }
.qtile:active { transform: scale(.992); }
.qtile .qi { width: 30px; height: 30px; border-radius: 8px; background: #F3F3F6; display: grid; place-items: center; color: var(--ink); margin-bottom: 11px; }
.qtile b { display: block; font-size: 13px; font-weight: 500; }
.qtile span { display: block; font-size: 11.5px; color: var(--ink3); margin-top: 3px; line-height: 1.45; }
.togglerow { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line2); font-size: 12.5px; }
.togglerow:first-of-type { border-top: none; }
.togglerow span { color: var(--ink2); }

/* ---- 页签 ---- */
.subtabs { display: inline-flex; gap: 22px; border-bottom: 1px solid var(--line); margin-bottom: 18px; width: 100%; }
.subtabs button { padding: 9px 0 11px; font-size: 13.5px; color: var(--ink2); border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .15s, border-color .15s; }
.subtabs button:hover { color: var(--ink); }
.subtabs button.on { color: var(--ink); border-color: var(--accent); font-weight: 500; }
.tabpane { display: none; }
.tabpane.on { display: block; }
