/* 本站相对 HomeNexus 多出来的那几个类。
 *
 * app.css / tokens.css 是从 HomeNexus 逐字搬来的，不在这里改。它们没有对应的类
 * 只有两种情况：
 *   1. inline 工具的内嵌面板——HomeNexus 的条目没有「就地展开」这种形态
 *   2. 口令页的表单——HomeNexus 的个人主页没有口令这一层
 * 两处都只用到既有的 --p-* 令牌，不新增变量。
 */

/* —— inline 工具：可展开的内嵌面板 ——
   `grid-column` 必须挂在**网格项**上：网格项是外层那个 <li class="entry-card">，
   里面的 <details> 不是。挂在 details 上是一条永远不会生效的声明（内嵌面板
   因此被压在 minmax(260px,1fr) 的一格里，而它是按整行高设计的）。 */
.entry-card-inline {
  grid-column: 1 / -1;
}

.entry-inline {
  display: block;
  width: 100%;
}

.entry-inline-head {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  list-style: none;
}

.entry-inline-head::-webkit-details-marker {
  display: none;
}

.entry-inline-head .entry-name {
  flex: 1 1 auto;
  min-width: 0;
}

.entry-embed {
  display: block;
  width: 100%;
  height: 420px;
  margin-top: 12px;
  border: 1px solid var(--p-border);
  border-radius: var(--p-radius-md);
  background: var(--p-surface);
}

/* —— 口令页的表单 —— */
.auth-form {
  margin: 0;
}

.auth-field {
  display: block;
  margin: 12px 0;
}

.auth-label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  color: var(--p-text-2);
}

.auth-field input {
  width: 100%;
  padding: 10px 14px;
  font: inherit;
  color: var(--p-text);
  background: var(--p-fill);
  border: 1px solid var(--p-border);
  border-radius: var(--p-radius-sm);
}

.auth-field input:focus {
  outline: none;
  border-color: var(--p-accent);
}

.auth-error {
  color: var(--p-accent-2);
}

.auth-submit {
  margin-left: 8px;
}

@media (max-width: 600px) {
  .entry-embed {
    height: 320px;
  }
}

/* —— 顶栏品牌位上的站点图标 —— */
.brand-logo {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  object-fit: cover;
}

/* —— 本站托管工具的外壳页（0.1.20）——
   /tools/{id}/ 渲染站点外壳（顶栏/页脚/主题），裸页在
   /tools/{id}/index.html 由 iframe 嵌进来。**全幅、无框**：顶栏 → 细条 →
   工具（flex 撑满视口剩余高度）→ 页脚，左右与下方都不留白。
   工具自身的底色由工具自己的 HTML 决定——外壳只保证它没有「框」；
   想让工具与站点背景相融，把工具页里自身的背景样式去掉即可（iframe 是透明的）。 */
.tool-main {
  max-width: none;
  padding: 0;
  display: flex;
}

.tool-shell {
  display: flex;
  flex: 1;
  flex-direction: column;
}

.tool-shell-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 16px;
  font-size: 13px;
  border-bottom: 1px solid var(--p-border);
}

.tool-shell-back {
  color: var(--p-text-2);
  text-decoration: none;
}

.tool-shell-back:hover {
  color: var(--p-accent);
}

.tool-shell-name {
  color: var(--p-text-2);
}

.tool-shell-frame {
  display: block;
  flex: 1;
  width: 100%;
  min-height: 420px;
  border: 0;
  background: transparent;
}

/* 手机端按动态视口算高度：100vh 会把地址栏也算进去，页脚会被压到屏幕外一截 */
@supports (height: 100dvh) {
  body:has(.tool-shell) {
    min-height: 100dvh;
  }
}
