/*
Theme Name: IceFox Moments
Theme URI: https://0ru.cn/
Author: IceFox WP Port
Author URI: https://0ru.cn/
Description: 仿微信朋友圈风格的 WordPress 时间线主题。支持视频封面、九宫格图片灯箱、点赞、评论回复、无限滚动、暗黑模式、音乐播放器、前端发布。
Version: 1.1.2
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: icefox-wp
Tags: blog, one-column, custom-colors, dark-mode, translation-ready
*/

/* 自定义字体（与 0ru.cn 一致） */
@font-face {
  font-family: 'DingTalk';
  src: url('assets/fonts/DingTalk.woff2') format('woff2');
  font-display: swap;
}
@font-face {
  font-family: 'HarmonyOS';
  src: url('assets/fonts/HarmonyOS-Sans.woff2') format('woff2');
  font-display: swap;
}

/* =========================================================
   0. 变量与暗黑模式
   ========================================================= */
:root {
  --main-background: #ffffff;
  --body-background: #f0f0f0;
  --primary-background: #f7f7f7;
  --primary-background-hover: #dedede;
  --text-color: #333333;
  --text-sub-color: #555555;
  --line: rgb(243 244 246);
  --link: #576b95;
  --green: #07c160;
  --menu-background: rgba(76, 76, 76, 0.94);
  --menu-color: #ffffff;
  --mask: rgba(0, 0, 0, 0.92);
  --shadow: 0 4px 18px rgba(0, 0, 0, 0.1);
  --radius: 6px;
}

:root.dark {
  --main-background: #262626;
  --body-background: #181818;
  --primary-background: #323232;
  --primary-background-hover: #434343;
  --text-color: #aaaaaa;
  --text-sub-color: #888888;
  --line: #333333;
  --link: #7d90b8;
  --menu-background: rgba(23, 23, 23, 0.96);
  --shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
}

/* =========================================================
   1. 基础重置
   ========================================================= */
* { box-sizing: border-box; }

html {
  height: 100%;
  transition: background-color 0.3s ease, color 0.3s ease;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
html::-webkit-scrollbar { display: none; }

body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--body-background);
  color: var(--text-color);
  font-family: 'HarmonyOS', 'Roboto', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-size: 15px;
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--link);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; }

.hidden { display: none !important; }
.cursor-pointer { cursor: pointer; }

/* 隐藏后台上传图片时可能出现的包裹层 */
.aligncenter { display: block; margin-left: auto; margin-right: auto; }

/* =========================================================
   2. 主容器
   ========================================================= */
main {
  width: 100%;
  max-width: 576px;
  margin: 0 auto;
  background-color: var(--main-background);
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: relative;
}

.content-container {
  margin-top: 0;
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* 无封面的页面（归档 / 搜索 / 详情）需要给固定顶栏让出空间 */
.page-head + .post-list { padding-top: 16px; }

/* =========================================================
   3. 顶部固定栏
   ========================================================= */
.top-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
  max-width: 576px;
  height: 56px;
  z-index: 99;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 10px;
  background-color: transparent;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.top-container.scrolled {
  background-color: var(--main-background);
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.06);
}

.top-container > .top-container-left,
.top-container > .top-container-right {
  display: flex;
  align-items: center;
  gap: 5px;
}

.top-container .tc-btn {
  height: 40px;
  min-width: 40px;
  padding: 0 6px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  border: 0;
  background: transparent;
  border-radius: 6px;
  color: inherit;
  font-size: 13px;
}
.top-container .tc-btn:hover { background-color: rgba(0, 0, 0, 0.06); }

.top-container svg {
  height: 20px;
  width: 20px;
  color: #ffffff;
  transition: color 0.3s ease;
}
.top-container.scrolled svg { color: #888888; }
.top-container.scrolled .tc-btn { color: #888888; }
.top-container .tc-btn:hover svg { color: var(--green); }

/* 没有封面图的页面（详情/页面/搜索/404）：顶栏用实底 + 深色图标 */
body:not(.icefox-has-cover) .top-container {
  background-color: var(--main-background);
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.06);
}
body:not(.icefox-has-cover) .top-container svg { color: #888888; }
body:not(.icefox-has-cover) .top-container .tc-btn { color: #888888; }
body:not(.icefox-has-cover) .top-container .tc-btn:hover svg { color: var(--green); }

/* 有封面的首页：顶栏透明，图标白色；滚动后变实底 */
body.icefox-has-cover .top-container:not(.scrolled) {
  background-color: transparent;
  box-shadow: none;
}
body.icefox-has-cover .top-container:not(.scrolled) svg { color: #ffffff; }
body.icefox-has-cover .top-container:not(.scrolled) .tc-btn { color: #ffffff; }

/* 顶部图标按钮里的文字（登录/发布） */
.top-container .tc-label { font-size: 13px; }

/* =========================================================
   4. 头部封面
   ========================================================= */
.header-container {
  position: relative;
  width: 100%;
  height: 320px;
  background-color: #2b2b2b;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  overflow: visible;
}

.header-container > video,
.header-container > .header-cover-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.header-container::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.25) 0%, rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, 0.12) 100%);
  pointer-events: none;
}

.header-info {
  position: absolute;
  left: 0;
  bottom: -46px;
  width: 100%;
  z-index: 2;
}

.header-user {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding-right: 20px;
  color: #ffffff;
}

.header-site-title {
  margin-right: 16px;
  color: #ffffff;
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.3s ease;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
}
.header-site-title:hover {
  opacity: 0.85;
  transform: translateY(-2px);
  text-decoration: none;
}

.header-avatar,
.header-avatar-link {
  display: block;
  width: 60px;
  height: 60px;
  border-radius: 5px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
  background-color: #dddddd;
}
.header-avatar img,
.header-avatar-link img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 5px;
}
.header-logo-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666666;
  font-size: 12px;
  background-color: #dddddd;
}

.header-description {
  display: flex;
  justify-content: flex-end;
  padding-right: 20px;
  margin-top: 10px;
  min-height: 21px;
  font-size: 14px;
  color: var(--text-sub-color);
}

/* 头部高度不足时（无封面）的兜底 */
.header-container.no-cover { height: 180px; background: linear-gradient(135deg, #455a64, #78909c); }

/* =========================================================
   5. 时间线列表
   ========================================================= */
.post-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-top: 76px;
  padding-bottom: 24px;
  flex: 1 0 auto;
}

.post-item {
  display: flex;
  align-items: flex-start;
  padding: 0 20px;
}

.post-item-left {
  width: 48px;
  flex: 0 0 48px;
}

.post-item-left a { display: block; }

.post-item-left img {
  width: 36px;
  height: 36px;
  border-radius: 5px;
  object-fit: cover;
  display: block;
}

.post-item-right {
  width: calc(100% - 48px);
  padding-bottom: 15px;
  border-bottom: 1px solid var(--line);
}

.post-title {
  margin: 0 0 6px 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
}
.post-title a {
  color: var(--link);
  text-decoration: none;
  font-weight: 600;
}
.post-title a:hover { text-decoration: underline; }

.top-badge {
  display: inline-block;
  padding: 1px 5px;
  font-size: 11px;
  font-weight: 500;
  color: #ff4444;
  border: 1px solid #ff4444;
  border-radius: 3px;
  line-height: 1.4;
}
.ad-badge {
  display: inline-block;
  padding: 1px 5px;
  font-size: 11px;
  font-weight: 500;
  color: #ffffff;
  background-color: #ff4444;
  border-radius: 3px;
  line-height: 1.4;
}
.promo-badge {
  display: inline-block;
  padding: 1px 5px;
  font-size: 11px;
  font-weight: 500;
  color: #ff8800;
  border: 1px solid #ff8800;
  border-radius: 3px;
  line-height: 1.4;
}
.featured-badge {
  display: inline-block;
  padding: 1px 5px;
  font-size: 11px;
  font-weight: 500;
  color: #ffffff;
  background-color: #d4a017;
  border-radius: 3px;
  line-height: 1.4;
}

.post-content {
  margin-bottom: 10px;
  color: var(--text-color);
  line-height: 1.65;
  word-break: break-word;
  overflow-wrap: break-word;
}
.post-content p { margin: 0 0 8px; }
.post-content p:last-child { margin-bottom: 0; }
.post-content a {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.post-content .post-link-card {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 4px;
  padding: 3px 8px;
  border-radius: 4px;
  background-color: var(--primary-background);
  color: var(--link);
  font-size: 13px;
  text-decoration: none;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 正文视频（从古腾堡视频块拆出来）：受控尺寸，不撑破卡片 */
.post-video-list {
  margin-bottom: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.post-video {
  width: 100%;
  max-height: 420px;
  background: #000;
  border-radius: 10px;
  display: block;
  object-fit: cover;
}

/* 外链播放器（HLS 分享链接等）：16:9 响应式 */
.post-iframe-list {
  margin-bottom: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.post-iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: 10px;
  background: #000;
  display: block;
}

/* 位置 */
.post-position {
  margin-bottom: 6px;
  font-size: 13px;
}
.post-position span { color: var(--link); }
.post-position svg {
  width: 12px;
  height: 12px;
  vertical-align: -1px;
  margin-right: 2px;
  fill: currentColor;
  color: var(--link);
}

/* 时间 + 更多菜单 */
.post-time {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
}
.post-time time {
  color: var(--text-sub-color);
  font-size: 12px;
}

.post-time time a {
  color: var(--text-sub-color);
  font-size: 12px;
  text-decoration: none;
}
.post-time time a:hover { text-decoration: underline; }

.post-time-comment {
  position: relative;
  background-color: var(--primary-background);
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}
.post-time-comment:hover { background-color: var(--primary-background-hover); }

.ptc-more {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 20px;
  width: 28px;
}
.ptc-more svg { width: 16px; height: 16px; color: #8a8a8a; }

.post-time-comment-modal {
  position: absolute;
  right: 0;
  bottom: 32px;
  width: 160px;
  height: 32px;
  display: none;
  align-items: center;
  justify-content: center;
  background-color: var(--menu-background);
  color: var(--menu-color);
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
  z-index: 30;
  box-shadow: var(--shadow);
}
.post-time-comment-modal.show { display: flex; animation: fadeIn 0.2s ease-out; }

.ptcm-good,
.ptcm-comment {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 50%;
  height: 22px;
  cursor: pointer;
}
.ptcm-good { border-right: 1px solid rgba(255, 255, 255, 0.25); }
.ptcm-good svg,
.ptcm-comment svg { width: 15px; height: 15px; color: var(--menu-color); }
.ptcm-good.is-liked svg { color: #ff5a5f; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* =========================================================
   6. 图片九宫格 + 视频
   ========================================================= */
.post-images { width: 96%; margin-bottom: 10px; }

.post-images-container {
  display: grid;
  gap: 4px;
}
.post-images-1 { grid-template-columns: 1fr; }
.post-images-2 { grid-template-columns: repeat(2, 1fr); width: 88%; }
.post-images-3 { grid-template-columns: repeat(3, 1fr); width: 92%; }
.post-images-4 { grid-template-columns: repeat(2, 1fr); width: 66%; }

.post-image {
  position: relative;
  overflow: hidden;
  border-radius: 3px;
  background-color: var(--primary-background);
  cursor: zoom-in;
}
.post-image > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  aspect-ratio: 1 / 1;
}
.post-images-1 .post-image > img {
  aspect-ratio: auto;
  max-height: 260px;
  width: auto;
  max-width: 100%;
  object-fit: cover;
}
.post-image-one { width: auto; }

.post-image-zzc {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(0, 0, 0, 0.5);
  color: #ffffff;
  font-size: 18px;
  font-weight: 500;
}

.post-video {
  width: 96%;
  margin-bottom: 10px;
  background-color: #000000;
  border-radius: 8px;
  overflow: hidden;
}
.post-video video {
  width: 100%;
  max-height: 500px;
  display: block;
  background-color: #000000;
}

/* 灯箱 */
.icefox-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background-color: var(--mask);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  cursor: zoom-out;
}
.icefox-lightbox.open { display: flex; }
.icefox-lightbox img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
  animation: zoomIn 0.22s ease-out;
}
.icefox-lightbox .lb-prev,
.icefox-lightbox .lb-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  font-size: 20px;
  cursor: pointer;
}
.icefox-lightbox .lb-prev { left: 16px; }
.icefox-lightbox .lb-next { right: 16px; }
.icefox-lightbox .lb-counter {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: #ffffff;
  font-size: 13px;
  opacity: 0.8;
}
@keyframes zoomIn {
  from { opacity: 0; transform: scale(0.94); }
  to { opacity: 1; transform: scale(1); }
}

/* =========================================================
   7. 点赞 / 评论区
   ========================================================= */
.post-comment-container {
  background-color: #f0f0f0;
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.6;
}

:root.dark .post-comment-container {
  background-color: #2e2e2e;
}

.pcc-like-list {
  color: var(--link);
}
.pcc-like-summary {
  display: flex;
  align-items: flex-start;
  gap: 5px;
  flex-wrap: wrap;
}
.pcc-like-summary svg {
  width: 14px;
  height: 14px;
  margin-top: 4px;
  flex: 0 0 14px;
  color: var(--link);
}
.pcc-like-names {
  flex: 1;
  color: var(--link);
  word-break: break-word;
}

.pcc-sep {
  height: 1px;
  margin: 6px 0;
  background-color: transparent;
}

.pcc-comment-list { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }

.pcc-comment-item {
  font-size: 14px;
  color: var(--text-color);
  word-break: break-word;
  line-height: 1.6;
}
.pcc-comment-item .pcc-author {
  color: var(--link);
  cursor: pointer;
}
.pcc-comment-item .pcc-author:hover { text-decoration: underline; }
.pcc-comment-item .pcc-reply-to { color: var(--text-sub-color); font-size: 13px; }
.pcc-comment-item .pcc-comment-content { color: var(--text-color); cursor: pointer; }
.pcc-comment-item .pcc-comment-content:hover { color: #4a5b7d; }

.pcc-empty { color: var(--text-sub-color); font-size: 13px; }

.pcc-expand {
  margin-top: 6px;
  font-size: 13px;
  color: var(--link);
  cursor: pointer;
  display: inline-block;
}

/* =========================================================
   8. 评论表单
   ========================================================= */
.comment-form-wrap {
  margin-top: 12px;
  padding: 12px;
  background-color: var(--primary-background);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.comment-form-wrap .cf-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-color);
}
.comment-form-wrap .cf-title .cf-reply-hint { color: var(--green); font-weight: 400; font-size: 12px; }

.comment-form-wrap .cf-fields {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}
.comment-form-wrap .cf-fields input {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background-color: var(--main-background);
  color: var(--text-color);
  font-size: 13px;
  font-family: inherit;
}
.comment-form-wrap textarea {
  width: 100%;
  min-height: 76px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background-color: var(--main-background);
  color: var(--text-color);
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  line-height: 1.6;
}
.comment-form-wrap input:focus,
.comment-form-wrap textarea:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 2px rgba(7, 193, 96, 0.12);
}

.cf-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
  position: relative;
}

.cf-emoji-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background-color: var(--main-background);
  color: var(--text-sub-color);
  font-size: 13px;
  cursor: pointer;
}
.cf-emoji-btn:hover { border-color: var(--green); }

.cf-submit {
  padding: 7px 20px;
  border: 0;
  border-radius: 6px;
  background-color: var(--green);
  color: #ffffff;
  font-size: 14px;
  cursor: pointer;
  transition: opacity 0.2s ease;
}
.cf-submit:hover { opacity: 0.88; }

.cf-emoji-panel {
  position: absolute;
  left: 0;
  bottom: 44px;
  z-index: 40;
  display: none;
  width: 100%;
  max-width: 320px;
  max-height: 220px;
  overflow-y: auto;
  padding: 10px;
  background-color: var(--main-background);
  border: 1px solid var(--green);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.cf-emoji-panel.show { display: block; }
.cf-emoji-panel .emoji-group-title {
  font-size: 12px;
  color: var(--text-sub-color);
  margin: 4px 0 6px;
}
.cf-emoji-panel .emoji-list {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  font-size: 20px;
  line-height: 1.2;
}
.cf-emoji-panel .emoji-list span {
  cursor: pointer;
  padding: 2px;
  border-radius: 4px;
}
.cf-emoji-panel .emoji-list span:hover { background-color: var(--primary-background-hover); }

.cf-cancel-reply {
  border: 0;
  background: none;
  color: var(--text-sub-color);
  font-size: 12px;
  cursor: pointer;
}

.comment-form-wrap input[type="text"],
.comment-form-wrap input[type="email"],
.comment-form-wrap input[type="url"] { width: 100%; }

.cf-error {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 6px;
  background-color: rgba(255, 68, 68, 0.1);
  color: #ff4444;
  font-size: 13px;
}

/* =========================================================
   9. 加载更多 / 底栏
   ========================================================= */
.scrollload-trigger {
  padding: 18px 20px 30px;
  text-align: center;
  color: var(--text-sub-color);
  font-size: 13px;
}
.scrollload-trigger .sl-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin: 0 2px;
  border-radius: 50%;
  background-color: var(--text-sub-color);
  animation: blink 1.2s infinite;
}
.scrollload-trigger .sl-dot:nth-child(2) { animation-delay: 0.2s; }
.scrollload-trigger .sl-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 0%, 100% { opacity: 0.2; } 50% { opacity: 1; } }

.scrollload-trigger.no-more { padding-bottom: 24px; }

.site-footer {
  padding: 16px 20px 26px;
  text-align: center;
  font-size: 12px;
  color: var(--text-sub-color);
  border-top: 1px solid var(--line);
  line-height: 1.8;
}
.site-footer a { color: var(--text-sub-color); }
.site-footer a:hover { color: var(--link); }
.site-footer .footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-bottom: 6px; }

/* =========================================================
   10. 音乐播放器
   ========================================================= */
.music-player {
  position: fixed;
  right: max(16px, calc(50% - 288px + 16px));
  bottom: 24px;
  z-index: 120;
  display: flex;
  align-items: center;
  gap: 10px;
}
.music-toggle {
  position: relative;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 50%;
  padding: 0;
  background-color: var(--main-background);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  cursor: pointer;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.music-toggle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.music-toggle .music-note {
  width: 20px;
  height: 20px;
  color: var(--link);
}
.music-toggle.playing { animation: spin 6s linear infinite; }
@keyframes spin { from { transform: rotate(0); } to { transform: rotate(360deg); } }

.music-panel {
  position: absolute;
  right: 0;
  bottom: 58px;
  width: 260px;
  max-height: 340px;
  display: none;
  flex-direction: column;
  background-color: var(--main-background);
  border-radius: 10px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.music-panel.show { display: flex; animation: fadeIn 0.22s ease-out; }

.music-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  color: var(--text-color);
  font-weight: 600;
}
.music-panel-head .mp-close {
  border: 0;
  background: none;
  color: var(--text-sub-color);
  font-size: 16px;
  cursor: pointer;
  line-height: 1;
}

.music-list {
  list-style: none;
  margin: 0;
  padding: 4px 0;
  overflow-y: auto;
  flex: 1;
}
.music-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-color);
}
.music-list li:hover { background-color: var(--primary-background); }
.music-list li.active { color: var(--green); }
.music-list li .ml-index { width: 16px; color: var(--text-sub-color); flex: 0 0 16px; }
.music-list li .ml-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.music-list li .ml-artist { color: var(--text-sub-color); font-size: 12px; }

/* =========================================================
   11. 设置面板（暗黑模式等）
   ========================================================= */
.settings-mask {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  background-color: rgba(0, 0, 0, 0.45);
  padding: 20px;
}
.settings-mask.show { display: flex; }

.settings-card {
  width: 100%;
  max-width: 320px;
  background-color: var(--main-background);
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  color: var(--text-color);
}
.settings-card h3 {
  margin: 0 0 14px;
  font-size: 15px;
  font-weight: 600;
}
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.settings-row:last-child { border-bottom: 0; }
.settings-hint { font-size: 12px; color: var(--text-sub-color); margin-top: 10px; }

.theme-switch {
  position: relative;
  width: 46px;
  height: 26px;
  border: 0;
  border-radius: 13px;
  background-color: #d0d0d0;
  cursor: pointer;
  transition: background-color 0.25s ease;
  padding: 0;
  flex: 0 0 46px;
}
.theme-switch.on { background-color: var(--green); }
.theme-switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background-color: #ffffff;
  transition: left 0.25s ease;
}
.theme-switch.on::after { left: 23px; }

.settings-close {
  display: block;
  width: 100%;
  margin-top: 14px;
  padding: 9px 0;
  border: 0;
  border-radius: 8px;
  background-color: var(--primary-background);
  color: var(--text-color);
  font-size: 14px;
  cursor: pointer;
}
.settings-close:hover { background-color: var(--primary-background-hover); }

/* =========================================================
   12. 单篇 / 归档 / 搜索 / 404
   ========================================================= */
.single-post-wrap { padding: 76px 20px 30px; }
.single-title {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-color);
}
.single-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
  color: var(--text-sub-color);
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.single-meta a { color: var(--link); }

.entry-content { font-size: 15px; line-height: 1.8; color: var(--text-color); }
.entry-content p { margin: 0 0 14px; }
.entry-content img { border-radius: 6px; }
.entry-content h2,
.entry-content h3 { margin: 22px 0 10px; font-size: 17px; }
.entry-content ul,
.entry-content ol { padding-left: 22px; }
.entry-content pre {
  padding: 14px;
  background-color: #2b2b2b;
  color: #e6e6e6;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.7;
}
.entry-content blockquote {
  margin: 14px 0;
  padding: 8px 14px;
  border-left: 3px solid var(--green);
  background-color: var(--primary-background);
  color: var(--text-sub-color);
}
.entry-content code {
  background-color: var(--primary-background);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 13px;
}

.post-tags { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 8px; }
.post-tags a {
  padding: 3px 10px;
  border-radius: 12px;
  background-color: var(--primary-background);
  color: var(--text-sub-color);
  font-size: 12px;
}
.post-tags a:hover { color: var(--link); text-decoration: none; }

.page-head {
  padding: 20px;
  padding-top: 78px;
  border-bottom: 1px solid var(--line);
}
.page-head h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-color);
}
.page-head p { margin: 6px 0 0; font-size: 13px; color: var(--text-sub-color); }

.archive-list { padding: 16px 20px 28px; display: flex; flex-direction: column; gap: 12px; }
.archive-item {
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--line);
}
.archive-item a { color: var(--text-color); font-size: 14px; }
.archive-item a:hover { color: var(--link); }
.archive-item .ai-date { display: block; font-size: 12px; color: var(--text-sub-color); margin-top: 3px; }

.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 20px;
  font-size: 13px;
}
.pagination a,
.pagination span {
  padding: 5px 12px;
  border-radius: 6px;
  background-color: var(--primary-background);
  color: var(--text-sub-color);
}
.pagination .current { background-color: var(--green); color: #ffffff; }

.nothing-found { padding: 60px 20px; text-align: center; color: var(--text-sub-color); }

/* =========================================================
   13. 前端发布页
   ========================================================= */
.publish-wrap { padding: 76px 20px 30px; }
.publish-card {
  background-color: var(--main-background);
  border-radius: 10px;
}
.publish-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 12px;
}
.publish-toolbar h2 { margin: 0; font-size: 15px; font-weight: 600; }
.publish-toolbar .pv-cancel { font-size: 13px; color: var(--text-sub-color); }

.publish-input,
.publish-textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text-color);
  background-color: var(--main-background);
  line-height: 1.7;
}
.publish-textarea { min-height: 140px; resize: vertical; }
.publish-input:focus,
.publish-textarea:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 2px rgba(7, 193, 96, 0.12);
}

.publish-images {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.publish-image-item {
  position: relative;
  width: 84px;
  height: 84px;
  border-radius: 6px;
  overflow: hidden;
  background-color: var(--primary-background);
}
.publish-image-item img { width: 100%; height: 100%; object-fit: cover; }
.publish-image-item .pi-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 50%;
  background-color: rgba(0, 0, 0, 0.6);
  color: #ffffff;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
}

.publish-add-image {
  width: 84px;
  height: 84px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--line);
  border-radius: 6px;
  background-color: var(--primary-background);
  color: var(--text-sub-color);
  font-size: 26px;
  cursor: pointer;
}
.publish-add-image:hover { border-color: var(--green); color: var(--green); }

.publish-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.publish-row svg { width: 16px; height: 16px; color: var(--text-sub-color); flex: 0 0 16px; }
.publish-row input[type="text"],
.publish-row input[type="url"] {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--text-color);
  font-size: 14px;
  font-family: inherit;
}
.publish-row input:focus { outline: none; }

.publish-row .pv-ad { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-sub-color); }

.publish-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
}
.publish-actions .pv-count { font-size: 12px; color: var(--text-sub-color); }
.publish-actions .pv-submit {
  padding: 9px 26px;
  border: 0;
  border-radius: 8px;
  background-color: var(--green);
  color: #ffffff;
  font-size: 15px;
  cursor: pointer;
}
.publish-actions .pv-submit:hover { opacity: 0.9; }

.publish-notice {
  margin-bottom: 14px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
}
.publish-notice.ok { background-color: rgba(7, 193, 96, 0.12); color: var(--green); }
.publish-notice.err { background-color: rgba(255, 68, 68, 0.12); color: #ff4444; }

.publish-guest {
  padding: 70px 20px;
  text-align: center;
  color: var(--text-sub-color);
}
.publish-guest a { color: var(--link); }

/* =========================================================
   14. 表情选择器在发布页复用
   ========================================================= */
.emoji-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background-color: var(--primary-background);
  font-size: 18px;
  cursor: pointer;
}
.emoji-trigger:hover { border-color: var(--green); }

/* =========================================================
   15. 响应式
   ========================================================= */
@media (max-width: 576px) {
  .header-container { height: 240px; }
  .post-list { padding-top: 64px; }
  .post-item { padding: 0 14px; }
  .music-player { right: 16px; bottom: 16px; }
  .music-panel { width: 240px; }
  .post-time-comment-modal { width: 140px; }
}
