/* 都柏林的雪 · 全站样式（唯一的样式表） */
:root {
  --panel: rgba(0, 0, 0, .55);
  --panel-solid: rgba(0, 0, 0, .72);
  --glass: rgba(255, 255, 255, .18);
  --glass-hover: rgba(255, 255, 255, .4);
  --cream: #fff8dc;
  --radius: 10px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  font-family: Georgia, "Songti SC", "STSong", serif;
  color: #fff;
  text-align: center;
  background-color: #0d1117;          /* 背景图加载不出来时也不会白底白字 */
  background-repeat: no-repeat;
  background-position: center center;
  background-attachment: fixed;
  background-size: cover;
  background-image: linear-gradient(rgba(0, 0, 0, .3), rgba(0, 0, 0, .3)),
                    url('https://resource-17v.pages.dev/auc.jpg');
}
/* 背景随视图切换（data-view 由 app.js 的 route() 写在 body 上） */
body[data-view="books"]   { background-image: linear-gradient(rgba(0,0,0,.3), rgba(0,0,0,.3)), url('https://resource-17v.pages.dev/books.png'); }
body[data-view="movies"]  { background-image: linear-gradient(rgba(0,0,0,.3), rgba(0,0,0,.3)), url('https://resource-17v.pages.dev/movies.png'); }
body[data-view="journal"] { background-image: linear-gradient(rgba(0,0,0,.3), rgba(0,0,0,.3)), url('https://resource-17v.pages.dev/journal.png'); }

h1 { font-size: 38px; margin: 0 0 6px; text-shadow: 2px 2px 5px rgba(0, 0, 0, .6); }
h1 a { color: inherit; text-decoration: none; }
h2 { font-size: 24px; margin: 0 0 10px; text-shadow: 1px 1px 4px rgba(0,0,0,.6); }
h3 { font-size: 20px; margin: 18px 0 8px; }
.hidden { display: none !important; }
a { color: var(--cream); }
.hint { font-size: 14px; opacity: .8; margin: 0 0 14px; }

.container { max-width: 900px; margin: 5vh auto 6vh; padding: 0 16px; }
body[data-view="home"] .container { margin-top: 12vh; }
body[data-view="settings"] .container { max-width: 560px; margin-top: 8vh; }

nav { margin-bottom: 10px; }
.btn {
  display: inline-block;
  background: var(--glass);
  color: #fff;
  padding: 9px 18px;
  margin: 5px;
  text-decoration: none;
  border-radius: 6px;
  font-size: 18px;
  transition: background .3s;
}
.btn:hover { background: var(--glass-hover); }
.btn.active { background: rgba(255, 255, 255, .88); color: #000; }

/* ---------- 播放器 ---------- */
.music-player {
  margin: 16px auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: var(--glass);
  border-radius: var(--radius);
  padding: 10px 14px;
  width: min(340px, 100%);
}
.music-player .controls { width: 100%; }
.music-player button {
  background: none;
  border: none;
  color: #fff;
  font-size: 17px;
  font-family: inherit;
  cursor: pointer;
  padding: 4px 8px;
}
.music-player button:hover { opacity: .7; }
.music-title { font-size: 14px; opacity: .85; margin: 0 0 8px; word-break: break-all; }
.music-hint { font-size: 14px; opacity: .85; margin: 12px 0 0; }
.progress-container {
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, .3);
  margin: 6px 0 10px;
  border-radius: 3px;
  cursor: pointer;
  overflow: hidden;
}
#music-progress { height: 100%; width: 0; background: #fff; }
.controls { display: flex; justify-content: space-around; }

/* ---------- 首页诗句 ---------- */
.poem {
  display: inline-block;
  max-width: 60%;
  margin: 14px auto 0;
  padding: 18px 22px;
  background: rgba(0, 0, 0, .5);
  border-radius: var(--radius);
  font-style: italic;
}
.poem h3 { font-size: 19px; margin: 0 0 8px; }
.poem p { font-size: 14px; line-height: 1.5; margin: 6px 0; }

/* ---------- 通用按钮 ---------- */
.add-btn,
.f-submit,
.f-cancel,
.save-btn,
.cancel-btn,
.export-btn,
.import-btn,
.music-add-btn {
  display: inline-block;
  background: rgba(0, 0, 0, .7);
  color: #fff;
  border: none;
  padding: 12px 20px;
  border-radius: var(--radius);
  font-size: 16px;
  font-family: inherit;
  cursor: pointer;
  transition: background .3s;
}
.add-btn:hover,
.f-submit:hover,
.f-cancel:hover,
.save-btn:hover,
.cancel-btn:hover,
.export-btn:hover,
.import-btn:hover,
.music-add-btn:hover { background: rgba(255, 255, 255, .55); color: #000; }
.add-btn { display: block; margin: 18px auto 0; }
.buttons { display: flex; justify-content: center; flex-wrap: wrap; gap: 16px; margin: 20px 0; }

/* ---------- 输入框 ---------- */
.search-input,
.entry-text,
.music-input {
  width: 100%;
  padding: 10px;
  border: none;
  border-radius: 6px;
  font-size: 15px;
  font-family: inherit;
}
.search-input { width: min(420px, 100%); margin: 4px auto 0; display: block; }
.entry-text { min-height: 130px; margin: 16px 0 0; resize: vertical; }

/* ---------- 书架 / 影单 ---------- */
.category-container { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin: 14px 0; }
.category-button {
  background: rgba(0, 0, 0, .45);
  color: #fff;
  border: none;
  padding: 9px 14px;
  border-radius: var(--radius);
  font-size: 15px;
  font-family: inherit;
  cursor: pointer;
  transition: background .3s;
}
.category-button:hover { background: rgba(255, 255, 255, .45); color: #000; }
.category-button.active { background: rgba(255, 255, 255, .88); color: #000; }
.category-quote { font-style: italic; color: var(--cream); margin: 6px 0 16px; min-height: 1.3em; }
.lib-list { max-width: 640px; margin: 18px auto; }

.entry-card {
  background: var(--panel-solid);
  padding: 14px 16px;
  border-radius: var(--radius);
  margin-bottom: 14px;
  color: #f0f0f0;
  text-align: left;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .5);
}
.entry-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; }
.entry-head strong { font-size: 16px; }
.by { font-size: 14px; opacity: .8; }
.actions { margin-left: auto; display: flex; gap: 6px; }
.icon-btn {
  background: rgba(255, 255, 255, .18);
  border: none;
  color: #fff;
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
}
.icon-btn:hover { background: rgba(255, 255, 255, .4); color: #000; }
.icon-btn.danger { background: rgba(200, 40, 40, .65); }
.icon-btn.danger:hover { background: rgb(220, 50, 50); color: #fff; }
.meta { font-size: 13px; opacity: .9; margin-top: 6px; }
.stars { color: #8a8a8a; letter-spacing: 1px; }
.stars .on { color: gold; }
.tag { color: var(--cream); margin-left: 4px; }
.review { margin: 8px 0 0; font-size: 14px; line-height: 1.6; opacity: .95; }
.empty { font-size: 15px; opacity: .75; padding: 24px; }

.entry-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 640px;
  margin: 16px auto;
  padding: 16px;
  background: var(--panel-solid);
  border-radius: var(--radius);
  text-align: left;
}
.entry-form input,
.entry-form textarea {
  width: 100%;
  padding: 9px;
  border: none;
  border-radius: 6px;
  font-size: 15px;
  font-family: inherit;
}
.entry-form textarea { min-height: 80px; resize: vertical; }
.entry-form .buttons { margin: 4px 0 0; }

.rating { cursor: pointer; }
.entry-form .rating { display: flex; gap: 6px; }
.star { font-size: 20px; color: #8a8a8a; user-select: none; }
.star:hover, .star.selected { color: gold; }

.pager { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin-top: 18px; }
.page-button {
  background: rgba(0, 0, 0, .55);
  color: #fff;
  border: none;
  padding: 7px 12px;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
}
.page-button:hover:not(:disabled) { background: rgba(255, 255, 255, .45); color: #000; }
.page-button.active-page { background: #fff; color: #000; }
.page-button:disabled { opacity: .35; cursor: default; }

/* ---------- 心境手札 ---------- */
.view[data-view="journal"] {
  background: var(--panel-solid);
  border-radius: 12px;
  padding: 22px;
  text-align: left;
  box-shadow: 0 0 14px rgba(255, 255, 255, .15);
}
.view[data-view="journal"] h2 { text-align: center; font-style: italic; }
.tab-buttons { display: flex; justify-content: space-around; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.tab-buttons button {
  background: none;
  border: 1px solid #fff;
  border-radius: 5px;
  color: #fff;
  padding: 8px 15px;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: .3s;
}
.tab-buttons button:hover,
.tab-buttons button.active { background: #fff; color: #000; }
.entry {
  position: relative;
  background: rgba(255, 255, 255, .1);
  padding: 12px 14px;
  margin-top: 10px;
  border-radius: 6px;
}
.entry h3 { margin: 0 0 6px; font-size: 13px; font-weight: normal; opacity: .7; }
.entry .actions { position: absolute; top: 10px; right: 14px; }
.entry-body { font-size: 15px; line-height: 1.65; overflow-wrap: anywhere; }
.entry-body p { margin: .4em 0; }
.entry-body img { max-width: 100%; }

/* ---------- 设置 ---------- */
.music-add { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-bottom: 6px; }
.music-add .music-input { flex: 1 1 240px; width: auto; }
.music-list { list-style: none; padding: 0; margin: 10px 0 0; }
.music-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 10px;
  margin: 6px 0;
  background: rgba(255, 255, 255, .12);
  border-radius: 5px;
  font-size: 14px;
  text-align: left;
  word-break: break-all;
}
.music-list .name { flex: 1; cursor: pointer; }
.music-list .name:hover { text-decoration: underline; }

/* ---------- 小屏 ---------- */
@media (max-width: 640px) {
  body { background-attachment: scroll; }
  h1 { font-size: 30px; }
  .container { margin-top: 5vh; }
  body[data-view="home"] .container { margin-top: 8vh; }
  .poem { max-width: 94%; padding: 14px; }
  .category-container { gap: 6px; }
  .category-button { font-size: 14px; padding: 8px 10px; }
  .music-player { width: auto; }
  .buttons { gap: 10px; }
  .add-btn, .f-submit, .f-cancel, .save-btn, .cancel-btn,
  .export-btn, .import-btn, .music-add-btn { padding: 11px 14px; font-size: 15px; }
  .view[data-view="journal"] { padding: 14px; }
}
