/* domain.js 组件的专属样式：DomainDetail（dd-）、Tickets（tk-）、DNSManager（dm-）
   注意：抽屉内容会被 teleport 到 body，抽屉里用到的类不能依赖组件根节点的类名。 */

/* ================= 域名详情 ================= */
/* ---------- 页头：域名 + 状态 + 操作，下面一行元信息 ---------- */
.dd-head { margin-bottom: 24px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.dd-head-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dd-head-top > .btn.icon { margin-left: -8px; }
.dd-head h1 { margin: 0 4px 0 0; font-size: 22px; line-height: 1.35; font-weight: 650; letter-spacing: -.01em; color: var(--text); word-break: break-all; }
.dd-acts { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dd-meta { display: flex; flex-wrap: wrap; gap: 14px 0; margin: 18px 0 0; padding-left: 36px; }
.dd-meta > div { min-width: 0; padding-right: 28px; margin-right: 28px; border-right: 1px solid var(--line); }
.dd-meta > div:last-child { padding-right: 0; margin-right: 0; border-right: 0; }
.dd-meta dt { font-size: 12.5px; color: var(--dim); }
.dd-meta dd { margin: 3px 0 0; min-height: 26px; display: flex; align-items: center; font-weight: 500; color: var(--text); }
.dd-meta dd a { cursor: pointer; }
.dd-verify { margin-bottom: 20px; padding: 14px 16px; }
.dd-verify-t { display: flex; align-items: center; gap: 6px; }
.dd-verify-s { font-size: 12.5px; opacity: .85; }
.dd-verify-b { margin-top: 6px; line-height: 1.9; }
.dd-verify a, .dd-steps a, .dd-sech a { cursor: pointer; font-weight: 500; }

/* ---------- 左侧导航与右侧内容 ---------- */
.dd .dd-nav { top: 4px; padding: 10px 8px; }
.dd .dd-nav .grp { padding: 16px 10px 6px; font-weight: 500; }
.dd .dd-nav a { cursor: pointer; gap: 10px; }
.dd .dd-nav a svg { color: var(--faint); }
.dd .dd-nav a.on svg { color: var(--accent); }
.dd-main { min-width: 0; min-height: 100vh; } /* 切换标签时内容暂短也不压缩滚动位置 */
.dd-tabh { align-items: baseline; flex-wrap: wrap; }
.dd-tabh h2 { font-size: 17px; }
/* 每个标签页只有一个保存，放在标题右侧；标题条吸顶，长表单滚动时保存始终可见 */
.dd-tabh { position: sticky; top: 0; z-index: 5; min-height: 34px; margin: -10px 0 6px; padding: 10px 0; background: var(--bg); }
.dd-tabh > .btn { align-self: center; flex: none; }
.dd-main > .panel + .panel, .dd-main > .note + .panel, .dd-main > .panel + .note, .dd-main > .panel + .dd-note { margin-top: 16px; }
.dd-note { margin-top: 16px; }
.dd-hint, .dd-foot .hint { font-size: 12.5px; color: var(--dim); line-height: 1.6; }
.dd-unit { font-size: 13px; color: var(--dim); white-space: nowrap; }
.dd-tag { margin-left: 8px; vertical-align: 1px; }
.dd .field.dd-last, .dd-opts + .field.dd-last { margin-bottom: 0; }
.dd-btns { display: flex; align-items: center; gap: 8px; }
.dd-inl { display: flex; align-items: center; gap: 10px; min-height: 34px; }
.dd-inl > .inp { flex: 1; min-width: 0; }
.dd .field > .seg { align-self: flex-start; }

/* 列宽与短输入框 */
.dd-c50 { width: 50px; } .dd-c90 { width: 90px; } .dd-c110 { width: 110px; } .dd-c140 { width: 140px; } .dd-c160 { width: 160px; } .dd-c240 { width: 240px; }
.inp.dd-i60 { width: 60px; } .inp.dd-i80 { width: 80px; } .inp.dd-i100 { width: 100px; } .inp.dd-i120 { width: 120px; } .inp.dd-i160 { width: 160px; } .inp.dd-i200 { width: 200px; }

/* 面板头部里的开关 */
.dd-hsw { display: inline-flex; align-items: center; gap: 8px; margin-right: 6px; font-size: 13px; color: var(--text-2); cursor: pointer; }

/* 设置项列表：字段之后接一组 opt-row */
.dd-opts { margin-top: 4px; border-top: 1px solid var(--line); }
.dd-opts > .opt-row:first-child { padding-top: 16px; }
.dd-opts.flush { margin-top: 0; border-top: 0; }
.dd-opts.flush > .opt-row:first-child { padding-top: 2px; }
.dd-opts.flush > .opt-row:last-child { padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.dd-after-opts { margin-top: 18px; }
.dd .opt-row { align-items: center; }
.dd .opt-row .ot b { display: flex; align-items: center; gap: 6px; }
.dd .opt-row:has(+ .opt-sub) { border-bottom: 0; padding-bottom: 12px; }
.dd .opt-sub { margin: 0 0 16px; padding: 18px 18px 0; border: 1px solid var(--line); border-radius: var(--rc); background: var(--bg-2); }
.dd .opt-sub + .opt-row { border-top: 1px solid var(--line); }
.dd .opt-sub:last-child { margin-bottom: 0; }
.dd .opt-sub .code { margin: 0; }
.dd-methods { gap: 6px 16px; max-width: 460px; }
.dd-pad { padding: 4px 20px; border-bottom: 1px solid var(--line); }
.dd-pad > .opt-row:only-child { padding: 14px 0; }

/* 可编辑列表：贴边表格 + 底部操作条 */
.dd .tbl.dd-edit td { padding: 8px 8px; }
.dd .tbl.dd-edit th { padding: 0 8px; }
.dd .tbl.dd-edit th:first-child, .dd .tbl.dd-edit td:first-child { padding-left: 20px; }
.dd .tbl.dd-edit th:last-child, .dd .tbl.dd-edit td:last-child { padding-right: 12px; }
.dd .tbl.dd-edit tr:hover td { background: none; }
.dd-foot { display: flex; align-items: center; gap: 14px; padding: 12px 20px; border-top: 1px solid var(--line); }
.dd-foot > .btn { flex: none; }
.dd-foot:first-child, .dd-pad + .dd-foot { border-top: 0; }
.dd .tbl:has(+ .dd-foot) tbody tr:last-child td { border-bottom: 0; }
.dd-cut { max-width: 340px; } .dd-cut .ellipsis { display: block; }
.dd-rules { padding: 16px 20px 0; }
.dd-rule { margin-bottom: 16px; padding: 14px 16px 0; border: 1px solid var(--line); border-radius: var(--rc); background: var(--bg-2); }
.dd-rule > textarea { margin-bottom: 16px; }
.dd-rule-h { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.dd-rule-n { width: 22px; height: 22px; flex: none; display: grid; place-items: center; border-radius: 50%; font: 600 12px/1 var(--sans); color: var(--dim); background: var(--panel); border: 1px solid var(--line-2); }

/* 明细行（调度页） */
.dd-kv { margin: 0; }
.dd-kv > div { display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.dd-kv > div:first-child { padding-top: 0; }
.dd-kv dt { color: var(--dim); font-size: 13px; line-height: 26px; }
.dd-kv dd { margin: 0; min-width: 0; min-height: 26px; line-height: 26px; word-break: break-all; }

/* ---------- 概览 ---------- */
.dd-steps { list-style: none; margin: 0; padding: 0; counter-reset: ddstep; }
.dd-steps li { position: relative; padding: 0 0 18px 36px; counter-increment: ddstep; }
.dd-steps li:last-child { padding-bottom: 0; }
.dd-steps li::before { content: counter(ddstep); position: absolute; left: 0; top: 0; width: 22px; height: 22px; box-sizing: border-box; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line-2); background: var(--panel); font: 600 12px/1 var(--sans); color: var(--dim); }
.dd-steps li.done::before { content: ""; border-color: var(--ok-line); background: var(--ok-bg); }
.dd-steps li.done::after { content: ""; position: absolute; left: 8px; top: 5px; width: 4px; height: 8px; border: solid var(--ok); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.dd-steps li > b { display: block; font-weight: 600; line-height: 22px; color: var(--text); }
.dd-steps li > span { display: block; margin-top: 2px; font-size: 13px; line-height: 1.65; color: var(--dim); }
.dd-steps em { font-style: normal; color: var(--text-2); }
.dd-steps-v { display: inline-flex; max-width: 100%; margin-top: 8px; padding: 3px 4px 3px 10px; border: 1px solid var(--line); border-radius: var(--rc); background: var(--bg-2); }
.dd-sech { align-items: center; margin: 28px 0 14px; }
.dd-sech a { font-size: 13px; }
.dd-ops { margin-top: 16px; }

/* ---------- HTTPS ---------- */
.dd-cert { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dd-cert > select { flex: 1; min-width: 240px; max-width: 460px; }
.dd-jobs { margin-top: 24px; }
.dd-job + .dd-job { margin-top: 10px; }
.dd-txt { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; }

/* ---------- CC 防护 ---------- */
.dd-order { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; margin-bottom: 18px; padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--rc); background: var(--panel); font-size: 13px; color: var(--dim); }
.dd-order .k { margin-right: 6px; font-weight: 600; color: var(--text); }
.dd-order b { font-weight: 500; color: var(--text); }
.dd-order i { width: 5px; height: 5px; border: solid var(--line-3); border-width: 1.5px 1.5px 0 0; transform: rotate(45deg); }
.dd-order .s { flex-basis: 100%; font-size: 12.5px; color: var(--dim); }
.dd .dd-subtabs { margin: 0 0 18px; }
.dd-subtabs a { cursor: pointer; gap: 8px; }
.dd-subtabs .cnt.ok { background: var(--ok-bg); color: var(--ok-soft); }
.dd-explain { margin-top: 14px; padding: 10px 14px; }
.dd-fold { margin-top: 14px; }
.dd-fold > summary { font-size: 13px; color: var(--accent); }
.dd-levels { margin-top: 10px; border: 1px solid var(--line); border-radius: var(--rc); border-collapse: separate; border-spacing: 0; overflow: hidden; }
.dd .tbl.dd-levels td { padding: 10px 14px; vertical-align: top; }
.dd-levels td b { font-weight: 600; }
.dd-levels tr:last-child td { border-bottom: 0; }
.dd-fold + .dd-opts { margin-top: 18px; }
.dd-explain + .dd-fold + .dd-hint { margin-top: 12px; }

@media (max-width: 860px) {
  .dd-meta { padding-left: 0; gap: 12px 0; } .dd-meta > div { padding-right: 18px; margin-right: 18px; }
  .dd .dd-nav { position: static; display: flex; gap: 2px; overflow-x: auto; padding: 6px; } .dd .dd-nav .grp { display: none; } .dd .dd-nav a { flex: none; white-space: nowrap; }
  .dd-kv > div { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .dd .tbl.dd-edit { min-width: 560px; } .dd .panel-b.tight { overflow-x: auto; }
  .dd-foot { flex-wrap: wrap; }
}

/* ================= 工单 ================= */
.tk .chips { display: flex; flex-wrap: wrap; gap: 8px; }
.tk-c-time { width: 120px; }
.tk-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; margin-bottom: 18px; font-size: 13px; color: var(--dim); }
.tk-chat { display: flex; flex-direction: column; gap: 12px; }
.tk-msg { max-width: 88%; align-self: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); }
.tk-msg.staff { align-self: flex-end; border-color: transparent; background: var(--accent-soft); }
.tk-msg-h { display: flex; align-items: baseline; gap: 10px; margin-bottom: 4px; font-size: 12.5px; color: var(--dim); }
.tk-msg-h b { font-size: 13px; font-weight: 600; color: var(--text); }
.tk-msg-t { white-space: pre-wrap; word-break: break-word; line-height: 1.65; color: var(--text); }
.tk-closed { margin-top: 20px; }

/* ================= DNS 解析 ================= */
.dm-split { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 16px; align-items: start; }
.dm-split > .panel + .panel, .dm-main > .panel { margin-top: 0; }
.dm-main { min-width: 0; }
.dm-acc { display: flex; align-items: center; gap: 10px; padding: 13px 14px 13px 20px; border-bottom: 1px solid var(--line); cursor: pointer; }
.dm-acc:last-child { border-bottom: 0; border-radius: 0 0 var(--r) var(--r); }
.dm-acc:hover { background: var(--row-hover); }
.dm-acc.on { background: var(--accent-soft); box-shadow: inset 2px 0 0 var(--accent); }
.dm-acc-t { flex: 1; min-width: 0; }
.dm-acc-t b { display: block; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-acc.on .dm-acc-t b { color: var(--accent); }
.dm-acc-t span { display: block; margin-top: 2px; font-size: 12.5px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-acc > .btn { opacity: 0; } .dm-acc:hover > .btn, .dm-acc.on > .btn, .dm-acc > .btn:focus-visible { opacity: 1; }
.dm .dm-search .inp { width: 200px; }
.dm-c-type { width: 90px; }
.dm-val { word-break: break-all; color: var(--text-2); }
@media (max-width: 960px) { .dm-split { grid-template-columns: minmax(0, 1fr); } .dm-acc > .btn { opacity: 1; } }

/* 域名概览：状态条 + 横向配置摘要（11-27 改为紧凑布局） */
.dd-statebar-h { display: flex; align-items: center; gap: 14px; padding: 16px 20px; }
.dd-state { display: flex; align-items: center; gap: 14px; min-width: 0; }
.dd-state-dot { width: 10px; height: 10px; margin: 0 5px; flex: none; border-radius: 50%; background: var(--faint); outline: 4px solid var(--panel-2); }
.dd-state-dot.ok { background: var(--ok); outline-color: var(--ok-bg); }
.dd-state-dot.warn { background: var(--warn); outline-color: var(--warn-bg); }
.dd-state-dot.crit { background: var(--crit); outline-color: var(--crit-bg); }
.dd-state-t b { display: block; font-size: 15px; line-height: 1.4; font-weight: 650; color: var(--text); }
.dd-state-t span { display: block; margin-top: 1px; font-size: 13px; color: var(--dim); }
.dd-checks { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.dd-chk { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border: 1px solid var(--line); border-radius: 999px; font-size: 12.5px; color: var(--text-2); white-space: nowrap; }
.dd-chk::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--faint); }
.dd-chk.done::before { background: var(--ok); }
.dd-chk.todo { cursor: pointer; color: var(--warn); border-color: var(--warn-line, var(--line)); }
.dd-chk.todo::before { background: var(--warn); }
.dd-chk.todo:hover { text-decoration: none; background: var(--warn-bg); }
.dd-guide { padding: 18px 20px 20px; border-top: 1px solid var(--line); }
.dd-sum { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin-top: 16px; overflow: hidden; }
.dd-sum > a { position: relative; display: block; padding: 14px 18px 15px; border-right: 1px solid var(--line); color: inherit; cursor: pointer; }
.dd-sum > a:last-child { border-right: 0; }
.dd-sum > a:hover { background: var(--row-hover); text-decoration: none; }
.dd-sum > a::after { content: ""; position: absolute; right: 16px; top: 19px; width: 5px; height: 5px; border: solid var(--faint); border-width: 1.5px 1.5px 0 0; transform: rotate(45deg); opacity: 0; transition: opacity .15s; }
.dd-sum > a:hover::after { opacity: 1; border-color: var(--accent); }
.dd-sum .k { display: block; font-size: 12.5px; color: var(--dim); }
.dd-sum .v { display: block; min-width: 0; margin-top: 6px; }
.dd-sum .v b { display: block; font-size: 15px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-sum .v b small { margin-left: 6px; font-weight: 500; color: var(--dim); }
.dd-sum .v > span { display: block; margin-top: 2px; font-size: 12.5px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 1180px) { .dd-sum { grid-template-columns: repeat(3, minmax(0, 1fr)); } .dd-sum > a { border-bottom: 1px solid var(--line); } }
@media (max-width: 720px) { .dd-statebar-h { flex-wrap: wrap; } .dd-checks { justify-content: flex-start; } .dd-sum { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.dd-brief { margin-top: 16px; }
