:root {
  color-scheme: light;
  --bg: #f7f7f7;
  --white: #fff;
  --green: #072;
  --text: #111;
  --muted: #666;
  --link: #3377aa;
  --line: #e5e5e5;
  --tag: #f2f8f2;
  --font: Helvetica, Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.62 var(--font); }
a { color: var(--link); text-decoration: none; }
a:hover { background: #37a; color: #fff; }
button, input, select, textarea { font: inherit; }
.wrap { width: 1040px; margin: 0 auto; }

.topbar { background: #545652; color: #d5d5d5; }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 28px; }
.brand, .topbar-links a { color: #d5d5d5; font-size: 12px; }
.topbar-links { display: flex; gap: 18px; }
.topbar-links a:hover { background: transparent; color: #fff; }

.searchbar { background: #f0f3ef; border-bottom: 1px solid #e3e9e2; }
.searchbar-inner { display: flex; align-items: center; gap: 28px; padding: 20px 0 18px; }
.searchbar-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.logo-main { display: block; color: var(--green); font-size: 30px; font-weight: 700; line-height: 1; }
.logo-sub { display: block; margin-top: 4px; color: #777; font-size: 12px; }
.search-form { display: flex; width: 420px; }
.search-form input { flex: 1; height: 34px; padding: 0 12px; border: 1px solid #c3c3c3; border-right: 0; background: #fff; }
.search-form button { width: 56px; border: 1px solid #c3c3c3; background: #9db6c5; color: #fff; cursor: pointer; }
.create-button, .submit-button { height: 34px; padding: 0 16px; border: 1px solid #528641; border-radius: 3px; background: #8fbe80; color: #fff; cursor: pointer; }
.secondary-create-button { background: #a4b999; border-color: #7f9d72; }

.channel-nav-inner { display: flex; gap: 18px; padding: 10px 0; }
.channel-link { padding: 0; border: 0; background: transparent; color: #2277aa; cursor: pointer; }
.channel-link.is-active { color: var(--green); font-weight: 700; }

.layout { display: grid; grid-template-columns: 1fr 300px; gap: 40px; padding: 30px 0 60px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.page-title { margin: 0; color: #494949; font-size: 28px; line-height: 1.2; }
.page-description { margin: 10px 0 0; max-width: 620px; color: var(--muted); }
.page-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; color: #999; font-size: 12px; }

.panel { margin-bottom: 28px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.panel-head h2, .side-panel h3 { margin: 0; color: #072; font-size: 16px; font-weight: 700; }
.media-actions, .status-buttons, .status-options { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-panel { padding: 14px 16px; background: #fff; border: 1px solid #eee; }
.filter-tabs { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; }
.filter-tab { padding: 0; border: 0; background: transparent; color: #3377aa; cursor: pointer; }
.filter-tab.is-active { color: var(--green); font-weight: 700; }
.filter-row { display: flex; flex-wrap: wrap; align-items: end; gap: 14px 18px; }
.filter-control { display: flex; flex-direction: column; gap: 6px; min-width: 120px; }
.filter-control span { color: #666; font-size: 12px; }
.filter-control select { min-width: 120px; padding: 6px 8px; border: 1px solid #ccc; background: #fff; }
.filter-checks { display: flex; flex-wrap: wrap; gap: 14px; margin-left: auto; color: #444; }
.filter-checks label { display: inline-flex; align-items: center; gap: 6px; }
.status-pill { padding: 3px 10px; border: 1px solid #d8e7d3; border-radius: 12px; background: var(--tag); color: #5a7b51; font-size: 12px; }
.media-actions .status-pill { cursor: pointer; }
.status-pill.is-on { background: #8fbe80; border-color: #8fbe80; color: #fff; }

.entry-list { display: grid; gap: 16px; }
.entry-item { border-bottom: 1px solid var(--line); padding-bottom: 16px; }
.entry-open { display: grid; grid-template-columns: 90px 1fr; gap: 16px; width: 100%; padding: 0; border: 0; background: transparent; text-align: left; cursor: pointer; }
.entry-cover { width: 90px; height: 128px; object-fit: cover; box-shadow: 0 1px 3px rgba(0,0,0,.18); }
.entry-headline { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.entry-name { margin: 0; color: var(--link); font-size: 18px; font-weight: 400; }
.entry-score { color: #e09015; font-size: 13px; }
.entry-meta, .entry-review { margin: 6px 0 0; color: #666; }
.entry-bottom { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; }

.poster-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px 16px; }
.poster-open { width: 100%; padding: 0; border: 0; background: transparent; text-align: left; cursor: pointer; }
.poster-image { width: 100%; aspect-ratio: 0.72; object-fit: cover; background: #eee; box-shadow: 0 1px 3px rgba(0,0,0,.18); }
.poster-title { margin: 8px 0 0; color: var(--link); font-size: 14px; font-weight: 400; }
.poster-creator, .poster-rating { margin-top: 4px; color: #666; font-size: 12px; }

.side-column { display: grid; gap: 18px; align-content: start; }
.side-panel { padding: 14px 16px; background: #fff; border: 1px solid #eee; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.tag-cloud .tag { background: var(--tag); }
.tag { display: inline-flex; align-items: center; min-height: 26px; padding: 0 10px; border: 0; border-radius: 13px; background: var(--tag); color: #5a7b51; font-size: 12px; cursor: pointer; }
.tag.is-on { background: #8fbe80; color: #fff; }
.rank-list { margin: 12px 0 0; padding-left: 18px; color: #666; }
.rank-list li + li { margin-top: 8px; }
.utility-links { display: grid; gap: 8px; margin-top: 12px; }
.utility-link { padding: 0; border: 0; background: transparent; color: var(--link); text-align: left; cursor: pointer; }
.custom-lists { display: grid; gap: 10px; margin-top: 12px; }
.custom-list-card { padding: 10px 12px; background: #f8fbf8; border: 1px solid #e3ece3; cursor: pointer; }
.custom-list-card.is-active { background: #edf6ed; border-color: #bcd4b9; }
.custom-list-title { margin: 0; color: #3377aa; font-size: 14px; }
.custom-list-meta { margin-top: 4px; color: #666; font-size: 12px; }

.modal-backdrop { position: fixed; inset: 0; z-index: 30; background: rgba(0,0,0,.35); }
.modal-shell { display: flex; min-height: 100%; align-items: center; justify-content: center; padding: 20px; }
.detail-modal, .entry-modal { position: relative; width: min(920px, 100%); max-height: calc(100vh - 40px); overflow: auto; background: #fff; border-radius: 4px; }
.window-chrome { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; height: 44px; padding: 0 14px; border-bottom: 1px solid #eee; background: rgba(255,255,255,.96); }
.window-controls { display: flex; gap: 8px; }
.window-control { width: 12px; height: 12px; padding: 0; border: 0; border-radius: 999px; cursor: pointer; }
.window-control.is-close { background: #ff5f57; }
.window-control.is-minimize { background: #febc2e; }
.window-control.is-maximize { background: #28c840; }
.detail-modal.is-minimized, .entry-modal.is-minimized { max-height: 44px; overflow: hidden; }
.detail-modal.is-minimized > :not(.window-chrome), .entry-modal.is-minimized > :not(.window-chrome) { display: none; }
.detail-modal.is-maximized, .entry-modal.is-maximized { width: min(1280px, calc(100vw - 24px)); max-height: calc(100vh - 24px); }
.detail-layout { display: grid; grid-template-columns: 240px 1fr; gap: 24px; padding: 28px; }
.detail-cover { width: 100%; box-shadow: 0 1px 3px rgba(0,0,0,.18); }
.detail-category, .detail-label { margin: 0; color: #999; font-size: 12px; }
.detail-title { margin: 8px 0 0; color: #494949; font-size: 28px; line-height: 1.25; }
.detail-info { margin-top: 16px; color: #666; }
.detail-info p { margin: 6px 0; }
.detail-info span { display: inline-block; min-width: 92px; color: #999; }
.star-row { display: flex; gap: 4px; margin-top: 8px; }
.star-row span { color: #f99f1b; font-size: 18px; }
.star-row span.empty { color: #ddd; }
.detail-review, .detail-rating, .detail-status { margin-top: 18px; }
.detail-review p:last-child { margin: 8px 0 0; color: #444; }
.douban-link-button { display: inline-block; margin-top: 18px; padding: 6px 14px; border: 1px solid #c3d7c0; border-radius: 3px; background: #f2f8f2; color: #3377aa; }

.entry-modal { padding: 0 28px 28px; }
.entry-title { margin: 28px 0 0; color: #494949; font-size: 24px; }
.entry-copy { margin: 8px 0 0; color: #666; }
.entry-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; margin-top: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field span { color: #666; }
.field input, .field select, .field textarea { width: 100%; padding: 8px 10px; border: 1px solid #ccc; border-radius: 3px; background: #fff; }
.tag-picker { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 0; }
.tag-option { cursor: pointer; }
.tag-option.is-on { background: #8fbe80; color: #fff; border-color: #8fbe80; }
.field-wide { grid-column: 1 / -1; }
.entry-actions { display: flex; gap: 10px; grid-column: 1 / -1; }
.cancel-button { padding: 0 16px; border: 1px solid #ccc; border-radius: 3px; background: #f5f5f5; cursor: pointer; }
.hover-preview { position: fixed; z-index: 40; width: 320px; pointer-events: none; background: #fff; border: 1px solid #ddd; box-shadow: 0 6px 20px rgba(0,0,0,.15); }
.hover-preview-inner { padding: 18px 18px 16px; }
.hover-preview h3 { margin: 0; color: #3377aa; font-size: 20px; font-weight: 400; line-height: 1.35; }
.compact-stars { margin-top: 10px; }
.preview-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.preview-meta span { padding: 4px 10px; border-radius: 16px; background: #f5f5f5; color: #666; }
.preview-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.preview-review { margin: 14px 0 0; color: #666; line-height: 1.7; }
.hidden { display: none; }

@media (max-width: 1100px) {
  .wrap { width: auto; margin: 0 16px; }
  .layout { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .searchbar-inner, .page-head, .entry-open, .detail-layout, .entry-form { display: grid; grid-template-columns: 1fr; }
  .searchbar-actions { margin-left: 0; }
  .search-form { width: 100%; }
  .topbar-inner, .channel-nav-inner { overflow: auto; }
  .poster-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-row { flex-direction: column; align-items: stretch; }
  .filter-checks { margin-left: 0; }
}
