/* ===========================================================
   奥萌内部工作台 · 墨石
   左侧深墨侧栏 + 右侧暖白内容区，琥珀色作唯一强调色。
   =========================================================== */

:root {
  /* 侧栏 */
  --ink: #1B1B19;
  --ink-on: #2E2E29;
  --ink-hover: #26261F;
  --ink-line: #302F2A;
  --ink-text: #A8A29E;
  --ink-dim: #6E6A64;
  --ink-bright: #F5F5F0;

  /* 强调色：整站只用一个暖色，不引入第二种彩色 */
  --amber: #D97706;
  --amber-deep: #B45309;
  --amber-soft: #FDF3E3;
  --amber-line: #F2DFC4;

  /* 内容区 */
  --paper: #FAF8F4;
  --card: #FFFFFF;
  --line: #E7E2D9;
  --line-soft: #F0EBE2;
  --text: #1C1B18;
  --text-2: #55504A;
  --muted: #8A857D;

  /* 语义色，都往暖调偏 */
  --ok: #5C7A29;
  --ok-soft: #EFF4E2;
  --warn: #9A6210;
  --warn-soft: #FBF0D9;
  --no: #A03030;
  --no-soft: #FAEDEB;

  --r: 12px;
  --r-sm: 8px;
  --r-lg: 16px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
          "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
p { margin: 0; }

/* ===================== 外壳 ===================== */

.shell { display: flex; min-height: 100vh; }

.side {
  width: 252px;
  flex: 0 0 252px;
  background: var(--ink);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.stage {
  flex: 1;
  min-width: 0;
  background: var(--paper);
}

/* ---------- 品牌 ---------- */

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 16px 16px 15px;
}
.brand-mark {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--amber);
  color: #FFF;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}
.brand-text {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-bright);
  letter-spacing: -.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- 搜索 ---------- */

.side-search {
  position: relative;
  margin: 0 12px 12px;
}
.side-search svg {
  position: absolute;
  left: 9px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: var(--ink-dim);
  pointer-events: none;
}
.side-search input {
  width: 100%;
  height: 31px;
  padding: 0 9px 0 29px;
  border-radius: 7px;
  border: 1px solid var(--ink-line);
  background: #171714;
  color: var(--ink-bright);
  font-family: inherit;
  font-size: 12.5px;
}
.side-search input::placeholder { color: var(--ink-dim); }
.side-search input:focus {
  outline: none;
  border-color: #4A4436;
  background: #1E1E1A;
}

/* ---------- 菜单 ---------- */

.side-nav {
  flex: 1;
  overflow-y: auto;
  padding: 0 8px 12px;
}
.side-nav::-webkit-scrollbar { width: 5px; }
.side-nav::-webkit-scrollbar-thumb { background: #3A3832; border-radius: 3px; }

.nav-group { margin-bottom: 14px; }
.nav-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
  height: 24px;
  font-size: 11px;
  color: var(--ink-dim);
  letter-spacing: .04em;
}
.nav-count {
  font-size: 10.5px;
  color: #57544E;
  font-family: var(--mono);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 8px;
  margin-bottom: 1px;
  border-radius: 7px;
  font-size: 13px;
  color: var(--ink-text);
  position: relative;
  transition: background .12s, color .12s;
}
.nav-item:hover { background: var(--ink-hover); color: #D8D4CE; }
.nav-item.on {
  background: var(--ink-on);
  color: var(--ink-bright);
}
.nav-item.on::before {
  content: "";
  position: absolute;
  left: -8px;
  top: 9px;
  bottom: 9px;
  width: 2px;
  border-radius: 0 2px 2px 0;
  background: var(--amber);
}
.nav-item.off .nav-name { color: #7C7871; }
.nav-item.off:hover .nav-name { color: #A8A29E; }

/* planned：登记了但服务还没部署。不该看着像能点，也不该完全藏起来 */
.nav-item.pending { cursor: default; color: #6B6760; }
.nav-item.pending .nav-name { color: #6B6760; }
.nav-item.pending .nav-dot { background: #4A463F; }
.nav-tip {
  margin-left: auto;
  flex: 0 0 auto;
  font-size: 10px;
  line-height: 1;
  padding: 3px 5px;
  border-radius: 4px;
  border: 1px solid #3A3833;
  color: #8A857C;
  white-space: nowrap;
}

.nav-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #55524C;
  flex: 0 0 auto;
}
.nav-item.on .nav-dot { background: var(--amber); }

.nav-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav-lock {
  width: 12px;
  height: 12px;
  margin-left: auto;
  flex: 0 0 auto;
  color: #5C5952;
}
.nav-empty {
  padding: 10px 8px;
  font-size: 12px;
  color: var(--ink-dim);
}

/* ---------- 侧栏底部 ---------- */

.side-foot {
  border-top: 1px solid var(--ink-line);
  padding: 8px;
}
.side-link {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 8px;
  border-radius: 7px;
  font-size: 13px;
  color: var(--ink-text);
}
.side-link svg { width: 14px; height: 14px; }
.side-link:hover { background: var(--ink-hover); color: #D8D4CE; }
.side-link.on { background: var(--ink-on); color: var(--ink-bright); }

.me {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px 3px;
}
.me-ava {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #35332D;
  color: #D8D4CE;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}
.me-text { min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.me-name {
  font-size: 12.5px;
  color: #D8D4CE;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.me-dept {
  font-size: 11px;
  color: var(--ink-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.me-out {
  margin-left: auto;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-dim);
  flex: 0 0 auto;
}
.me-out svg { width: 14px; height: 14px; }
.me-out:hover { background: var(--ink-hover); color: #D8D4CE; }

/* ===================== 详情页 ===================== */

.detail {
  max-width: 860px;
  padding: 26px 34px 64px;
}

.crumbs {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 10px;
}
.crumbs .sep { color: #C9C3B8; }
.mono { font-family: var(--mono); font-size: 11.5px; }

.detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 10px;
}
.detail-head h1 {
  font-size: 22px;
  line-height: 1.3;
}
.detail-tags {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.detail-purpose {
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--text-2);
  max-width: 640px;
  margin-bottom: 18px;
}

/* ---------- 主按钮 ---------- */

.btn-open {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 16px;
  border-radius: 9px;
  background: var(--amber);
  color: #FFF;
  font-size: 13.5px;
  font-weight: 500;
  flex: 0 0 auto;
  white-space: nowrap;
  transition: background .13s;
}
.btn-open svg { width: 15px; height: 15px; }
.btn-open:hover { background: var(--amber-deep); }
.btn-open.ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  font-weight: 400;
}
.btn-open.locked {
  background: var(--no-soft);
  color: var(--no);
  font-weight: 400;
}
.btn-open.locked svg { width: 14px; height: 14px; }

/* 进程没起来：按钮退成灰的、不可点，省得同事点了以为是自己权限问题 */
.btn-open.offline {
  background: transparent;
  border: 1px dashed var(--line-strong, #D9D3C7);
  color: var(--muted);
  font-weight: 400;
  cursor: not-allowed;
}
.btn-open.offline svg { width: 14.5px; height: 14.5px; }

/* 服务还没部署：比 offline 更"前面一步"，不给点、文案也不同 */
.btn-open.pending {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  font-weight: 400;
  cursor: not-allowed;
}
.btn-open.pending svg { width: 14.5px; height: 14.5px; }

/* ---------- 提示条 ---------- */

.notice {
  background: var(--amber-soft);
  border: 1px solid var(--amber-line);
  border-radius: var(--r);
  padding: 12px 15px;
  font-size: 13px;
  line-height: 1.65;
  color: #6B4410;
  margin-bottom: 18px;
}
.notice strong { color: #4A2E08; }
.notice.soft {
  background: #F3F1EC;
  border-color: var(--line);
  color: var(--text-2);
}
/* 离线提示：中性灰，不跟"没权限"的琥珀、不跟错误红抢注意力 */
.notice.warn {
  background: #F4F2ED;
  border-color: var(--line-strong, #D9D3C7);
  color: #5B5346;
}
.notice.warn strong { color: #3A342B; }

/* ---------- 双栏信息 ---------- */

.panels {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 14px;
}

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 16px 18px;
}
.panel h2 {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: .04em;
  margin-bottom: 12px;
}
.panel .count {
  font-family: var(--mono);
  font-size: 11px;
  color: #B5AFA4;
  margin-left: 4px;
}

.facts { margin: 0; }
.facts > div {
  display: flex;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px dashed var(--line-soft);
  font-size: 13px;
}
.facts > div:last-child { border-bottom: none; }
.facts dt {
  flex: 0 0 76px;
  color: var(--muted);
  font-size: 12.5px;
}
.facts dd { margin: 0; color: var(--text); min-width: 0; }
.ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- 权限 ---------- */

.perm-state {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  margin-bottom: 12px;
}
.perm-state svg { width: 16px; height: 16px; }
.perm-state.ok { color: var(--ok); }
.perm-state.no { color: var(--no); }

.grant-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 10px; }
.grant-tag {
  padding: 3px 8px;
  border-radius: 6px;
  background: #F5F2EC;
  color: var(--text-2);
  font-size: 12px;
}
.hint {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.65;
}

/* ---------- 同组应用 ---------- */

.siblings { margin-top: 22px; }
.siblings h2 {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: .04em;
  margin-bottom: 10px;
}
.sib-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 9px;
}
.sib {
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 13px;
  transition: border-color .13s, transform .13s;
}
.sib:hover { border-color: #D6CDBC; transform: translateY(-1px); }
.sib-title {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}
.sib-title strong {
  font-size: 13px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sib p {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.5;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ===================== 搜索结果 ===================== */

.results { max-width: 860px; padding: 26px 34px 64px; }

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}
.page-head h1 { font-size: 20px; }
.page-head .sub {
  font-size: 13px;
  color: var(--muted);
  margin-top: 5px;
  line-height: 1.6;
}

.result-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.result {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 13px 16px;
  transition: border-color .13s, transform .13s;
}
.result:hover { border-color: #D6CDBC; transform: translateX(2px); }
.result-main { min-width: 0; flex: 1; }
.result-title {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.result-title strong { font-size: 14px; font-weight: 600; }
.result-main p {
  font-size: 12.5px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.result-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  font-size: 12px;
  color: var(--muted);
  flex: 0 0 auto;
}
.result.off { background: #FCFBF8; }
.result.off .result-title strong { color: var(--text-2); }

/* ===================== 小部件 ===================== */

.tag {
  padding: 1px 7px;
  border-radius: 5px;
  background: #F3F0E9;
  color: #79736A;
  font-size: 11.5px;
  line-height: 17px;
}

.app-no {
  padding: 0 5px;
  border-radius: 4px;
  background: #FFF;
  border: 1px solid var(--line);
  color: #6B655C;
  font-family: var(--mono);
  font-size: 10.8px;
  line-height: 16px;
  white-space: nowrap;
}

.emp {
  padding: 1px 6px;
  margin-left: 3px;
  border-radius: 5px;
  background: var(--ok-soft);
  color: var(--ok);
  font-size: 11.5px;
}
.warn {
  padding: 1px 6px;
  margin-left: 3px;
  border-radius: 5px;
  background: var(--warn-soft);
  color: var(--warn);
  font-size: 11.5px;
}

.badge-lock {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 5px;
  background: #F2EFE9;
  color: #8A847A;
  font-size: 11px;
}

.chip {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 500;
  background: #F3F0E9;
  color: #79736A;
}
.chip-web { background: var(--amber-soft); color: var(--amber-deep); }
.chip-task { background: var(--ok-soft); color: var(--ok); }

.banner {
  background: var(--amber-soft);
  border: 1px solid var(--amber-line);
  color: #6B4410;
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 14px;
  font-size: 13px;
}

.muted { color: var(--muted); }
.ok-text { color: var(--ok); }
.no-text { color: var(--no); }

/* ===================== 按钮 ===================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #FFF;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: .13s;
}
.btn:hover { border-color: #D6CDBC; background: #FCFAF6; }
.btn-primary {
  background: var(--amber);
  border-color: var(--amber);
  color: #FFF;
}
.btn-primary:hover { background: var(--amber-deep); border-color: var(--amber-deep); }
.btn-block { width: 100%; height: 38px; font-size: 14px; }
.btn-sm { height: 30px; padding: 0 11px; font-size: 12.5px; }

/* ===================== 管理后台 ===================== */

.admin { max-width: 1080px; padding: 26px 34px 64px; }

.cards { display: flex; flex-direction: column; gap: 10px; margin-bottom: 22px; }

.app-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 12px 14px;
}
.app-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.app-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.app-card-title strong { font-size: 14px; }
.app-card-owner {
  font-size: 12.5px;
  color: var(--text-2);
  display: flex;
  align-items: center;
  gap: 4px;
}
.owner-label {
  color: var(--muted);
  font-size: 11.5px;
}

.grant-list {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 10px;
}
.grant-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: var(--amber-soft);
  color: #7A4E12;
  padding: 2px 6px 2px 9px;
  border-radius: 6px;
  font-size: 12px;
}
.inline { display: inline; margin: 0; }
.x {
  border: none;
  background: none;
  color: #B08447;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0 2px;
}
.x:hover { color: var(--no); }

.grant-form { display: flex; gap: 7px; flex-wrap: wrap; }
.grant-form select,
.grant-form input {
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 12.5px;
  font-family: inherit;
  background: #FFF;
  color: var(--text);
}
.grant-form input { min-width: 200px; }
.grant-form select:focus,
.grant-form input:focus { outline: none; border-color: var(--amber); }

.admin .panel { margin-bottom: 14px; }

.tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.tbl th {
  text-align: left;
  font-weight: 500;
  color: var(--muted);
  font-size: 11.5px;
  padding: 5px 10px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.tbl td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
}
.tbl tr:last-child td { border-bottom: none; }

/* ===================== 登录 / 独立页 ===================== */

.bare { min-height: 100vh; background: var(--paper); }

.login-wrap {
  display: flex;
  justify-content: center;
  padding: 90px 20px 80px;
}
.login-card {
  width: 100%;
  max-width: 356px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 30px 28px 24px;
}
.login-head { text-align: center; margin-bottom: 22px; }
.brand-mark-lg {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  font-size: 19px;
  margin: 0 auto 12px;
}
.login-head h1 { font-size: 18px; margin-bottom: 5px; }
.login-head .sub { font-size: 12.5px; color: var(--muted); }

.form { display: flex; flex-direction: column; gap: 13px; }
.form label { display: flex; flex-direction: column; gap: 5px; }
.form label span { font-size: 12.5px; color: var(--text-2); }
.form input {
  height: 36px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 14px;
  font-family: inherit;
  background: #FFF;
  color: var(--text);
}
.form input:focus { outline: none; border-color: var(--amber); }
.form .btn { margin-top: 4px; }

.alert {
  background: var(--no-soft);
  border: 1px solid #F0D6D3;
  color: var(--no);
  border-radius: 8px;
  padding: 8px 11px;
  font-size: 12.5px;
  margin-bottom: 14px;
}
.login-card .hint { margin-top: 14px; text-align: center; }

.notice-wrap {
  display: flex;
  justify-content: center;
  padding: 110px 20px;
}
.notice-card {
  width: 100%;
  max-width: 400px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 30px 28px;
  text-align: center;
}
.notice-icon {
  width: 40px;
  height: 40px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: #F3F0E9;
  color: #8A847A;
  display: flex;
  align-items: center;
  justify-content: center;
}
.notice-icon svg { width: 20px; height: 20px; }
.notice-card h1 { font-size: 16px; margin-bottom: 8px; }
.notice-card .sub {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 18px;
}

/* ===================== 空状态 ===================== */

.empty-state {
  padding: 110px 34px;
  text-align: center;
}
.empty-mark {
  width: 42px;
  height: 42px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: #F1EDE5;
  color: #A39B8E;
  display: flex;
  align-items: center;
  justify-content: center;
}
.empty-mark svg { width: 22px; height: 22px; }
.empty-state h1 { font-size: 17px; margin-bottom: 7px; }
.empty-state .sub {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 18px;
}

/* ===================== 窄屏 ===================== */

@media (max-width: 900px) {
  .shell { flex-direction: column; }
  .side {
    position: static;
    width: 100%;
    flex: none;
    height: auto;
    max-height: 52vh;
  }
  .side-nav { overflow-y: auto; }
  .detail, .results, .admin { padding: 20px 18px 48px; }
  .panels { grid-template-columns: minmax(0, 1fr); }
  .detail-head { flex-direction: column; gap: 12px; }
  .page-head { flex-direction: column; gap: 12px; }
}
