/* NovelTube styles */
* { box-sizing: border-box; }
body { margin: 0; font-family: "Hiragino Kaku Gothic ProN", "Noto Sans JP", Meiryo, sans-serif; }

.header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  background: #0f0f0f; border-bottom: 1px solid #272727;
}
.header-inner {
  display: flex; align-items: center; gap: 16px;
  height: 56px; padding: 0 16px; max-width: 100%;
}
.icon-btn {
  background: none; border: none; color: #fff; font-size: 18px;
  cursor: pointer; padding: 8px; border-radius: 50%;
}
.icon-btn:hover { background: #272727; }
.logo { display: flex; align-items: center; gap: 6px; text-decoration: none; flex-shrink: 0; }
.logo-play {
  width: 30px; height: 22px; background: #ff0000; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 10px;
}
.logo-text { color: #fff; font-weight: 700; font-size: 19px; letter-spacing: -0.5px; }
.logo-sub {
  color: #aaa; font-size: 11px; border: 1px solid #444;
  border-radius: 4px; padding: 1px 5px;
}
.search-box {
  flex: 1; max-width: 560px; margin: 0 auto; display: flex;
  border: 1px solid #303030; border-radius: 24px; overflow: hidden; background: #121212;
}
.search-box input {
  flex: 1; background: transparent; border: none; outline: none;
  color: #eee; padding: 9px 16px; font-size: 15px;
}
.search-box button {
  background: #222; border: none; color: #ccc; padding: 0 20px; cursor: pointer;
}
.search-box button:hover { background: #303030; }
.upload-btn {
  display: flex; align-items: center; gap: 7px;
  background: #272727; color: #fff; border: none; border-radius: 20px;
  padding: 8px 16px; cursor: pointer; font-size: 14px; flex-shrink: 0;
}
.upload-btn:hover { background: #3d3d3d; }

.layout { display: flex; padding-top: 56px; min-height: 100vh; }
.sidebar {
  position: fixed; top: 56px; bottom: 0; left: 0;
  width: 216px; background: #0f0f0f; padding: 12px 8px;
  overflow-y: auto; transition: transform 0.2s;
}
.sidebar-hidden { transform: translateX(-216px); }
.side-item {
  display: flex; align-items: center; gap: 18px;
  padding: 9px 14px; border-radius: 10px; color: #eee;
  text-decoration: none; font-size: 14px; cursor: pointer;
}
.side-item:hover { background: #272727; }
.side-item.active { background: #272727; font-weight: 600; }
.side-item i { width: 20px; text-align: center; color: #aaa; }
.side-title {
  color: #aaa; font-size: 12px; font-weight: 600;
  margin: 16px 14px 6px; text-transform: uppercase; letter-spacing: 0.5px;
}
.side-foot { color: #555; font-size: 11px; margin: 24px 14px; }

.main-area { flex: 1; margin-left: 216px; }
.content { padding: 20px 24px 60px; max-width: 1280px; }

/* Chips & sorts */
.chip-row { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 8px; }
.chip {
  white-space: nowrap; background: #272727; color: #eee; border: 1px solid #333;
  border-radius: 8px; padding: 7px 14px; cursor: pointer; font-size: 13px;
}
.chip:hover { background: #3d3d3d; }
.chip-active { background: #f1f1f1; color: #0f0f0f; font-weight: 600; }
.chip-count { opacity: 0.6; font-size: 11px; }
.sort-row { display: flex; align-items: center; gap: 8px; margin: 14px 0 4px; }
.sort-btn {
  background: none; border: none; color: #aaa; cursor: pointer;
  padding: 6px 10px; border-radius: 8px; font-size: 13px;
}
.sort-btn:hover { color: #fff; background: #272727; }
.sort-active { color: #fff; font-weight: 700; border-bottom: 2px solid #ff0000; border-radius: 0; }
.result-count { margin-left: auto; color: #777; font-size: 12px; }

/* Cards grid */
.grid {
  display: grid; gap: 28px 16px; margin-top: 14px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.card { cursor: pointer; }
.thumb {
  position: relative; aspect-ratio: 16/9; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; padding: 20px;
}
.thumb-title {
  color: rgba(255,255,255,0.95); font-weight: 700; font-size: 17px;
  text-align: center; text-shadow: 0 1px 4px rgba(0,0,0,0.35);
  line-height: 1.4;
}
.thumb-time {
  position: absolute; bottom: 8px; right: 8px;
  background: rgba(0,0,0,0.8); color: #fff; font-size: 11px;
  border-radius: 4px; padding: 2px 6px;
}
.card-meta { display: flex; gap: 12px; margin-top: 12px; }
.avatar {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 15px;
}
.avatar-sm { width: 32px; height: 32px; font-size: 13px; }
.card-title {
  color: #f1f1f1; font-size: 15px; font-weight: 600;
  margin: 0 0 4px; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-sub { color: #aaa; font-size: 12.5px; margin: 0 0 2px; }
.card-stats { color: #aaa; font-size: 12px; margin: 0; }
.card-stats i { font-size: 10px; margin-right: 2px; }

.empty {
  text-align: center; color: #777; padding: 80px 0;
}
.empty i { font-size: 40px; margin-bottom: 16px; display: block; }
.loading { text-align: center; padding: 120px 0; color: #666; font-size: 24px; }

/* Novel page */
.novel-page { max-width: 820px; }
.player {
  position: relative; aspect-ratio: 16/7; border-radius: 16px;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.player-icon { font-size: 52px; color: rgba(255,255,255,0.7); }
.player-progress {
  position: absolute; bottom: 0; left: 0; right: 0; height: 4px;
  background: rgba(0,0,0,0.3);
}
.player-progress-bar {
  height: 100%; width: 0; background: #ff0000;
  animation: progress 30s linear forwards;
}
@keyframes progress { to { width: 100%; } }
.player-label {
  position: absolute; top: 12px; left: 14px; color: rgba(255,255,255,0.85);
  font-size: 11px; letter-spacing: 2px; font-weight: 700;
}
.novel-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-top: 22px; flex-wrap: wrap;
}
.novel-title { color: #f1f1f1; font-size: 22px; font-weight: 700; margin: 0; line-height: 1.4; }
.novel-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
.stat { color: #aaa; font-size: 13px; margin-right: 6px; }
.action-btn {
  background: #272727; color: #fff; border: none; border-radius: 18px;
  padding: 8px 16px; cursor: pointer; font-size: 13.5px;
}
.action-btn:hover { background: #3d3d3d; }
.action-btn.liked { background: #f1f1f1; color: #0f0f0f; font-weight: 600; }
.novel-author { display: flex; gap: 12px; align-items: center; margin: 18px 0; }
.author-name { color: #fff; font-weight: 600; font-size: 14.5px; margin: 0 0 2px; }
.author-date { color: #aaa; font-size: 12px; margin: 0; }
.novel-summary {
  background: #1c1c1c; border-left: 3px solid #ff0000; color: #ccc;
  padding: 12px 16px; border-radius: 0 8px 8px 0; font-size: 14px; line-height: 1.7;
}
.novel-body { margin-top: 28px; }
.novel-body p {
  color: #e8e8e8; line-height: 2; font-size: 16px; margin: 0 0 1.6em;
  letter-spacing: 0.02em;
}

/* Comments */
.comments { margin-top: 44px; }
.comments-title { color: #f1f1f1; font-size: 17px; font-weight: 600; }
.comment-form { display: flex; flex-direction: column; gap: 10px; margin: 18px 0 28px; }
.comment-form input, .comment-form textarea {
  background: #1c1c1c; border: 1px solid #303030; border-radius: 10px;
  color: #eee; padding: 10px 14px; font-size: 14px; outline: none; resize: vertical;
  font-family: inherit;
}
.comment-form input:focus, .comment-form textarea:focus { border-color: #555; }
.comment-submit {
  align-self: flex-end; background: #ff0000; color: #fff; border: none;
  border-radius: 18px; padding: 9px 22px; cursor: pointer; font-size: 13.5px; font-weight: 600;
}
.comment-submit:hover { background: #cc0000; }
.comment { display: flex; gap: 12px; margin-bottom: 20px; }
.comment-name { color: #f1f1f1; font-size: 13.5px; font-weight: 600; margin: 0 0 4px; }
.comment-date { color: #777; font-weight: 400; font-size: 11.5px; }
.comment-text { color: #ddd; font-size: 14px; line-height: 1.7; margin: 0; }

/* Upload page */
.upload-page { max-width: 760px; }
.page-title { color: #f1f1f1; font-size: 22px; font-weight: 700; }
.upload-form { display: flex; flex-direction: column; gap: 18px; margin-top: 24px; }
.upload-form label { display: flex; flex-direction: column; gap: 7px; color: #ccc; font-size: 13.5px; font-weight: 600; }
.req {
  background: #ff0000; color: #fff; font-size: 10px; padding: 2px 6px;
  border-radius: 4px; margin-left: 6px; vertical-align: 2px; font-weight: 400;
}
.upload-form input, .upload-form textarea, .upload-form select {
  background: #1c1c1c; border: 1px solid #303030; border-radius: 10px;
  color: #eee; padding: 11px 14px; font-size: 14.5px; outline: none;
  font-family: inherit; font-weight: 400;
}
.upload-form input:focus, .upload-form textarea:focus { border-color: #555; }
.form-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.form-note { color: #aaa; font-size: 12px; margin: 0 0 8px; }
.cover-preview {
  width: 240px; aspect-ratio: 16/9; border-radius: 12px;
  border: 1px solid #333;
}
.submit-btn {
  align-self: flex-start; background: #ff0000; color: #fff; border: none;
  border-radius: 22px; padding: 12px 30px; cursor: pointer; font-size: 15px; font-weight: 700;
}
.submit-btn:hover { background: #cc0000; }

/* Toast */
.toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%);
  background: #f1f1f1; color: #0f0f0f; padding: 11px 22px; border-radius: 24px;
  font-size: 14px; font-weight: 600; z-index: 100;
  box-shadow: 0 4px 16px rgba(0,0,0,0.5); animation: toast-in 0.25s ease;
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 10px); } }

/* Responsive */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-216px); z-index: 40; }
  .sidebar.sidebar-hidden { transform: translateX(-216px); }
  .sidebar:not(.sidebar-hidden) { transform: translateX(0); }
  .main-area { margin-left: 0; }
  .logo-sub { display: none; }
  .search-box { max-width: none; }
}
@media (max-width: 640px) {
  .upload-btn span { display: none; }
  .form-row { grid-template-columns: 1fr; }
  .content { padding: 16px 12px 60px; }
  .grid { grid-template-columns: 1fr; }
}
