/* --- style.css --- */
:root {
  --bg-color: #0f0f12;
  --bg-gradient: radial-gradient(circle at top left, #1a1a24, #0f0f12);
  --card-bg: rgba(35, 35, 45, 0.7);
  --text-main: #f0f0f0;
  --text-muted: #9ca3af;
  --accent: #ff4081;
  --accent-glow: rgba(255, 64, 129, 0.4);
  --tag-bg: rgba(255, 255, 255, 0.1);

  --s-game-done: #10b981;
  --s-game-wip: #f59e0b;
  --s-trans-done:#3b82f6;
  --s-trans-ing: #a855f7;
  --s-trans-wait:#ef4444;
  --s-default: #6b7280;
}

body {
  font-family: 'Noto Sans SC', sans-serif;
  background-color: var(--bg-color);
  background-image: var(--bg-gradient);
  color: var(--text-main);
  margin: 0;
  min-height: 100vh;
  line-height: 1.7;
  padding-bottom: 50px;
}

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #111; }
::-webkit-scrollbar-thumb { background: #444; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

a {
  text-decoration: none;
  color: inherit;
  transition: 0.3s;
}

/* 顶部 Header */
header {
  position: relative;
  text-align: center;
  padding: 80px 20px 40px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.3), transparent);
}

header h1 {
  margin: 0;
  font-size: 3.5rem;
  font-weight: 700;
  background: linear-gradient(to right, #fff, #bbb);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 4px;
  text-shadow: 0 0 20px rgba(255,255,255,0.1);
}

header p {
  color: var(--text-muted);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 15px auto 0;
}

header::after {
  content: '';
  display: block;
  width: 60px;
  height: 4px;
  background: var(--accent);
  margin: 30px auto 0;
  border-radius: 2px;
  box-shadow: 0 0 10px var(--accent-glow);
}

/* 首页网格 */
.grid {
  display: grid;
  grid-template-columns: repeat(4, 260px);
  gap: 20px;
  justify-content: center;
}

.card {
  background: var(--card-bg);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.4s ease;
  position: relative;
  backdrop-filter: blur(10px);
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: 0 15px 30px rgba(0,0,0,0.4);
  border-color: var(--accent);
}

.card-empty {
  visibility: hidden;
  pointer-events: none;
}

.img-wrapper {
  width: 100%;
  height: 176px;
  overflow: hidden;
  position: relative;
}

.card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.card:hover img {
  transform: scale(1.05);
}

.badges-container {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: flex-end;
  z-index: 2;
}

.status-badge {
  color: #fff;
  font-size: 0.7rem;
  font-weight: bold;
  padding: 3px 8px;
  border-radius: 4px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.5);
  letter-spacing: 0.5px;
  display: inline-block;
  width: fit-content;
}

.bg-game-done { background: var(--s-game-done); }
.bg-game-wip  { background: var(--s-game-wip); color: #000; }
.bg-trans-done{ background: var(--s-trans-done); }
.bg-trans-ing { background: var(--s-trans-ing); }
.bg-trans-wait{ background: var(--s-trans-wait); }

.card-content {
  padding: 16px;
}

.card h3 {
  margin: 5px 0 8px;
  font-size: 1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.tag {
  font-size: 0.7rem;
  background: var(--tag-bg);
  color: #ccc;
  padding: 2px 6px;
  border-radius: 10px;
}

/* 分页 */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
  margin: 40px 0 20px;
}

.pagination a, .pagination span {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 4px;
  background: rgba(255,255,255,0.05);
  color: var(--text-muted);
  transition: 0.3s;
}

.pagination a:hover:not(.disabled) {
  background: var(--accent);
  color: #fff;
}

.pagination .disabled {
  opacity: 0.3;
  cursor: not-allowed;
  pointer-events: none;
}

.pagination .current {
  background: var(--accent);
  color: #fff;
  font-weight: bold;
}

/* 详情页 */
#detail-view {
  padding-top: 20px;
  padding-bottom: 40px;
}

.back-nav {
  margin-bottom: 20px;
}

.back-btn {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.2);
  color: var(--text-muted);
  padding: 8px 20px;
  border-radius: 30px;
  cursor: pointer;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  transition: 0.3s;
  text-decoration: none;
}

.back-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.detail-header {
  display: grid;
  grid-template-columns: 350px 1fr;
  gap: 40px;
  margin-bottom: 40px;
  align-items: start;
}

.cover-box {
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0,0,0,0.5);
  border: 1px solid rgba(255,255,255,0.1);
  width: 100%;
  height: auto;
}

.cover-box img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
}

.info-box h1 {
  margin: 0 0 10px;
  font-size: 2.2rem;
  line-height: 1.2;
}

.original-title {
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: 20px;
  font-style: italic;
}

.info-table {
  background: rgba(255,255,255,0.03);
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 25px;
  font-size: 0.95rem;
}

.info-row {
  display: flex;
  margin-bottom: 8px;
}

.info-row:last-child {
  margin-bottom: 0;
}

.info-label {
  width: 80px;
  color: var(--text-muted);
}

.info-value {
  flex: 1;
  color: #fff;
}

.detail-body {
  background: var(--card-bg);
  padding: 40px;
  border-radius: 16px;
  margin-top: 30px;
  border-top: 2px solid var(--accent);
}

.detail-body h3 {
  color: var(--accent);
  margin-top: 35px;
  margin-bottom: 15px;
  font-size: 1.4rem;
  border-left: 4px solid var(--accent);
  padding-left: 12px;
}

.detail-body h3:first-child {
  margin-top: 0;
}

.detail-body p {
  color: #d1d5db;
  margin-bottom: 1.5em;
}

.detail-body ul {
  padding-left: 20px;
  color: #d1d5db;
  margin-bottom: 1.5em;
}

.detail-body li {
  margin-bottom: 8px;
}

/* 画廊 */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 15px;
  margin-top: 30px;
}

.gallery-media {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 8px;
  transition: transform 0.3s;
  border: 1px solid rgba(255,255,255,0.1);
  background: #000;
  cursor: zoom-in;
}

.gallery-media:hover {
  transform: scale(1.03);
  box-shadow: 0 5px 15px rgba(0,0,0,0.5);
}

video.gallery-media {
  cursor: default;
}

#lightbox {
  display: none;
  position: fixed;
  z-index: 1000;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  justify-content: center;
  align-items: center;
  flex-direction: column;
  cursor: zoom-out;
}

#lightbox img {
  max-width: 90%;
  max-height: 85%;
  border-radius: 4px;
  box-shadow: 0 0 30px rgba(0,0,0,0.5);
  animation: zoomIn 0.3s ease;
  cursor: default;
}

#lightbox .close-tip {
  color: #aaa;
  margin-top: 15px;
  font-size: 0.9rem;
}

/* 链接按钮 */
.action-area {
  margin-top: 30px;
}

.download-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.download-buttons .btn-download-active,
.download-buttons .btn-download-disabled {
  width: auto;
  max-width: none;
  flex: 0 1 auto;
  margin-bottom: 0;
}

.btn-download-active {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 24px;
  background: var(--accent);
  color: #fff;
  border-radius: 6px;
  font-weight: bold;
  font-size: 0.95rem;
  box-shadow: 0 4px 15px var(--accent-glow);
  transition: 0.3s;
  width: 100%;
  max-width: 220px;
  border: none;
  text-decoration: none;
}

.btn-download-active:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
}

.btn-download-active svg {
  width: 18px;
  height: 18px;
  margin-right: 8px;
  fill: currentColor;
}

.btn-download-disabled {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 24px;
  background: transparent;
  border: 1px solid #444;
  color: #666;
  border-radius: 6px;
  font-size: 0.9rem;
  margin-bottom: 20px;
  width: 100%;
  max-width: 220px;
  cursor: not-allowed;
  box-shadow: none;
}

.extra-links {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
  padding-left: 5px;
}

.simple-link {
  display: inline-flex;
  align-items: center;
  color: #888;
  font-size: 0.95rem;
  font-weight: 500;
  transition: 0.2s;
  border-bottom: 1px solid transparent;
  text-decoration: none;
}

.simple-link:hover {
  color: var(--text-main);
  border-bottom-color: var(--accent);
}

.simple-link img {
  width: 18px;
  height: 18px;
  margin-right: 8px;
  border-radius: 3px;
  object-fit: contain;
  filter: grayscale(0.3);
  transition: 0.3s;
}

.simple-link:hover img {
  filter: grayscale(0);
}

/* 更新日志 */
.changelog-section {
  margin-top: 30px;
  background: var(--card-bg);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 12px;
  padding: 20px;
  backdrop-filter: blur(10px);
}

.changelog-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent);
  margin: 0 0 15px;
  padding-left: 12px;
  border-left: 4px solid var(--accent);
}

.changelog-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.changelog-item {
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  color: #d1d5db;
  font-size: 0.9rem;
  line-height: 1.6;
}

.changelog-item:last-child {
  border-bottom: none;
}

.changelog-item.hidden-log {
  display: none;
}

.changelog-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.2);
  color: var(--text-muted);
  padding: 8px 20px;
  border-radius: 30px;
  cursor: pointer;
  font-size: 0.9rem;
  margin-top: 15px;
  transition: 0.3s;
  width: 100%;
}

.changelog-toggle-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.changelog-toggle-btn .arrow {
  transition: transform 0.3s;
  display: inline-block;
}

.changelog-toggle-btn.expanded .arrow {
  transform: rotate(180deg);
}

/* 公告模态框 */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.75);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s;
}

.modal-box {
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  max-width: 500px;
  width: 90%;
  padding: 30px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.5);
  color: var(--text-main);
  animation: modalSlideIn 0.3s ease;
}

.modal-box h2 {
  margin: 0 0 20px;
  font-size: 1.5rem;
  color: var(--accent);
  font-weight: 700;
}

.modal-body {
  color: #d1d5db;
  font-size: 0.95rem;
  line-height: 1.6;
}

.modal-close-btn {
  margin-top: 25px;
  text-align: right;
}

.modal-close-btn button {
  background: var(--accent);
  border: none;
  color: #fff;
  padding: 8px 24px;
  border-radius: 20px;
  font-weight: bold;
  cursor: pointer;
  transition: 0.3s;
  font-size: 0.9rem;
}

.modal-close-btn button:hover {
  background: #ff5a99;
}

/* 下载中间页 */
.download-page-container {
  max-width: 700px;
  margin: 60px auto;
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 40px;
  text-align: center;
}

.download-project-title {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 30px;
  color: var(--text-main);
}

.download-redirect-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 32px;
  background: var(--accent);
  color: #fff;
  border-radius: 30px;
  font-weight: bold;
  font-size: 1rem;
  text-decoration: none;
  transition: 0.3s;
  box-shadow: 0 4px 15px var(--accent-glow);
  margin: 20px 0;
}

.download-redirect-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
}

.download-redirect-btn svg {
  width: 20px;
  height: 20px;
  margin-right: 8px;
  fill: currentColor;
}

.download-page-note {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 20px;
}

/* ========== 评论区样式（已与 detail-body 完全统一） ========== */
.comments-section {
  background: var(--card-bg);
  padding: 40px;
  border-radius: 16px;
  margin-top: 30px;
  border-top: 2px solid var(--accent);
  backdrop-filter: blur(10px);
  color: var(--text-main);
  box-sizing: border-box;
}

.comments-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent);
  margin: 0 0 20px;
  padding-left: 12px;
  border-left: 4px solid var(--accent);
}

.comment-form {
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.comment-input {
  width: 100%;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  color: #fff;
  padding: 12px;
  font-size: 0.95rem;
  font-family: inherit;
  resize: none;          /* 禁止手动调整大小 */
  height: 80px;          /* 固定高度 */
  transition: border-color 0.3s;
}

.comment-input:focus {
  outline: none;
  border-color: var(--accent);
}

.comment-submit-btn {
  align-self: flex-end;
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 8px 24px;
  border-radius: 20px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.3s, transform 0.2s;
  font-size: 0.9rem;
}

.comment-submit-btn:hover {
  background: #ff5a99;
  transform: translateY(-1px);
}

.comment-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.comment-status {
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: right;
  min-height: 20px;
}

/* 评论列表可滚动区域 */
.comments-list {
  max-height: 500px;
  overflow-y: auto;
  padding-right: 5px;
}

.no-comments {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.comment-item {
  border-bottom: 1px solid rgba(255,255,255,0.05);
  padding: 12px 0;
}

.comment-meta {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
}

.comment-user {
  font-weight: 600;
  color: var(--accent);
  font-size: 0.9rem;
}

.comment-time {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.comment-text {
  color: #d1d5db;
  font-size: 0.95rem;
  line-height: 1.6;
  word-break: break-word;
}

/* 响应式 */
@media (max-width: 800px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
    justify-content: center;
  }
  .detail-header {
    grid-template-columns: 1fr;
  }
  .cover-box {
    max-width: 100%;
  }
  header h1 {
    font-size: 2.5rem;
  }
}

/* 页脚 */
footer {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 20px;
  padding: 20px;
  background: transparent;
  border-top: none;
}

footer a {
  color: var(--accent);
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}