/* ============================================================
 * 加密页面自定义样式 — 圆润优雅
 * ============================================================ */

/* --- 容器卡片 --- */
.hbe-container {
  max-width: 420px;
  margin: 2.5em auto;
  padding: 2.5em 2em 2em;
  background: #ffffff;
  border-radius: 20px;
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.04),
    0 8px 30px rgba(0, 0, 0, 0.06);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.hbe-container:hover {
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.06),
    0 12px 40px rgba(0, 0, 0, 0.09);
  transform: translateY(-2px);
}

/* --- 表单布局 --- */
.hbe-form {
  gap: 0;
}

/* --- 输入框区域 --- */
.hbe-input.hbe-input-default {
  width: 100%;
  margin: 0 0 0.4em;
}

/* 覆盖 default 主题的复杂动画，简化为干净圆润风格 */
.hbe-input-label-default {
  position: relative !important;
  text-align: center !important;
  font-size: 1.05rem !important;
  color: #8e8e93 !important;
  padding: 0 !important;
  margin-bottom: 0.6em;
  width: 100% !important;
  pointer-events: auto !important;
}

.hbe-input-label-default::before,
.hbe-input-label-default::after {
  display: none !important;
}

.hbe-input-label-content-default {
  padding: 0 !important;
  transform: none !important;
  transition: none !important;
  color: #6e6e73 !important;
  font-size: 1.05rem !important;
  font-weight: 500 !important;
}

/* 输入框 */
.hbe-input-field-default {
  position: relative !important;
  width: 100% !important;
  float: none !important;
  opacity: 1 !important;
  z-index: auto !important;
  padding: 0.85em 1.1em !important;
  margin-bottom: 1.2em !important;
  font-size: 1.15rem !important;
  color: #1d1d1f !important;
  background: #f5f5f7 !important;
  border: 2px solid transparent !important;
  border-radius: 14px !important;
  outline: none !important;
  transition: all 0.25s ease !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif !important;
}

.hbe-input-field-default:focus {
  background: #ffffff !important;
  border-color: #4d8df0 !important;
  box-shadow: 0 0 0 4px rgba(77, 141, 240, 0.12) !important;
}

.hbe-input-field-default::placeholder {
  color: #c7c7cc;
}

/* --- 解密按钮 --- */
.hbe-button {
  width: 100% !important;
  max-width: 100% !important;
  min-width: auto !important;
  height: auto !important;
  padding: 0.85em 0 !important;
  font-size: 1.15rem !important;
  font-weight: 600 !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif !important;
  color: #ffffff !important;
  background: linear-gradient(135deg, #5e8fef 0%, #4d7ce8 100%) !important;
  border: none !important;
  border-radius: 14px !important;
  box-shadow: 0 2px 8px rgba(77, 125, 232, 0.3) !important;
  cursor: pointer !important;
  text-align: center !important;
  text-indent: 0 !important;
  text-shadow: none !important;
  letter-spacing: 0.02em;
  transition: all 0.25s ease !important;
  position: relative !important;
  top: auto !important;
  margin: 0 !important;
}

.hbe-button:hover {
  background: linear-gradient(135deg, #6d9df5 0%, #5a8af0 100%) !important;
  box-shadow: 0 4px 16px rgba(77, 125, 232, 0.4) !important;
  transform: translateY(-1px);
}

.hbe-button:active {
  transform: translateY(0) scale(0.98) !important;
  box-shadow: 0 1px 4px rgba(77, 125, 232, 0.3) !important;
}

/* 去除 v3 旧按钮的 after 伪元素（三角箭头等） */
.hbe-button::after {
  display: none !important;
}

/* 隐藏按钮（插件控制） */
.hbe-button-hidden {
  display: none !important;
}

/* --- 错误提示 --- */
.hbe-error {
  min-height: 1.2em;
  margin: 0.8em 0 0 !important;
  padding: 0.6em 1em !important;
  font-size: 1rem !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif !important;
  color: #d63333 !important;
  text-align: center !important;
  background: transparent !important;
  border-radius: 10px !important;
  transition: all 0.25s ease;
}

.hbe-error:not(:empty) {
  background: rgba(214, 51, 51, 0.06) !important;
  border: 1px solid rgba(214, 51, 51, 0.15) !important;
}

/* --- loading 动画 --- */
.hbe-button[aria-busy="true"]::after {
  margin-left: 0.6em !important;
  width: 1em !important;
  height: 1em !important;
  border-width: 2px !important;
}

@keyframes hbe-spin {
  to { transform: rotate(360deg); }
}

/* ============================================================
 * 暗色模式
 * ============================================================ */
@media (prefers-color-scheme: dark) {
  .hbe-container {
    background: #1c1c1e;
    box-shadow:
      0 1px 3px rgba(0, 0, 0, 0.2),
      0 8px 30px rgba(0, 0, 0, 0.3);
  }

  .hbe-container:hover {
    box-shadow:
      0 1px 3px rgba(0, 0, 0, 0.3),
      0 12px 40px rgba(0, 0, 0, 0.4);
  }

  .hbe-input-label-content-default {
    color: #98989d !important;
  }

  .hbe-input-field-default {
    color: #f5f5f7 !important;
    background: #2c2c2e !important;
  }

  .hbe-input-field-default:focus {
    background: #3a3a3c !important;
    border-color: #6ba1f5 !important;
    box-shadow: 0 0 0 4px rgba(107, 161, 245, 0.18) !important;
  }

  .hbe-button {
    background: linear-gradient(135deg, #5e8fef 0%, #4d7ce8 100%) !important;
    box-shadow: 0 2px 8px rgba(77, 141, 240, 0.25) !important;
  }

  .hbe-button:hover {
    background: linear-gradient(135deg, #6d9df5 0%, #5a8af0 100%) !important;
    box-shadow: 0 4px 16px rgba(77, 141, 240, 0.35) !important;
  }

  .hbe-error {
    color: #ff6961 !important;
  }

  .hbe-error:not(:empty) {
    background: rgba(255, 105, 97, 0.08) !important;
    border-color: rgba(255, 105, 97, 0.18) !important;
  }
}

/* ===== Bilingual Summary ===== */
.post-summary-bilingual {
    margin: 0.8em 0 0.2em;
    padding: 0.8em 1em;
    border-left: 3px solid #3eb0ef;
    background: rgba(62, 176, 239, 0.06);
    border-radius: 0 8px 8px 0;
}
.summary-zh {
    font-size: 1em;
    color: #3c484e;
    margin: 0;
}
.summary-en {
    font-size: 0.92em;
    color: #738a94;
    margin: 0.15em 0 0;
    font-style: italic;
}

@media (prefers-color-scheme: dark) {
    .summary-zh { color: #e0e0e0; }
    .summary-en { color: #9aa0a6; }
    .post-summary-bilingual {
        background: rgba(62, 176, 239, 0.08);
        border-left-color: #5eb8f0;
    }
}

/* ===== Timeline v3: Grid Layout ===== */
.timeline {
    position: relative;
    max-width: 860px;
    margin: 3em auto 4em;
}
.timeline::before {
    content: '';
    position: absolute;
    top: 0; bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 3px;
    background: #c8d6e5;
    z-index: 0;
}
.timeline-year {
    text-align: center;
    margin: 2em 0 1.4em;
    position: relative;
    z-index: 2;
}
.timeline-year span {
    display: inline-block;
    position: relative;
    background: #3c484e;
    color: #fff;
    padding: 0.35em 1.4em;
    border-radius: 24px;
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: 0.06em;
}
/* Grid row: [card] [dot] [empty] or [empty] [dot] [card] */
.timeline-row {
    display: grid;
    grid-template-columns: 1fr 40px 1fr;
    align-items: start;
    margin-bottom: 0.4em;
}
.timeline-dot {
    grid-column: 2;
    width: 14px; height: 14px;
    margin-top: 1.8em;
    border-radius: 50%;
    background: #3eb0ef;
    border: 3px solid #fff;
    box-shadow: 0 0 0 5px #fff, 0 0 0 8px #3eb0ef;
    justify-self: center;
    position: relative;
    z-index: 3;
}
/* Left: card in col 1 */
.timeline-row.left .timeline-card {
    grid-column: 1;
    grid-row: 1;
    margin-right: 10px;
}
/* Right: card in col 3 */
.timeline-row.right .timeline-card {
    grid-column: 3;
    grid-row: 1;
    margin-left: 10px;
}
.timeline-row.right .timeline-dot { grid-column: 2; grid-row: 1; }
.timeline-row.left .timeline-dot  { grid-column: 2; grid-row: 1; }
/* Card */
.timeline-card {
    background: #fff;
    border: 1px solid #e8ecf1;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: box-shadow 0.25s, transform 0.25s;
}
.timeline-card:hover {
    box-shadow: 0 6px 24px rgba(0,0,0,0.10);
    transform: translateY(-2px);
}
.timeline-cover {
    display: block;
    overflow: hidden;
    height: 130px;
}
.timeline-cover img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}
.timeline-card:hover .timeline-cover img { transform: scale(1.04); }
.timeline-body {
    padding: 0.9em 1em 0.85em;
}
.timeline-date {
    display: block;
    font-size: 1.05rem;
    color: #8395a7;
    margin-bottom: 0.5em;
}
.timeline-title {
    display: block;
    font-size: 1.45rem;
    font-weight: 700;
    color: #2c3e50;
    text-decoration: none;
    margin-bottom: 0.4em;
    line-height: 1.3;
    transition: color 0.15s;
}
.timeline-title:hover { color: #3eb0ef; text-decoration: none; }
.timeline-summary {
    font-size: 1.15rem;
    color: #5a6a7a;
    margin: 0.3em 0 0.7em;
    line-height: 1.6;
}
.timeline-meta {
    display: flex;
    align-items: center;
    gap: 0.6em;
    flex-wrap: wrap;
}
.timeline-cat {
    font-size: 0.92rem;
    color: #3eb0ef;
    background: rgba(62,176,239,0.1);
    padding: 0.2em 0.8em;
    border-radius: 12px;
}
.timeline-read {
    font-size: 0.92rem;
    color: #aab5c0;
}
.timeline-end {
    text-align: center;
    margin-top: 2em;
    position: relative;
    z-index: 2;
}
.timeline-end span {
    display: inline-block;
    position: relative;
    background: #f0f4f8;
    color: #8395a7;
    padding: 0.4em 1.4em;
    border-radius: 24px;
    font-size: 1rem;
}
/* 移动端 */
@media (max-width: 768px) {
    .timeline::before { left: 18px; transform: none; }
    .timeline-year { text-align: left; padding-left: 48px; }
    .timeline-row {
        display: block;
        position: relative;
        margin: 0 0 1.2em 40px;
    }
    .timeline-dot {
        position: absolute;
        top: 1.5em;
        left: -29px;
        margin-top: 0;
    }
    .timeline-row.left .timeline-card,
    .timeline-row.right .timeline-card { margin: 0; }
    .timeline-end { text-align: left; padding-left: 48px; }
    .timeline-cover { height: 100px; }
}
/* 暗色模式 */
@media (prefers-color-scheme: dark) {
    .timeline::before { background: #3a3a3e; }
    .timeline-year span { background: #5eb8f0; color: #1c1c1e; }
    .timeline-dot { border-color: #1c1c1e; background: #5eb8f0; box-shadow: 0 0 0 5px #1c1c1e, 0 0 0 8px #5eb8f0; }
    .timeline-card { background: #2c2c2e; border-color: #3a3a3e; box-shadow: 0 2px 8px rgba(0,0,0,0.25); }
    .timeline-card:hover { box-shadow: 0 6px 24px rgba(0,0,0,0.45); }
    .timeline-title { color: #e8e8ea; }
    .timeline-title:hover { color: #5eb8f0; }
    .timeline-summary { color: #a0a5aa; }
    .timeline-date { color: #787c82; }
    .timeline-cat { color: #5eb8f0; background: rgba(94,184,240,0.14); }
    .timeline-read { color: #5e6468; }
    .timeline-end span { background: #2c2c2e; color: #787c82; }
}

@media (prefers-color-scheme: dark) {
    .topic-tag, .topic-cat { background: #2c2c2e; border-color: #3a3a3e; color: #d0d0d0; }
    .topic-tag:hover, .topic-cat:hover { border-color: #5eb8f0; color: #5eb8f0; }
    .topic-tag .topic-count { background: rgba(94,184,240,0.14); color: #5eb8f0; }
    .topic-cat .topic-count { color: #787c82; }
}

@media (prefers-color-scheme: dark) {
    .tag-block { background: #2c2c2e; border-color: #3a3a3e; }
    .tag-block-header { border-color: #3a3a3e; }
    .tag-block-name { color: #5eb8f0; }
    .tag-block-name:hover { color: #7ec8f6; }
    .tag-block-count { background: rgba(94,184,240,0.12); color: #5eb8f0; }
    .tag-post-item { color: #c0c0c0; border-color: #323236; }
    .tag-post-item:hover { background: #323236; }
    .tag-post-title { color: #d0d0d0; }
    .tag-post-item:hover .tag-post-title { color: #5eb8f0; }
    .tag-post-date { color: #6e7680; }
}

/* ===== Tags Cloud ===== */
.topic-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 1em;
    margin: 3em 0;
    justify-content: center;
}
.topic-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5em;
    padding: 0.6em 1.2em;
    background: #fff;
    border: 1px solid #e0e5ea;
    border-radius: 12px;
    text-decoration: none;
    color: #2c3e50;
    font-size: 1.08rem;
    font-weight: 600;
    transition: all 0.2s;
}
.topic-tag:hover {
    border-color: #3eb0ef;
    color: #3eb0ef;
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(62,176,239,0.15);
    text-decoration: none;
}
.topic-tag .topic-count {
    background: rgba(62,176,239,0.12);
    color: #3eb0ef;
    padding: 0.15em 0.65em;
    border-radius: 14px;
    font-size: 0.78rem;
    font-weight: 700;
}

/* ===== Categories Card List ===== */
.tag-block {
    background: #fff;
    border: 1px solid #e8ecf1;
    border-radius: 14px;
    margin-bottom: 1.5em;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.03);
}
.tag-block-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.8em 1.2em;
    border-bottom: 1px solid #f0f3f6;
}
.tag-block-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: #3eb0ef;
    text-decoration: none;
    transition: color 0.15s;
}
.tag-block-name:hover { color: #2180b0; text-decoration: none; }
.tag-block-count {
    font-size: 1rem;
    color: #3eb0ef;
    background: rgba(62,176,239,0.08);
    padding: 0.2em 0.8em;
    border-radius: 12px;
    font-weight: 600;
}
.tag-block-posts {
    padding: 0.3em 0;
}
.tag-post-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65em 1.2em;
    text-decoration: none;
    color: #3c484e;
    transition: background 0.15s;
    border-bottom: 1px solid #f8f9fa;
}
.tag-post-item:last-child { border-bottom: none; }
.tag-post-item:hover {
    background: #f6f9fb;
    text-decoration: none;
}
.tag-post-title {
    font-size: 1.2rem;
    color: #3c484e;
}
.tag-post-item:hover .tag-post-title { color: #3eb0ef; }
.tag-post-date {
    font-size: 0.95rem;
    color: #aab5c0;
    flex-shrink: 0;
    margin-left: 1em;
}

/* ===== Mobile: Categories & Tags ===== */
@media (max-width: 500px) {
    .tag-block {
        border-radius: 10px;
        margin-bottom: 1em;
    }
    .tag-block-header {
        padding: 0.6em 0.9em;
    }
    .tag-block-name {
        font-size: 1.25rem;
    }
    .tag-block-count {
        font-size: 0.85rem;
        padding: 0.15em 0.6em;
    }
    .tag-post-item {
        padding: 0.55em 0.9em;
    }
    .tag-post-title {
        font-size: 1rem;
    }
    .tag-post-date {
        font-size: 0.8rem;
        margin-left: 0.6em;
    }
    .topic-cloud {
        gap: 0.6em;
        margin: 2em 0;
    }
    .topic-tag {
        font-size: 0.95rem;
        padding: 0.5em 0.9em;
    }
    .topic-tag .topic-count {
        font-size: 0.7rem;
    }
}

/* Dark mode for both */
@media (prefers-color-scheme: dark) {
    .topic-tag { background: #2c2c2e; border-color: #3a3a3e; color: #c0c0c0; }
    .topic-tag:hover { border-color: #5eb8f0; color: #5eb8f0; box-shadow: 0 6px 18px rgba(94,184,240,0.18); }
    .topic-tag .topic-count { background: rgba(94,184,240,0.14); color: #5eb8f0; }
    .tag-block { background: #2c2c2e; border-color: #3a3a3e; }
    .tag-block-header { border-color: #3a3a3e; }
    .tag-block-name { color: #5eb8f0; }
    .tag-block-name:hover { color: #7ec8f6; }
    .tag-block-count { background: rgba(94,184,240,0.12); color: #5eb8f0; }
    .tag-post-item { color: #c0c0c0; border-color: #323236; }
    .tag-post-item:hover { background: #323236; }
    .tag-post-title { color: #d0d0d0; }
    .tag-post-item:hover .tag-post-title { color: #5eb8f0; }
    .tag-post-date { color: #6e7680; }
}
