/* =========================================================
   液态玻璃 · 单页滚动主题覆盖层
   仅调整外壳与新增组件，保留工具内部既有样式
   ========================================================= */

:root {
  --accent: #4f8cff;
  --accent-soft: rgba(79, 140, 255, 0.12);
  --glass-fill: rgba(255, 255, 255, 0.55);
  --glass-fill-strong: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(255, 255, 255, 0.7);
  --glass-line: rgba(120, 140, 170, 0.16);
  --ink: #16202e;
  --ink-soft: rgba(22, 32, 46, 0.62);
  --liquid-shadow:
    0 18px 50px rgba(60, 90, 140, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.75),
    inset 0 -1px 0 rgba(20, 40, 80, 0.06);
}

/* 背景光斑：鲜亮、柔和漫射，给玻璃提供可折射的彩色光 */
.page-bg {
  z-index: 0;
  background:
    radial-gradient(58% 48% at 18% 12%, rgba(79, 140, 255, 0.20), transparent 62%),
    radial-gradient(52% 46% at 86% 78%, rgba(52, 211, 153, 0.18), transparent 62%),
    radial-gradient(46% 40% at 64% 40%, rgba(251, 191, 36, 0.16), transparent 60%);
}
.orb {
  opacity: 0.9;
  filter: blur(36px) saturate(150%);
  mix-blend-mode: normal;
}
.orb-a { background: radial-gradient(circle at 34% 34%, rgba(255, 255, 255, 0.96), rgba(79, 140, 255, 0.66) 40%, rgba(79, 140, 255, 0.05) 74%); }
.orb-b { background: radial-gradient(circle at 34% 34%, rgba(255, 255, 255, 0.93), rgba(52, 211, 153, 0.58) 40%, rgba(52, 211, 153, 0.04) 74%); }
.orb-c { background: radial-gradient(circle at 34% 34%, rgba(255, 255, 255, 0.95), rgba(251, 191, 36, 0.52) 42%, rgba(251, 191, 36, 0.04) 74%); }

/* 液态玻璃表面：更厚的通透、内高光、细边 */
.glass {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.62), rgba(244, 249, 255, 0.32));
  border: 1px solid var(--glass-border);
  box-shadow: var(--liquid-shadow);
  backdrop-filter: blur(42px) saturate(190%) brightness(1.04);
  -webkit-backdrop-filter: blur(42px) saturate(190%) brightness(1.04);
}
.glass::before {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0) 34%);
  opacity: 0.9;
}

/* 顶栏：吸顶、克制 */
.topbar {
  position: sticky;
  top: 14px;
  z-index: 30;
  border-radius: 22px;
  margin: 0 0 6px;
}
.topbar__copy h1 {
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  font-weight: 800;
}

/* 首页 hero：沉静单栏，居中 */
.screen-view--home { gap: 26px; }
.hero--liquid {
  display: block;
  padding: clamp(38px, 6vw, 76px) clamp(24px, 5vw, 64px);
  text-align: center;
  border-radius: var(--radius-xl);
}
.hero--liquid .hero__content {
  padding: 0;
  max-width: 760px;
  margin: 0 auto;
}
.hero__eyebrow {
  display: inline-block;
  margin: 0 0 14px;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.8rem;
}
.hero__title {
  margin: 0 0 16px;
  font-size: clamp(2.4rem, 5vw, 4rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
  font-weight: 800;
  color: var(--ink);
}
.hero__desc {
  margin: 0 auto;
  max-width: 56ch;
  color: var(--ink-soft);
  font-size: 1.05rem;
  line-height: 1.8;
}
.hero__actions { justify-content: center; }

/* 落地分区 */
.landing-section {
  scroll-margin-top: 96px;
  padding: 10px 4px;
}
#home { scroll-margin-top: 96px; }
.landing-section__head {
  max-width: 760px;
  margin: 0 auto 22px;
  text-align: center;
}
.landing-section__head .eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.78rem;
}
.landing-section__title {
  margin: 0 0 8px;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  letter-spacing: -0.02em;
  color: var(--ink);
}
.landing-section__desc {
  margin: 0;
  color: var(--ink-soft);
}

/* 卡片网格 */
.card-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  max-width: 1120px;
  margin: 0 auto;
}
.card-grid--resources { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }

/* 资源卡片 */
.resource-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  padding: 22px;
  border-radius: var(--radius-lg);
  transition: transform 200ms ease, box-shadow 200ms ease;
}
.resource-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 26px 60px rgba(60, 90, 140, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.75);
}
.resource-card__body { display: flex; gap: 14px; align-items: flex-start; }
.resource-card__index {
  flex: none;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 10px;
  padding: 4px 8px;
  line-height: 1.1;
}
.resource-card__title { margin: 0 0 8px; font-size: 1.15rem; color: var(--ink); letter-spacing: -0.01em; }
.resource-card__desc { margin: 0; color: var(--ink-soft); line-height: 1.7; font-size: 0.95rem; }
.resource-card__extra { margin: 10px 0 0; font-size: 0.82rem; color: rgba(22, 32, 46, 0.5); }
.resource-card__actions { display: flex; }

/* 工具启动卡片 */
.tool-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
  padding: 22px;
  border-radius: var(--radius-lg);
  cursor: pointer;
  font: inherit;
  color: var(--ink);
  border: 1px solid var(--glass-border);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.6), rgba(244, 249, 255, 0.32));
  box-shadow: var(--liquid-shadow);
  backdrop-filter: blur(42px) saturate(190%);
  -webkit-backdrop-filter: blur(42px) saturate(190%);
  transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
}
.tool-card:hover {
  transform: translateY(-3px);
  border-color: rgba(79, 140, 255, 0.5);
  box-shadow: 0 26px 60px rgba(60, 90, 140, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.75);
}
.tool-card__code {
  align-self: flex-start;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 8px;
  padding: 3px 8px;
}
.tool-card__title { font-size: 1.12rem; font-weight: 700; letter-spacing: -0.01em; }
.tool-card__desc { font-size: 0.92rem; color: var(--ink-soft); line-height: 1.6; }
.tool-card__open {
  margin-top: 6px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent);
  display: inline-flex;
  gap: 6px;
  align-items: center;
  transition: gap 200ms ease;
}
.tool-card:hover .tool-card__open { gap: 12px; }

/* 页脚 */
.site-footer {
  text-align: center;
  padding: 22px;
  border-radius: 20px;
  color: var(--ink-soft);
  font-size: 0.88rem;
  margin-top: 8px;
}

/* 按钮：液态质感 */
.button--primary {
  color: #fff;
  background: linear-gradient(135deg, #4f8cff, #38bdf8);
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 14px 30px rgba(56, 140, 248, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
.button--primary:hover {
  box-shadow: 0 18px 38px rgba(56, 140, 248, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}
.button--ghost {
  border: 1px solid rgba(120, 140, 170, 0.22);
  background: rgba(255, 255, 255, 0.5);
  color: var(--ink);
}
.button--ghost:hover {
  border-color: rgba(79, 140, 255, 0.45);
  background: rgba(255, 255, 255, 0.72);
}

/* 工具弹窗 */
.tool-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px;
}
.tool-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(40, 60, 90, 0.28);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: modalBackdropIn 200ms ease both;
}
.tool-modal__panel {
  position: relative;
  width: min(760px, 100%);
  max-height: 90vh;
  margin-top: 4vh;
  border-radius: 28px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalPanelIn 240ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.tool-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--glass-line);
}
.tool-modal__heading .eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.74rem;
}
.tool-modal__title { margin: 0; font-size: 1.25rem; letter-spacing: -0.01em; color: var(--ink); }
.tool-modal__close {
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid var(--glass-line);
  background: rgba(255, 255, 255, 0.6);
  color: var(--ink);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 160ms ease, transform 160ms ease;
}
.tool-modal__close:hover { background: rgba(255, 255, 255, 0.85); transform: rotate(90deg); }
.tool-modal__body { overflow: auto; padding: 22px; }
.tool-modal__body .screen-view { gap: 0; min-height: 0; }

.tool-modal__body::-webkit-scrollbar { width: 8px; }
.tool-modal__body::-webkit-scrollbar-thumb { border-radius: 999px; background: rgba(120, 140, 170, 0.3); }

@keyframes modalBackdropIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalPanelIn {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 640px) {
  .topbar { top: 8px; border-radius: 18px; }
  .tool-modal { padding: 12px; }
  .tool-modal__panel { margin-top: 2vh; border-radius: 22px; }
}


/* ======== 新增按钮 ======== */
.button--add {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent);
  border: 1.5px dashed rgba(79, 140, 255, 0.35);
  background: rgba(79, 140, 255, 0.05);
  border-radius: 14px;
  padding: 7px 16px;
  transition: all 200ms ease;
}
.button--add:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 6px 20px rgba(79, 140, 255, 0.15);
}

.landing-section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  max-width: 1120px;
  margin: 0 auto 22px;
  text-align: left;
}
.landing-section__head > .eyebrow,
.landing-section__head > .landing-section__title,
.landing-section__head > .landing-section__desc {
  width: 100%;
  text-align: center;
}
.landing-section__head .button--add {
  align-self: center;
  margin-top: 4px;
}

/* ======== 评论区 ======== */
.comment-section {
  margin-top: 8px;
  padding: 28px;
  border-radius: var(--radius-xl, 20px);
}
.comment-section__head {
  text-align: center;
  margin-bottom: 22px;
}
.comment-section__title {
  margin: 0 0 6px;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.comment-section__desc {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
}
.comment-form {
  max-width: 640px;
  margin: 0 auto 24px;
}
.comment-form__input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--glass-line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(20px);
  font: inherit;
  font-size: 0.95rem;
  color: var(--ink);
  resize: vertical;
  min-height: 72px;
  transition: border-color 200ms ease, box-shadow 200ms ease;
}
.comment-form__input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.comment-form__actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
  justify-content: flex-end;
}
.comment-form__name {
  flex: 1;
  padding: 9px 14px;
  border: 1px solid var(--glass-line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.5);
  font: inherit;
  font-size: 0.88rem;
  color: var(--ink);
}
.comment-form__name:focus {
  outline: none;
  border-color: var(--accent);
}
.comment-list__empty {
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.92rem;
  padding: 20px;
}

/* ======== 工具卡：使用次数 ======== */
.tool-card__meta {
  margin-top: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.tool-card__usage {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 3px 10px;
  white-space: nowrap;
}

/* 工具卡：内部打开按钮（外层为容器，避免按钮嵌套按钮） */
.tool-card {
  position: relative;
}
.tool-card__btn {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  padding: 0;
  margin: 0;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  color: inherit;
  font: inherit;
}
.tool-card__delete {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: rgba(220, 60, 80, 0.12);
  color: #d83a4a;
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
  transition: background 180ms ease, transform 180ms ease;
}
.tool-card__delete:hover {
  background: rgba(220, 60, 80, 0.22);
  transform: scale(1.08);
}

/* 资源卡：删除按钮间距 */
.resource-card__actions .button--danger {
  margin-left: 10px;
}

/* ======== 评论列表 ======== */
.comment-list {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.comment-item {
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.52);
  border: 1px solid var(--glass-line);
  backdrop-filter: blur(18px);
}
.comment-item__head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.comment-item__name {
  font-weight: 700;
  color: var(--ink);
  font-size: 0.92rem;
}
.comment-item__time {
  font-size: 0.76rem;
  color: var(--ink-soft);
}
.comment-item__delete {
  margin-left: auto;
  border: none;
  background: rgba(220, 60, 80, 0.12);
  color: #d83a4a;
  font-size: 0.76rem;
  padding: 3px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 180ms ease;
}
.comment-item__delete:hover {
  background: rgba(220, 60, 80, 0.22);
}
.comment-item__content {
  margin: 0;
  color: var(--ink);
  line-height: 1.7;
  font-size: 0.94rem;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ======== 新增弹窗表单 ======== */
.add-modal__body { padding: 22px; }
.add-field {
  display: block;
  margin-bottom: 14px;
}
.add-field > span {
  display: block;
  margin-bottom: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-soft);
}
.add-field input {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--glass-line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(20px);
  font: inherit;
  font-size: 0.95rem;
  color: var(--ink);
  transition: border-color 200ms ease, box-shadow 200ms ease;
}
.add-field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* =========================================================
   强化液态玻璃质感（统一表面：更厚的通透、玻璃唇高光、
   底部内阴影、细描边、极淡磨砂颗粒）
   ========================================================= */
.glass,
.resource-card,
.tool-card {
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.84) 0%, rgba(230, 243, 255, 0.46) 42%, rgba(255, 255, 255, 0.32) 100%);
  border: 1.5px solid rgba(255, 255, 255, 0.85);
  border-radius: var(--radius-lg, 24px);
  box-shadow:
    0 26px 70px rgba(58, 92, 142, 0.22),
    0 6px 18px rgba(58, 92, 142, 0.10),
    inset 0 1.5px 0 rgba(255, 255, 255, 0.95),
    inset 0 -2px 6px rgba(90, 130, 180, 0.16),
    inset 0 0 0 1px rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(48px) saturate(220%) brightness(1.06);
  -webkit-backdrop-filter: blur(48px) saturate(220%) brightness(1.06);
}

/* 玻璃唇：左上的镜面高光，制造厚度与反光 */
.glass::before,
.resource-card::before,
.tool-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    radial-gradient(120% 78% at 16% 6%, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0) 46%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0) 32%);
  opacity: 0.92;
  pointer-events: none;
}

/* 磨砂颗粒：极淡的噪声，强化"实体玻璃"质感 */
.glass::after,
.resource-card::after,
.tool-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 140px 140px;
  opacity: 0.05;
  mix-blend-mode: overlay;
  pointer-events: none;
}

.resource-card,
.tool-card {
  position: relative;
  overflow: hidden;
}

/* 悬浮时更明显的光泽位移（仅在支持 hover 的设备） */
@media (hover: hover) {
  .tool-card:hover,
  .resource-card:hover {
    transform: translateY(-4px);
    border-color: rgba(79, 140, 255, 0.6);
    box-shadow:
      0 34px 82px rgba(58, 92, 142, 0.26),
      0 8px 22px rgba(58, 92, 142, 0.12),
      inset 0 1.5px 0 rgba(255, 255, 255, 0.95),
      inset 0 -2px 8px rgba(90, 130, 180, 0.18),
      inset 0 0 0 1px rgba(255, 255, 255, 0.3);
  }
  .tool-card:hover::before,
  .resource-card:hover::before {
    opacity: 1;
  }
}

/* ======== 移动端修复 ======== */
@media (max-width: 900px) {
  .sidebar { padding-top: 86px; }

  .utility-station__grid,
  .utility-station__grid--star-board,
  .console-layout,
  .console-main__metrics,
  .diag-grid,
  .utility-grid {
    grid-template-columns: 1fr !important;
  }
  .utility-station__usage { min-width: 0; }
  .console-main__screen { min-height: 220px; }
  .star-board-table { font-size: 0.68rem; }
}

@media (max-width: 640px) {
  /* 顶栏右侧留出空间，避免与固定角标重叠 */
  .topbar { padding-right: 92px; }
  .corner-badges { top: 12px; right: 12px; gap: 6px; }
  .view-badge,
  .version-badge { padding: 6px 9px; font-size: 0.7rem; }
  .version-badge { display: none; }

  /* 卡片强制单列，避免拥挤与溢出 */
  .card-grid,
  .card-grid--resources,
  .card-grid--tools { grid-template-columns: 1fr; }
  .landing-section { padding: 8px 0; }
  .landing-section__head { margin-bottom: 16px; gap: 8px; }

  /* 弹窗在窄屏更贴边、更紧凑 */
  .tool-modal { padding: 8px; }
  .tool-modal__panel { margin-top: 1.5vh; border-radius: 20px; max-height: 94vh; }
  .tool-modal__head { padding: 14px 16px; }
  .tool-modal__body { padding: 16px; }

  /* 评论区与输入框：字号 16px 防止 iOS 聚焦缩放 */
  .comment-section { padding: 18px 14px; border-radius: 22px; }
  .comment-form__input,
  .comment-form__name { font-size: 16px; }

  .resource-card,
  .tool-card { padding: 18px; }
  .tool-card__delete { top: 8px; right: 8px; }
}
.add-modal__actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 6px;
}

