/* 快捷排查 */
.guide-trail { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1rem; }
.guide-chip {
  display: inline-flex; align-items: center; gap: 0.25rem; border: 1px solid var(--md-sys-color-outline-variant);
  background: var(--md-sys-color-surface); color: var(--md-sys-color-on-surface-variant);
  border-radius: 0.5rem; padding: 0.2rem 0.6rem 0.2rem 0.4rem; font-size: 0.85rem; cursor: pointer;
}
.guide-chip:hover { background: var(--md-sys-color-surface-container); }
.guide-chip .material-icons { font-size: 1rem; color: var(--md-sys-color-primary); }
.guide-question { font-size: 1.1rem; font-weight: 600; margin-bottom: 0.75rem; }
.guide-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0.5rem; }
.guide-option {
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; text-align: left;
  padding: 0.8rem 0.75rem 0.8rem 1rem; border-radius: 0.75rem; border: 1px solid var(--md-sys-color-outline-variant);
  background: var(--md-sys-color-surface); color: var(--md-sys-color-on-surface); font-size: 0.95rem; cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.guide-option:hover { background: var(--md-sys-color-secondary-container); border-color: var(--md-sys-color-primary); }
.guide-option .material-icons { color: var(--md-sys-color-primary); font-size: 1.2rem; }
.guide-note {
  padding: 0.75rem 1rem; border-radius: 0.75rem; margin-bottom: 1rem;
  background: var(--md-custom-warning-container, #fff4d6); color: var(--md-custom-on-warning-container, #3d2e00);
}
.guide-note p:last-child { margin-bottom: 0; }
.guide-result { border: 1.5px solid var(--md-sys-color-primary); border-radius: 0.75rem; padding: 0.9rem 1.1rem 0.3rem; }
.guide-result-title { display: flex; align-items: center; gap: 0.4rem; font-weight: 600; font-size: 1.05rem; margin-bottom: 0.6rem; }
.guide-result-title .material-icons { color: var(--md-sys-color-primary); }
.guide-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-top: 1rem; }

/* QQ 群 */
.qq-group { display: flex; gap: 0.9rem; align-items: center; }
.qq-qr {
  width: 96px; height: 96px; object-fit: contain; border-radius: 0.6rem; flex-shrink: 0;
  border: 1px solid var(--md-sys-color-outline-variant); cursor: zoom-in; background: #fff;
}
.qq-info { display: flex; flex-direction: column; align-items: flex-start; gap: 0.2rem; min-width: 0; }
.qq-name { font-weight: 600; }
.qq-number {
  display: inline-flex; align-items: center; gap: 0.3rem; border: 0; background: none; padding: 0;
  color: var(--md-sys-color-on-surface-variant); font-size: 0.88rem; cursor: pointer; font-variant-numeric: tabular-nums;
}
.qq-number .material-icons { font-size: 0.95rem; }
.qq-number.copied { color: var(--md-custom-success, #1b6d2f); }
.qq-number.copied::after { content: '已复制'; }

/* 快捷排查后台：左边大纲树/交互流程图，右边内联编辑 */
.guide-editor { display: grid; grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.guide-editor.is-flow { grid-template-columns: minmax(0, 1.3fr) minmax(340px, 1fr); }
.guide-editor.is-flow-wide { grid-template-columns: minmax(0, 1fr); }
.guide-editor.is-flow-wide .guide-editor-main { display: none; }
.guide-editor-tree, .guide-flow-wrap { position: sticky; top: 8.5rem; max-height: calc(100vh - 9.5rem); display: flex; flex-direction: column; }
.guide-editor-tree .m3-card-header md-text-button { --md-text-button-label-text-size: 0.8rem; }
@media (max-width: 1199.98px) { .guide-editor.is-flow { grid-template-columns: minmax(0, 1fr); } .guide-flow-wrap { position: static; max-height: 28rem; } }
@media (max-width: 991.98px) { .guide-editor { grid-template-columns: minmax(0, 1fr); } .guide-editor-tree { position: static; max-height: 22rem; } }
.guide-editor.is-flow-wide .guide-flow-wrap { position: static; max-height: none; }
.gtree, .gtree ul { list-style: none; margin: 0; padding: 0; }
.gtree { position: relative; overflow-y: auto; padding: 0.4rem 0.5rem 0.6rem; scrollbar-width: thin; flex: 1; }
.gtree ul { margin-left: 0.85rem; padding-left: 0.4rem; border-left: 1px solid var(--md-sys-color-outline-variant); }
.gtree summary { list-style: none; display: flex; align-items: center; cursor: pointer; }
.gtree summary::-webkit-details-marker { display: none; }
.gtree summary::before {   /* 展开 / 收起的小箭头；点箭头收起，点文字选中 */
  content: ""; flex-shrink: 0; width: 1rem; height: 1rem; margin-right: 0.1rem;
  background: currentColor; color: var(--md-sys-color-on-surface-variant);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M10 6 8.6 7.4 13.2 12l-4.6 4.6L10 18l6-6z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M10 6 8.6 7.4 13.2 12l-4.6 4.6L10 18l6-6z'/%3E%3C/svg%3E") center / contain no-repeat;
  transition: transform 0.12s;
}
.gtree details[open] > summary::before { transform: rotate(90deg); }
.gtree li > .gtree-item { margin-left: 1.1rem; }
.gtree-item { display: flex; align-items: center; flex: 1; min-width: 0; gap: 0.15rem; }
.gtree-row {
  display: flex; align-items: center; gap: 0.4rem; flex: 1; min-width: 0; padding: 0.3rem 0.45rem; border-radius: 0.5rem;
  color: var(--md-sys-color-on-surface); text-decoration: none; font-size: 0.88rem; border: 1.5px solid transparent;
}
.gtree-row:hover { background: var(--md-sys-color-surface-container-low); }
.gtree-row.selected { background: var(--md-sys-color-secondary-container); font-weight: 600; }
.gtree-row.search-hit { background: var(--md-custom-warning-container, #fff4d6); }
.gtree-row.issue .gtree-icon { color: var(--md-sys-color-error); }
.gtree-row.drag-over { border-color: var(--md-sys-color-primary); background: var(--md-sys-color-primary-container); }
.gtree-row.drag-before { border-top-color: var(--md-sys-color-primary); }
.gtree-row.drag-after { border-bottom-color: var(--md-sys-color-primary); }
.gtree-icon { font-size: 1.05rem; color: var(--md-sys-color-primary); flex-shrink: 0; }
.gtree-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.gtree-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gtree-sub { font-size: 0.72rem; color: var(--md-sys-color-on-surface-variant); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 400; }
.gtree-add-btn {
  opacity: 0; border: 0; background: none; padding: 0.2rem; border-radius: 999px; cursor: pointer; flex-shrink: 0;
  color: var(--md-sys-color-on-surface-variant); display: inline-flex; align-items: center; transition: opacity 0.12s, background 0.12s;
}
.gtree-item:hover .gtree-add-btn, .gtree-item:focus-within .gtree-add-btn { opacity: 1; }
@media (hover: none) { .gtree-add-btn { opacity: 0.75; } }
.gtree-add-btn:hover { background: var(--md-sys-color-surface-container); color: var(--md-sys-color-primary); }
.gtree-add-btn .material-icons { font-size: 1rem; }
.gtree-search-wrap {
  display: flex; align-items: center; gap: 0.35rem; margin: 0.5rem 0.75rem 0.25rem; padding: 0.25rem 0.65rem;
  border-radius: 999px; background: var(--md-sys-color-surface-container-low); border: 1px solid var(--md-sys-color-outline-variant);
}
.gtree-search-wrap .material-icons { font-size: 1rem; color: var(--md-sys-color-on-surface-variant); }
.gtree-search { border: 0; outline: 0; background: transparent; flex: 1; min-width: 0; font-size: 0.85rem; color: var(--md-sys-color-on-surface); }
.drag-handle { cursor: grab; color: var(--md-sys-color-on-surface-variant); font-size: 1.15rem; flex-shrink: 0; user-select: none; }
.dragging { opacity: 0.45; }
.link-btn { border: 0; background: none; padding: 0; color: var(--md-sys-color-primary); cursor: pointer; font: inherit; }
.link-btn:hover { text-decoration: underline; }
.guide-child-meta { max-width: 7.5rem; flex-shrink: 1; }
@media (max-width: 575.98px) {
  .guide-child-meta, [data-move-child] { display: none; }
  .guide-child { gap: 0.15rem; padding: 0.2rem 0.1rem; }
}
.guide-ref-link { display: inline-flex; align-items: center; gap: 0.25rem; text-decoration: none; font-size: 0.85rem; }
.gtree-stat {
  margin-left: auto; flex-shrink: 0; font-size: 0.7rem; line-height: 1.2rem; padding: 0 0.45rem; border-radius: 0.6rem;
  background: var(--md-sys-color-surface-container-high); color: var(--md-sys-color-on-surface-variant); font-weight: 500;
}
.gtree-issues { margin: 0.5rem 0.75rem 0; padding: 0.5rem 0.75rem; border-radius: 0.6rem; font-size: 0.82rem;
  background: var(--md-sys-color-error-container, #fde7e7); color: var(--md-sys-color-on-error-container, #410e0b); }
.gtree-issues summary { cursor: pointer; display: flex; align-items: center; gap: 0.35rem; font-weight: 500; }
.gtree-issues summary .material-icons { font-size: 1.05rem; }
.gtree-issues ul { margin: 0.4rem 0 0; padding-left: 1.1rem; }
.gtree-issues a { color: inherit; font-weight: 600; }
.gtree-legend { display: flex; flex-wrap: wrap; gap: 0.25rem 0.8rem; padding: 0.6rem 1rem 0.8rem;
  border-top: 1px solid var(--md-sys-color-surface-container); }
.gtree-legend > span { display: inline-flex; align-items: center; gap: 0.2rem; }
.gtree-legend .material-icons { font-size: 0.95rem; color: var(--md-sys-color-primary); }
.gtree-legend .gtree-stat { margin-left: 0; }
.guide-crumbs-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; }
.guide-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 0.1rem 0.25rem; font-size: 0.88rem; }
.guide-crumbs .material-icons { font-size: 1rem; color: var(--md-sys-color-on-surface-variant); }
.guide-crumbs a { text-decoration: none; }
.guide-children-panel { padding: 0.75rem; border-radius: 0.75rem; background: var(--md-sys-color-surface-container-low); border: 1px solid var(--md-sys-color-outline-variant); }
.guide-child { display: flex; align-items: center; gap: 0.35rem; padding: 0.25rem 0.35rem; }
.guide-children-box md-icon-button { width: 30px; height: 30px; flex-shrink: 0; --md-icon-button-state-layer-width: 30px; --md-icon-button-state-layer-height: 30px; --md-icon-button-icon-size: 18px; }
.guide-child-inline-input { flex: 2 1 8rem; min-width: 5rem; border: 1px solid transparent; border-radius: 0.4rem; background: transparent; padding: 0.25rem 0.45rem; font: inherit; color: var(--md-sys-color-on-surface); }
.guide-child-inline-input:hover, .guide-child-inline-input:focus { outline: 0; border-color: var(--md-sys-color-primary); background: var(--md-sys-color-surface); }
.guide-child-add-inline { display: flex; gap: 0.5rem; align-items: center; padding-top: 0.25rem; }
.guide-child-input { flex: 1; min-width: 0; padding: 0.45rem 0.75rem; border-radius: 0.5rem; border: 1px solid var(--md-sys-color-outline-variant); background: var(--md-sys-color-surface); font: inherit; font-size: 0.92rem; color: var(--md-sys-color-on-surface); }
.guide-child-input:focus { outline: 0; border-color: var(--md-sys-color-primary); }
.guide-preview { background: var(--md-sys-color-surface-container-lowest); }
.guide-preview .guide-option { text-decoration: none; color: inherit; }

/* 帮助页：搜索、条目操作、深链接高亮 */
.faq-search {
  display: flex; align-items: center; gap: 0.5rem; padding: 0 1rem; height: 48px; border-radius: 24px;
  background: var(--md-sys-color-surface-container-lowest); box-shadow: var(--md-elevation-1);
}
.faq-search .material-icons { color: var(--md-sys-color-on-surface-variant); }
.faq-search input {
  flex: 1; border: 0; outline: 0; background: transparent; font-size: 1rem; color: var(--md-sys-color-on-surface);
}
.faq-actions { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; margin-top: 0.5rem; font-size: 0.88rem; }
.faq-actions a, .faq-actions button {
  display: inline-flex; align-items: center; gap: 0.25rem; border: 0; background: none; padding: 0;
  color: var(--md-sys-color-primary); text-decoration: none; cursor: pointer;
}
.faq-actions a:hover, .faq-actions button:hover { text-decoration: underline; }
.faq-actions .material-icons { font-size: 1.05rem; }
.faq-actions .copied { color: var(--md-custom-success, #1b6d2f); }
.faq-item { scroll-margin-top: 5rem; transition: box-shadow 0.3s; }
.faq-item.faq-flash { box-shadow: 0 0 0 3px var(--md-sys-color-primary); }

/* 提交工单页：排查步骤与来源 */
.guide-skip { margin-top: 1.25rem; padding-top: 0.75rem; border-top: 1px dashed var(--md-sys-color-outline-variant); text-align: right; }
.guide-skip a { display: inline-flex; align-items: center; gap: 0.25rem; color: var(--md-sys-color-on-surface-variant); text-decoration: none; font-size: 0.9rem; }
.guide-skip a:hover { color: var(--md-sys-color-primary); }
.guide-skip .material-icons { font-size: 1rem; }
.help-origin, .help-trail {
  display: flex; gap: 0.6rem; align-items: flex-start; padding: 0.75rem 1rem; border-radius: 0.75rem;
  background: var(--md-sys-color-surface-container-low); font-size: 0.92rem;
}
.help-origin > .material-icons, .help-trail > .material-icons { color: var(--md-sys-color-primary); margin-top: 0.1rem; }
.help-origin-text { font-weight: 500; }
.guide-incident-panel {
  margin-bottom: .85rem;
  padding: .85rem 1rem;
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: .8rem;
  background: var(--md-sys-color-surface-container-low);
}
.guide-incident-panel h3 { margin: 0 0 .65rem; font-size: 1rem; }
.inline-incident-notice + .inline-incident-notice { margin-top: .65rem; padding-top: .65rem; border-top: 1px solid var(--md-sys-color-outline-variant); }
.inline-incident-title { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .55rem; margin-bottom: .3rem; overflow-wrap: anywhere; }
.inline-incident-body { margin: .55rem 0 .15rem; overflow-wrap: anywhere; }
.inline-incident-body > :last-child { margin-bottom: 0; }
/* 常用网址与电话（帮助页侧栏、首页）：表格紧凑排列 */
#contacts { scroll-margin-top: 5rem; }
.help-side .md-table table { font-size: 0.85rem; }
.help-side .md-table th, .help-side .md-table td { padding: 0.4rem 0.6rem; }
.help-side .md-table { margin-bottom: 0.75rem; }
/* 三列及以上的表（如电话表）首列不折行；两列的网址表让说明列折行，地址完整显示 */
@media (min-width: 992px) {
  .help-side .md-table td:first-child:not(:nth-last-child(2)) { white-space: nowrap; }
  .help-side .md-table td:first-child:nth-last-child(2) + td { white-space: nowrap; }
}
/* QQ 群卡片：其他校区的群缩小二维码、过多时内部滚动 */
.qq-others-list { display: flex; flex-direction: column; gap: 0.75rem; margin-top: 0.5rem; max-height: 22rem; overflow-y: auto; }
.qq-others-list .qq-qr { width: 64px; height: 64px; }

/* 我的值班：权限标签、数据卡片（主要数字等宽排满 + 一行次要数据）、设置 */
.staff-caps { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.5rem; margin: -0.25rem 0 1rem; }
.staff-cap { font-size: 0.78rem; padding: 0.1rem 0.6rem; border-radius: 1rem; cursor: default;
  background: var(--md-sys-color-surface-container-high); color: var(--md-sys-color-on-surface-variant); }
.staff-cap.granted { background: var(--md-sys-color-secondary-container); color: var(--md-sys-color-on-secondary-container); }
.staff-cap.granted::after { content: " ·单独"; font-size: 0.7rem; opacity: 0.75; }
.staff-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.staff-kpi { display: block; padding: 1.1rem 0.75rem 0.9rem; text-align: center; color: inherit; text-decoration: none; }
.staff-kpi + .staff-kpi { border-left: 1px solid var(--md-sys-color-surface-container); }
a.staff-kpi:hover { background: var(--md-sys-color-surface-container-low); }
.staff-kpi .num { font-size: 1.7rem; font-weight: 600; color: var(--md-sys-color-primary); line-height: 1.2; }
.staff-kpi .label { font-size: 0.8rem; color: var(--md-sys-color-on-surface-variant); margin-top: 0.2rem; }
.staff-kpi .unit, .staff-more .unit { font-size: 0.75rem; font-weight: 400; margin-left: 0.15rem; color: var(--md-sys-color-on-surface-variant); }
.staff-more { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.3rem 1.5rem; padding: 0.6rem 1rem;
  border-top: 1px solid var(--md-sys-color-surface-container); font-size: 0.82rem; color: var(--md-sys-color-on-surface-variant); }
.staff-more strong { color: var(--md-sys-color-on-surface); font-weight: 600; }
@media (max-width: 575.98px) {
  .staff-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .staff-kpi:nth-child(3) { border-left: 0; }
  .staff-kpi:nth-child(n+3) { border-top: 1px solid var(--md-sys-color-surface-container); }
  .staff-more { justify-content: flex-start; }
}
/* 展开后的内容与标题行拉开距离（第一个输入框的浮动标签不贴着标题） */
.staff-settings .fold-body { padding-top: 0.9rem; }
.staff-stars { color: #e0a100; letter-spacing: 1px; font-size: 0.9rem; }

/* 用户编辑弹窗：单独授权的权限点 */
.perm-grants { border: 1px solid var(--md-sys-color-outline-variant); border-radius: 0.75rem; padding: 0.5rem 1rem 0.75rem;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: 0.4rem 1rem; }
.perm-grants.disabled { opacity: 0.55; }
.perm-default-tag { display: none; margin-left: 0.35rem; font-size: 0.7rem; padding: 0 0.4rem; border-radius: 0.5rem;
  background: var(--md-sys-color-surface-container-high); color: var(--md-sys-color-on-surface-variant); vertical-align: 0.1em; }
.perm-grants label.is-default .perm-default-tag { display: inline; }
.perm-grants legend { float: none; width: auto; font-size: 0.9rem; font-weight: 500; padding: 0 0.35rem; margin: 0; grid-column: 1 / -1; }

/* 重复提示框是琥珀色底，"待确认"标签同色看不出，改成白底 */
.dup-hint .m3-badge.pending_confirm { background: var(--md-sys-color-surface-container-lowest); }

/* 单张图片选择（如 QQ 群二维码）：左边缩略图 / 占位，右边按钮与说明 */
.image-pick { display: flex; align-items: center; gap: 1rem; }
.image-pick-tile {
  width: 96px; height: 96px; flex-shrink: 0; border-radius: 0.6rem; overflow: hidden; background: #fff;
  border: 1px dashed var(--md-sys-color-outline-variant); display: flex; align-items: center; justify-content: center;
  color: var(--md-sys-color-outline);
}
.image-pick-tile.has-image { border-style: solid; }
.image-pick-tile img { width: 100%; height: 100%; object-fit: contain; cursor: zoom-in; }
.image-pick-tile .material-icons { font-size: 2.5rem; }
.image-pick-name { display: block; margin-top: 0.35rem; }


/* 帮助条目反馈 */
.faq-feedback { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.6rem; margin-top: 0.75rem; font-size: 0.88rem; }
.faq-feedback button {
  display: inline-flex; align-items: center; gap: 0.25rem; padding: 0.2rem 0.7rem; border-radius: 999px;
  border: 1px solid var(--md-sys-color-outline-variant); background: var(--md-sys-color-surface);
  color: var(--md-sys-color-on-surface-variant); cursor: pointer;
}
.faq-feedback button:hover { background: var(--md-sys-color-secondary-container); color: var(--md-sys-color-on-secondary-container); }
.faq-feedback .material-icons { font-size: 1rem; }
.faq-feedback input {
  flex: 1 1 14rem; min-width: 0; padding: 0.3rem 0.7rem; border-radius: 0.5rem;
  border: 1px solid var(--md-sys-color-outline-variant); background: var(--md-sys-color-surface); color: var(--md-sys-color-on-surface);
}
.faq-feedback-done { display: inline-flex; align-items: center; gap: 0.3rem; color: var(--md-custom-success, #1b6d2f); }
.guide-result .faq-feedback { margin: 0.25rem 0 0.75rem; }
.fb-counts { display: inline-flex; align-items: center; gap: 0.2rem; color: var(--md-sys-color-on-surface-variant); }
.fb-counts .material-icons { font-size: 0.9rem; margin-left: 0.4rem; }
.faq-comments { display: flex; flex-wrap: wrap; gap: 0.25rem 0.75rem; }
.faq-comment { background: var(--md-sys-color-surface-container-low); border-radius: 0.4rem; padding: 0.05rem 0.4rem; }

/* 工单文字里的链接与帮助条目卡片 */
.chat-bubble a, .help-trail a, .internal-note a { word-break: break-all; }
a.help-chip {
  display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.15rem 0.7rem 0.15rem 0.5rem; margin: 0.1rem 0;
  border-radius: 0.6rem; background: var(--md-sys-color-secondary-container); color: var(--md-sys-color-on-secondary-container);
  text-decoration: none; font-weight: 500; word-break: normal; white-space: normal;
}
a.help-chip:hover { filter: brightness(0.96); }
a.help-chip .material-icons { font-size: 1.05rem; }
.help-picker-search {
  width: 100%; padding: 0.5rem 0.8rem; margin-bottom: 0.5rem; border-radius: 0.6rem;
  border: 1px solid var(--md-sys-color-outline-variant); background: var(--md-sys-color-surface); color: var(--md-sys-color-on-surface);
}
