/* 重置 */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: "Microsoft YaHei", "PingFang SC", sans-serif; background: #0d0d0d; color: #ccc; line-height: 1.6; }

/* 导航 */
header { background: #111; border-bottom: 1px solid #222; padding: 0 1rem; }
nav { max-width: 960px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; height: 50px; }
#hamburger-btn { display: none; background: none; border: none; color: #aaa; font-size: 1.4rem; cursor: pointer; padding: 4px 8px; margin-right: 4px; flex-shrink: 0; }
#hamburger-btn:hover { color: #fff; }
.nav-brand { display: flex; align-items: baseline; gap: 0.4rem; flex-shrink: 0; }
.logo { color: #fff; text-decoration: none; font-weight: bold; font-size: 1.1rem; }
#nav-clock { color: #39C5BB; font-size: 0.8rem; font-weight: normal; white-space: nowrap; transition: color 1s ease; }
nav ul { list-style: none; display: flex; gap: 1.2rem; }
nav a { color: #888; text-decoration: none; font-size: 0.9rem; transition: color .2s; }
nav a:hover { color: #fff; }
#nav-userbox { position: relative; flex-shrink: 0; }
#nav-avatar { width: 40px; height: 40px; border-radius: 6px; object-fit: cover; cursor: pointer; border: 1px solid #333; background: #1a1a1a; }
.nav-dropdown { display: none; position: absolute; right: 0; top: 48px; background: #1a1a1a; border: 1px solid #333; border-radius: 6px; min-width: 120px; z-index: 100; padding: 4px 0; }
#nav-userbox.drop-open .nav-dropdown { display: block; }
.nav-dropdown a { display: block; padding: 8px 16px; color: #ccc; text-decoration: none; font-size: 0.85rem; }
.nav-dropdown a:hover { background: #2a2a2a; color: #fff; }

/* 侧边栏 */
#sidebar-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 200; display: none; }
#sidebar-overlay.open { display: block; }
#sidebar { display: block; position: fixed; top: 0; left: -260px; width: 240px; height: 100%; background: #111; border-right: 1px solid #222; z-index: 201; transition: left .3s ease; overflow-y: auto; padding: 4px 0; }
#sidebar.open { left: 0; }
#sidebar .sidebar-header { display: flex; justify-content: space-between; align-items: center; padding: 8px 14px; border-bottom: 1px solid #222; }
#sidebar .sidebar-header span { color: #fff; font-size: 0.85rem; }
#sidebar .sidebar-header button { background: none; border: none; color: #888; font-size: 1rem; cursor: pointer; }
#sidebar a { display: block; padding: 10px 16px; color: #ccc; text-decoration: none; font-size: 0.95rem; line-height: 1.4 !important; margin: 0 !important; border: 0 !important; white-space: nowrap; }
#sidebar a:hover { background: #1a1a1a; color: #fff; }

/* 主体 */
main { max-width: 960px; margin: 2rem auto; padding: 0 1rem; min-height: 70vh; }
.page { display: none; }
.page.active { display: block; }
h1 { color: #fff; font-size: 1.8rem; margin-bottom: 1rem; }
h2 { color: #ddd; font-size: 1.3rem; margin: 1.5rem 0 0.8rem; }
p { margin-bottom: 0.8rem; }

/* 日志列表 */
.log-list { list-style: none; }
.log-list li { border-bottom: 1px solid #1a1a1a; padding: 0.8rem 0; }
.log-list a { color: #ccc; text-decoration: none; font-size: 1rem; }
.log-list .date { color: #555; font-size: 0.8rem; margin-right: 0.8rem; }

/* 页脚 */
footer { text-align: center; padding: 1rem 1rem 4rem 1rem; color: #444; font-size: 0.8rem; border-top: 1px solid #1a1a1a; }

/* ===== 打赏页面 ===== */
.donate-grid { display: flex; gap: 20px; justify-content: center; flex-wrap: wrap; }
.donate-card { background: #111; border: 1px solid #222; border-radius: 8px; padding: 20px; text-align: center; min-width: 200px; max-width: 240px; flex: 1; }
.donate-card-title { color: #fff; font-size: 1rem; margin-bottom: 12px; font-weight: bold; }
.donate-qr { width: 180px; height: 180px; border-radius: 6px; border: 1px solid #333; background: #1a1a1a; object-fit: contain; }
.donate-link { display: inline-block; padding: 10px 20px; background: #2a2a2a; color: #fff; text-decoration: none; border-radius: 4px; font-size: 0.9rem; transition: background .2s; }
.donate-link:hover { background: #3a3a3a; }
.donate-hint { color: #555; font-size: 0.75rem; margin-top: 8px; }

/* ===== BGM 控件 ===== */
#bgm-wrapper { position: fixed; bottom: 1.2rem; right: 1.2rem; z-index: 999; display: flex; align-items: center; gap: 0; }

/* 音量切换按钮 */
#bgm-vol-toggle { flex-shrink: 0; width: 22px; height: 44px; border: 1px solid #333; border-right: none; background: #1a1a1a; color: #555; font-size: 0.55rem; cursor: pointer; border-radius: 6px 0 0 6px; z-index: 3; transition: color .2s, background .2s; display: flex; align-items: center; justify-content: center; outline: none; -webkit-tap-highlight-color: transparent; }
#bgm-vol-toggle:hover { color: #aaa; background: #222; }

/* 主按钮 */
#bgm-btn { flex-shrink: 0; width: 44px; height: 44px; border-radius: 50%; background: #1a1a1a; border: 1px solid #333; color: #fff; font-size: 1.3rem; cursor: pointer; transition: background .2s; display: flex; align-items: center; justify-content: center; z-index: 2; outline: none; -webkit-tap-highlight-color: transparent; }
#bgm-btn:hover { background: #2a2a2a; }
#bgm-btn.spin { animation: bgmSpin 4s linear infinite; }

@keyframes bgmSpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* 音量条 —— 从按钮右侧展开 */
#bgm-vol { flex-shrink: 0; height: 44px; max-width: 0; width: 0; margin: 0; padding: 0; border: 1px solid #333; border-left: none; opacity: 0; overflow: hidden; cursor: pointer; accent-color: #888; background: #1a1a1a; border-radius: 0 6px 6px 0; transition: max-width .3s ease, width .3s ease, opacity .3s ease; outline: none; -webkit-tap-highlight-color: transparent; }

/* 展开 */
#bgm-wrapper.vol-open #bgm-vol { max-width: 90px; width: 90px; opacity: 1; }

/* 桌面 hover（移动端不触发） */
#bgm-wrapper.allow-hover:hover #bgm-vol { max-width: 90px; width: 90px; opacity: 1; }

/* ===== 工时猫 ===== */
.workcat-desc { color: #666; margin-bottom: 1.2rem; }
.workcat-form { background: #111; border: 1px solid #222; border-radius: 8px; padding: 1.2rem; max-width: 420px; }
.workcat-row { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.8rem; }
.workcat-row label { width: 50px; color: #aaa; font-size: 0.85rem; flex-shrink: 0; }
.workcat-row input { background: #1a1a1a; border: 1px solid #333; color: #fff; padding: 0.4rem 0.6rem; border-radius: 4px; font-size: 0.9rem; outline: none; }
.workcat-row input:focus { border-color: #666; }
.workcat-btn { display: block; width: 100%; margin-top: 1rem; padding: 0.6rem; background: #2a2a2a; border: 1px solid #444; color: #fff; border-radius: 6px; cursor: pointer; font-size: 0.95rem; transition: background .2s; }
.workcat-btn:hover { background: #3a3a3a; }
.workcat-result { margin-top: 1.5rem; background: #111; border: 1px solid #222; border-radius: 8px; padding: 1.2rem; max-width: 420px; }
.workcat-result h2 { margin: 0 0 0.8rem 0; }
.wc-hours { font-size: 1.1rem; color: #fff; margin-bottom: 0.4rem; }
.wc-hours span { color: #ffa500; font-weight: bold; }
.wc-detail { color: #555; font-size: 0.85rem; margin-top: 0.5rem; }
.wc-detail { color: #555; font-size: 0.85rem; margin-top: 0.5rem; }

/* ===== 转场动画 ===== */
@keyframes pageFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* 手机适配 */
@media (max-width: 600px) {
  #hamburger-btn { display: block; }
  nav { flex-direction: row; height: 50px; padding: 0 0.6rem; gap: 0; }
  nav ul { display: none; }
  .nav-brand { flex: 1; justify-content: flex-start; min-width: 0; }
  .logo { font-size: 1rem; }
  #nav-clock { font-size: 0.7rem; }
  main { margin: 1.2rem auto; min-height: 60vh; }
  h1 { font-size: 1.4rem; }
  h2 { font-size: 1.1rem; }
  #bgm-wrapper { bottom: 1rem; right: 1rem; }
  #bgm-btn { width: 40px; height: 40px; font-size: 1.1rem; }
  #bgm-vol-toggle { width: 20px; height: 40px; font-size: 0.5rem; }
  #bgm-vol { height: 40px; }
  #bgm-wrapper.vol-open #bgm-vol { max-width: 75px; width: 75px; }
}
