/* ===================== 页面背景 ===================== */

body {
  margin: 0;
  padding: 0;
  background: url("media/vista.jpg") no-repeat center center fixed;
  background-size: cover;
  font-family: Segoe UI, sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
}

/* ===================== 基础窗体 ===================== */

.aero-window {
  position: relative;
  width: 1024px;
  height: 620px;  /* 初始高度，只能靠右下角手柄改 */

  padding: 0 12px 12px;
  background: rgba(255, 255, 255, 0.10);
  backdrop-filter: blur(22px) saturate(1.6);
  -webkit-backdrop-filter: blur(22px) saturate(1.6);
  border-radius: 10px;
  box-shadow:
    0 20px 45px rgba(0, 0, 0, 0.70),
    inset 0 0 0 1px rgba(0, 0, 0, 0.70),
    inset 0 0 0 2px rgba(30, 30, 30, 0.60),
    inset 0 0 0 3px rgba(40, 40, 40, 0.50),
    inset 0 0 0 5px rgba(90, 90, 90, 0.40);
  display: flex;
  flex-direction: column;
  transform-origin: center center;
  transform: translate(var(--tx, 0px), var(--ty, 0px));
}

/* 果冻抖动：最大化按钮用的动画 */

.aero-window.max-bounce {
  animation: aero-max-bounce 2s cubic-bezier(.26,1.8,.3,1);
}

@keyframes aero-max-bounce {
  0% {
    transform: translate(var(--tx,0px), var(--ty,0px))
               scale(1, 1) rotate(0deg);
  }
  48% {
    transform: translate(var(--tx,0px), var(--ty,0px))
               scale(1.18, 0.80) rotate(-1.5deg);
  }
  63% {
    transform: translate(var(--tx,0px), var(--ty,0px))
               scale(0.88, 1.20) rotate(1.2deg);
  }
  78% {
    transform: translate(var(--tx,0px), var(--ty,0px))
               scale(1.08, 0.94) rotate(-0.8deg);
  }
  82% {
    transform: translate(var(--tx,0px), var(--ty,0px))
               scale(0.96, 1.08) rotate(0.5deg);
  }
  88% {
    transform: translate(var(--tx,0px), var(--ty,0px))
               scale(1.03, 0.98) rotate(-0.3deg);
  }
  92% {
    transform: translate(var(--tx,0px), var(--ty,0px))
               scale(0.98, 1.04) rotate(0.1deg);
  }
  95% {
    transform: translate(var(--tx,0px), var(--ty,0px))
               scale(1.01, 0.94) rotate(-0.1deg);
  }
  98% {
    transform: translate(var(--tx,0px), var(--ty,0px))
               scale(0.99, 1.01) rotate(0.1deg);
  }
  100% {
    transform: translate(var(--tx,0px), var(--ty,0px))
               scale(1, 1) rotate(0deg);
  }
}

/* 顶部/右侧内发光 */

.aero-window::before {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 10px;
  pointer-events: none;
  z-index: -1;
  background:
    linear-gradient(
      to bottom,
      rgba(255, 255, 255, 0.85),
      rgba(255, 255, 255, 0)
    ) center 0px / 100% 5px no-repeat,
    linear-gradient(
      to left,
      rgba(255, 255, 255, 0.85),
      rgba(255, 255, 255, 0)
    ) right center / 5px 100% no-repeat,
    radial-gradient(
      circle at top right,
      rgba(255, 255, 255, 0.85),
      rgba(255, 255, 255, 0) 70%
    ) right 0 top 0 / 14px 14px no-repeat;
}

/* ===================== 标题栏 ===================== */

.aero-titlebar {
  position: relative;
  height: 34px;
  padding: 0 16px;
  cursor: move;              /* 整个标题栏可拖拽 */
}

/* 正在拖拽时，变成抓手，禁止选中文字 */
.aero-window.dragging {
  cursor: grabbing;
  user-select: none;
}

.title-text {
  position: absolute;
  left: 14px;
  top: 8px;
  font-size: 15px;
  font-weight: 600;
  color: #1a1a1a;
  text-shadow:
    0 1px 2px rgba(255,255,255,0.85),
    0 0 4px rgba(255,255,255,0.35),
    0 2px 6px rgba(0,0,0,0.35);
  cursor: pointer;
  background: none;
  border: none;
  transform-origin: left center;
  transition:
    transform 0.18s ease-out,
    text-shadow 0.18s ease-out;
}

.title-text:hover {
  transform: scale(1.1);
  text-shadow:
    0 2px 3px rgba(255,255,255,0.95),
    0 0 6px rgba(255,255,255,0.65),
    0 3px 8px rgba(0,0,0,0.55);
}

.title-buttons {
  position: absolute;
  top: 4px;
  right: 10px;
  height: 24px;
  display: flex;
  background: none;
  border: 1px solid rgba(0,0,0,0.55);
  border-top: none;
  border-radius: 0 0 6px 6px;
  box-shadow:
    0 1px 2px rgba(0,0,0,0.60),
    inset 0 1px 0 rgba(255,255,255,0.55);
  overflow: hidden;
}

.title-buttons::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 0 0 6px 6px;
  pointer-events: none;
  box-shadow:
    -2px 0 0 rgba(255,255,255,0.35),
     0 2px 0 rgba(255,255,255,0.35);
}

.tb-btn {
  width: 32px;
  border: none;
  margin: 0;
  padding: 0;
  background: none;
  display: flex;
  align-items: center;
  justify-content: center;
  border-left: 1px solid rgba(255,255,255,0.45);
  border-right: 1px solid rgba(0,0,0,0.40);
  color: #ffffff;
  font-family: Segoe UI, sans-serif;
  cursor: pointer;
  position: relative;
  transition:
    transform 0.08s ease-out,
    filter 0.12s ease-out;
}

.tb-btn span {
  color: #ffffff;
  text-shadow:
    0px 0px 2px rgba(255,255,255,0.75),
    1px 1px 2px rgba(0,0,0,0.70);
  filter: drop-shadow(0px 1px 1px rgba(0,0,0,0.45));
}

.tb-min  {
  font-size: 20px;
  transform: translateY(-4px);
}

.tb-max  {
  font-size: 20px;
  transform: translateY(2px);
}

.tb-close {
  width: 58px;
  font-size: 20px;
  font-weight: 700;
}

/* hover 高光 */

.tb-btn:hover {
  transform: translateY(1px);
  filter: brightness(1.15);
}

.tb-btn:hover::before {
  content: "";
  position: absolute;
  inset: 0;
  height: 30%;
  background: linear-gradient(
    to bottom,
    rgba(255,255,255,0.55),
    rgba(255,255,255,0)
  );
  pointer-events: none;
}

/* ===================== 主体两栏布局 ===================== */

.content-wrapper {
  margin-top: 8px;
  background: rgba(255,240,230,1);
  border-radius: 4px;
  border: 1px solid rgba(80,80,80,0.95);

  /* 占满剩余空间，由外层 620px 决定高度 */
  flex: 1;
  min-height: 0;       /* 允许内部滚动区缩放 */

  display: grid;
  grid-template-columns: 200px 1fr;
  overflow: hidden;

  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.6),
    inset 0 -1px 0 rgba(120,100,80,0.4);
}

/* ===================== 左侧导航按钮 ===================== */

.sidebar {
  padding: 18px 14px;
  border-right: 1px solid rgba(80,80,80,0.95);
  background: none;
  height: 100%; 
  box-sizing: border-box;
}

.sidebar p {
  margin: 0 0 8px;
}

.sidebar .nav-link {
  display: block;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: lowercase;
  color: #2f3640;
  text-decoration: none;
  background: linear-gradient(
    to bottom,
    #ffffff,
    #f7f9fc 40%,
    #d0d8e8 75%,
    #bcc6da 100%
  );
  border: 1px solid #a5b0c0;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.95),
    inset 0 1px 0 rgba(255,255,255,0.85),
    inset 0 -1px 0 rgba(120,130,150,0.55),
    0 2px 3px rgba(0,0,0,0.25);
  transition:
    background 0.18s ease-out,
    box-shadow 0.18s ease-out,
    color 0.18s ease-out,
    border-color 0.18s ease-out,
    transform 0.12s ease-out;
}

.sidebar .nav-link:hover {
  color: #0e2560;
  background: linear-gradient(
    to bottom,
    #e0ecff 0%,
    #c2d6ff 40%,
    #8eaef5 80%,
    #7a9ae6 100%
  );
  border-color: #4a68c0;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.95),
    inset 0 1px 0 rgba(255,255,255,0.9),
    inset 0 -1px 0 rgba(60,70,110,0.65),
    0 6px 12px rgba(0,0,0,0.45);
  transform: translateY(-1px);
}

/* 选中态（由 js 加 .active） */

.sidebar .nav-link.active {
  color: #0b255f;
  background: linear-gradient(
    to bottom,
    #d6e7ff 0%,
    #b7d0ff 45%,
    #7fa6ff 100%
  );
  border-color: #3459b4;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.95),
    0 2px 6px rgba(0,0,0,0.40);
}

/* ===================== 右侧内容区域 ===================== */

.main-content {
  padding: 18px;
  overflow-y: auto;        /* 文章再长，只在这里滚 */
  height: 100%;
  box-sizing: border-box;
}

/* 如果有需要，你可以让 #content 占满高度 */
#content {
  height: 100%;
}

/* ===================== 右下角 mini toast ===================== */

.mini-toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 320px;
  background: rgba(255,255,255,0.95);
  border-radius: 8px;
  border: 1px solid rgba(40,40,40,0.85);
  box-shadow:
    0 12px 25px rgba(0,0,0,0.65),
    inset 0 1px 0 rgba(255,255,255,0.8);
  font-size: 12px;
  font-family: Segoe UI, system-ui, sans-serif;
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition:
    opacity 0.25s ease-out,
    transform 0.25s ease-out;
  z-index: 999;
}

.mini-toast.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  animation: toast-shake 0.45s cubic-bezier(.26,1.4,.52,1);
}

@keyframes toast-shake {
  0%   { transform: translate(8px, 20px); }
  25%  { transform: translate(-6px, 2px); }
  50%  { transform: translate(4px, -1px); }
  75%  { transform: translate(-2px, 1px); }
  100% { transform: translate(0, 0); }
}

.mini-toast-titlebar {
  height: 22px;
  padding: 0 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(
    to right,
    rgba(110,170,240,0.98),
    rgba(170,220,255,0.98)
  );
  color: #ffffff;
  font-size: 11px;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0,0,0,0.65);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.6),
    0 1px 2px rgba(0,0,0,0.45);
}

.mini-toast-close {
  background: none;
  border: none;
  color: #ffffff;
  cursor: pointer;
  padding: 0;
  margin: 0;
}

.mini-toast-body {
  padding: 10px 12px 12px;
  display: flex;
  gap: 8px;
}

.mini-toast-icon {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  background: linear-gradient(
    135deg,
    rgba(255,255,255,0.95),
    rgba(200,220,255,0.95)
  );
  border: 1px solid rgba(60,80,130,0.9);
  box-shadow:
    inset 1px 1px 0 rgba(255,255,255,0.9),
    0 1px 3px rgba(0,0,0,0.35);
}

.mini-toast-text {
  flex: 1;
  line-height: 1.5;
}

.mini-toast-text strong {
  display: block;
  margin-bottom: 2px;
}

/* ===================== 关闭折叠动画 ===================== */

.aero-window.close-anim {
  animation: aero-close-fold 0.7s cubic-bezier(.25,1.5,.5,1) forwards;
  transform-origin: top center;
}

@keyframes aero-close-fold {
  0% {
    transform: translate(var(--tx,0px), var(--ty,0px))
               scale(1, 1);
    opacity: 1;
  }
  70% {
    transform: translate(var(--tx,0px), var(--ty,0px))
               scale(0.4, 0.3);
    opacity: 0.4;
  }
  100% {
    transform: translate(var(--tx,0px), var(--ty,0px))
               scale(0.2, 0.2);
    opacity: 0;
  }
}

/* ===================== 文章排版 ===================== */

.article-container {
  max-width: 720px;
  margin: 0 auto;
  padding: 10px 4px 32px;
  font-family:
    "Noto Serif SC",
    "Source Han Serif SC",
    "STSong",
    Georgia,
    "Times New Roman",
    serif;
  color: #202020;
  line-height: 1.75;
  letter-spacing: 0.01em;
}

.article-container h1 {
  font-size: 24px;
  font-weight: 600;
  /* margin-bottom: 14px;  交给 .article-header 控制了 */
  letter-spacing: 0.02em;
}

.article-container .lead {
  font-size: 14px;
  opacity: 0.75;
  margin-bottom: 20px;
  text-indent: 0;   /* 引言不要缩进 */
}

.article-container hr {
  border: none;
  border-top: 1px solid rgba(0,0,0,0.1);
  margin: 18px 0 28px;
}

.article-container p {
  margin: 0 0 16px;
  font-size: 15px;
  line-height: 1.75;
  text-indent: 2em;   /* 每段开头空两格 */
  font-weight: 350;
}

.article-container blockquote {
  margin: 20px 0;
  padding-left: 14px;
  border-left: 3px solid rgba(0,0,0,0.25);
  opacity: 0.75;
  font-style: italic;
  text-indent: 0;     /* 引用不缩进 */
}

/* 参考文献区 */

.article-notes {
  max-width: 720px;
  margin: 0 auto;
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px dashed rgba(0,0,0,0.2);
  font-family: "Segoe UI", system-ui, sans-serif;
}

.article-notes h2 {
  font-size: 14px;
  text-transform: lowercase;
  letter-spacing: 0.12em;
  opacity: 0.7;
  margin: 0 0 10px;
}

/* 标题 + 时间 放在一行 */

.article-header {
  display: flex;
  align-items: baseline;          /* 底线对齐 */
  justify-content: space-between; /* 左标题，右时间 / 右侧可以塞语言切换 */
  gap: 16px;
  margin-bottom: 14px;            /* 原来给 h1 的那点距离 */
}

/* 只在 header 里的 h1 把外边距干掉 */
.article-header h1 {
  margin: 0;
}

/* 右侧的小时间标签 */
.article-meta {
  font-size: 11px;
  line-height: 1.4;
  color: #777;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  white-space: nowrap;
  text-align: right;
}

/* ===== 文章：标题区 + 语言切换 ===== */

.article-title-block {
  flex: 1;  /* 让标题 + 日期这块占左边，语言切换贴右边 */
}

/* 顶部语言切换容器：贴右边，小药丸按钮 */
.article-lang-toggle {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

/* 统一尺寸的小 pill 按钮 */
.article-lang-toggle button {
  min-width: 56px;           /* 固定一个宽度：两个看起来一样大 */
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,0.28);
  background: rgba(255,255,255,0.4);
  cursor: pointer;

  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 11px;
  line-height: 1;
  letter-spacing: 0.06em;
  text-transform: uppercase;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  box-shadow:
    0 1px 0 rgba(255,255,255,0.9),
    0 1px 3px rgba(0,0,0,0.25);
  transition:
    background 0.15s ease-out,
    color 0.15s ease-out,
    border-color 0.15s ease-out,
    box-shadow 0.15s ease-out,
    transform 0.1s ease-out;
}

/* hover 状态：稍微亮一点 */
.article-lang-toggle button:hover:not(.is-active) {
  background: rgba(255,255,255,0.85);
  box-shadow:
    0 1px 0 rgba(255,255,255,1),
    0 2px 5px rgba(0,0,0,0.3);
  transform: translateY(-0.5px);
}

/* 选中语言：深色实心 pill */
.article-lang-toggle button.is-active {
  background: #1a2030;
  color: #ffffff;
  border-color: #1a2030;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.35),
    0 2px 6px rgba(0,0,0,0.45);
}
.article-body {
  margin-top: 4px;
}
.article-body-en {
  display: none;
}
.article-container[data-lang="zh"] .article-body-zh {
  display: block;
}
.article-container[data-lang="zh"] .article-body-en {
  display: none;
}
.article-container[data-lang="en"] .article-body-zh {
  display: none;
}
.article-container[data-lang="en"] .article-body-en {
  display: block;
}
.ref-list {
  list-style: decimal;
  padding-left: 22px;
  margin: 0;
}

.ref-list li {
  margin: 4px 0 10px;
}

.ref-main {
  display: block;
  font-size: 13px;
}

.ref-meta {
  display: block;
  font-size: 11px;
  opacity: 0.7;
  margin-top: 2px;
}

/* ===================== why 网格（封面相册） ===================== */

.why-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 28px;
  padding: 10px 4px;
  justify-items: center;
}

.why-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: #333;
  font-size: 12px;
}

.why-item img {
  width: 100%;
  max-width: 150px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.04);
  box-shadow:
    0 3px 6px rgba(0, 0, 0, 0.18),
    inset 0 0 3px rgba(0,0,0,0.1);
  opacity: .92;
  transition: transform .2s ease-out, opacity .2s ease-out;
}

.why-item:hover img {
  transform: scale(1.05);
  opacity: 1;
}

.why-item span {
  margin-top: 8px;
  opacity: .75;
  text-align: center;
}

/* ===================== 右下角缩放手柄 ===================== */

.resize-handle {
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 18px;
  height: 18px;
  cursor: se-resize;

  background:
    linear-gradient(135deg,
      rgba(255,255,255,0.9) 0%,
      rgba(180,180,180,0.9) 50%,
      rgba(140,140,140,0.9) 100%);
  clip-path: polygon(100% 0, 100% 100%, 0 100%);
  border-radius: 3px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.8),
    inset -1px -1px 2px rgba(0,0,0,0.35);
  opacity: 0.85;
  transition: opacity 0.2s ease-out;
}

.resize-handle:hover {
  opacity: 1;
}

/* 缩放中禁用过渡，更丝滑 */
.aero-window.resizing {
  transition: none !important;
}

/* ===== donotcllick 页面的小样式 ===== */

.donot-main {
  max-width: 620px;
  margin: 0 auto;
  padding: 24px 4px 40px;
  font-family: "Segoe UI", system-ui, sans-serif;
  color: #202020;
  line-height: 1.7;
}

.donot-main h1 {
  font-size: 20px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 12px;
}

.donot-lead {
  font-size: 14px;
  opacity: 0.78;
  margin-bottom: 20px;
}

.donot-spell {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(0,0,0,0.08);
  font-family: "Courier New", monospace;
}

.donot-hint {
  margin-top: 18px;
  font-size: 12px;
  opacity: 0.7;
}

/* 锁定模式下，侧边导航 + 标题微微褪色，鼠标禁用 */
.aero-window.donot-lock .sidebar,
.aero-window.donot-lock .title-text {
  opacity: 0.5;
  pointer-events: none;
}

.aero-window.donot-lock .title-buttons {
  opacity: 0.8;
}
