:root {
  --bg: #111;
  --card: rgba(25, 25, 35, .7);
  --accent: #0ea5e9;
  --fg: #fff;
  --fg-secondary: #666;
  --border: #333;
}

body {
  margin: 0;
  font-family: system-ui;
  background: var(--bg);
  color: var(--fg);
}

header {
  display: flex;
  justify-content: space-between;
  padding: 1rem 2rem;
  align-items: center;
}

h1 {
  margin: 0;
}

.toolbar {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin: 1rem 0;
}

input, select, button {
  padding: .45rem .8rem;
  border: none;
  border-radius: 8px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); /* 调整最小宽度 */
  gap: 1rem;
  padding: 0 2rem 2rem;
}

.card {
  background: var(--card);
  border-left: 4px solid var(--accent);
  padding: 1rem;
  border-radius: 12px;
  transition: transform .3s;
  cursor: pointer;
}

.card:hover {
  transform: translateY(-5px);
}

.tag {
  font-size: .75rem;
  background: var(--accent);
  padding: .2rem .5rem;
  border-radius: 6px;
  color: var(--fg);
}

small {
  color: var(--fg-secondary);
}

dialog {
  border: none;
  border-radius: 12px;
  padding: 1.5rem;
  max-width: 500px;
}

dialog::backdrop {
  background: rgba(0, 0, 0, .6);
}

dialog form {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

.spinner {
  border: 4px solid rgba(255, 255, 255, .1);
  border-top: 4px solid var(--accent);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 0 auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 退出按钮 & 登录按钮美化 */
button {
  font-family: system-ui;
  cursor: pointer;
  border: none;
  border-radius: 6px;
  padding: 0.4rem 0.8rem;
  transition: background 0.2s;
}

#logoutBtn,
#loginBtn {
  background: var(--accent);
  color: var(--fg);
}

#logoutBtn:hover,
#loginBtn:hover {
  background: #0284c7;
}

.tag {
  font-size: .75rem;
  padding: .2rem .5rem;
  border-radius: 6px;
  color: var(--fg);
  margin-right: .25rem;
  display: inline-block;
}

/* 主站 & issue 统一布局 */
header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
}

header h1 {
  margin: 0;
  flex: 1;
}

.user-area {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

#themeToggle {
  background: var(--accent);
  color: var(--fg);
  border: none;
  padding: 0.4rem 0.8rem;
  border-radius: 18px;
  cursor: pointer;
  font-size: 0.85rem;
  white-space: nowrap;
  user-select: none;
  margin-left: auto;
}

#themeToggle:hover {
  background: #0284c7;
}

/* 搜索框样式 */
#search {
  background: var(--bg);
  color: var(--fg);
  border: 1px solid var(--border);
  padding: 0.5rem;
  border-radius: 6px;
  transition: border-color 0.3s, box-shadow 0.3s;
}

/* 搜索框焦点状态 */
#search:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.5);
  outline: none;
}

/* 正文输入框样式 */
#commentText {
  background: var(--bg);
  color: var(--fg);
  border: 1px solid var(--border);
  padding: 0.5rem;
  border-radius: 6px;
  transition: border-color 0.3s, box-shadow 0.3s;
}

/* 正文输入框焦点状态 */
#commentText:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.5);
  outline: none;
}

/* 按钮焦点状态 */
button:focus,
button:hover {
  background-color: var(--accent);
  color: var(--fg);
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.5);
  outline: none;
}

/* 输入框焦点状态 */
input:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.5);
  outline: none;
}

/* GitHub风格模板选择弹窗 */
.github-dialog {
  border: none;
  border-radius: 8px;
  padding: 0;
  max-width: 720px;
  width: 90%;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .2);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

.github-dialog h2 {
  margin: 0;
  padding: 16px;
  border-bottom: 1px solid var(--border);
  font-size: 20px;
  font-weight: 600;
}

.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  padding: 16px;
}

.template-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  cursor: pointer;
  transition: border-color .2s;
  background: var(--card);
}

.template-card:hover {
  border-color: var(--accent);
}

.template-card h3 {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 600;
}

.template-card p {
  margin: 0;
  font-size: 14px;
  color: var(--fg-secondary);
}

/* 按钮 */
.btn {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  margin-right: 8px;
}

.primary {
  background: var(--accent);
  color: var(--fg);
}

.secondary {
  background: var(--border);
  color: var(--fg);
}

/* 输入框样式 */
input[type="text"],
textarea {
  width: 100%;
  padding: 8px;
  margin-top: 4px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 14px;
}

textarea {
  resize: vertical;
}

/* 复选框样式 */
input[type="checkbox"] {
  margin-right: 8px;
}

/* 小字提示 */
small {
  display: block;
  margin-top: 4px;
  font-size: 14px;
  color: var(--fg-secondary);
}

/* 信息提示 */
p.info {
  margin-top: 8px;
  font-size: 14px;
  color: var(--fg-secondary);
}

/* 顶部标签页 */
.page-tabs {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin: 0.5rem 0;
}
.tab {
  padding: 0.4rem 0.8rem;
  border: none;
  border-radius: 6px;
  background: #f5f5f5;
  color: #111;
  cursor: pointer;
}
.tab.active {
  background: #0ea5e9;
  color: #fff;
}

/* 状态按钮 */
.state-tabs {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1rem;
}
.state-btn {
  padding: 0.4rem 1rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}
.state-btn.active {
  background: #0ea5e9;
  color: #fff;
}

/* 状态徽章 */
.state-badge {
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  font-size: 0.75rem;
  color: #fff;
}
.state-badge.open {
  background: #28a745;
}
.state-badge.closed {
  background: #8b5cf6;
}

/* #1234 链接样式 */
.markdown-body a[href*="issue.html"] {
  color: #0ea5e9;
  text-decoration: none;
  font-weight: 600;
}
.markdown-body a:hover {
  text-decoration: underline;
}

/* 状态徽章 */
.state-badge {
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  font-size: 0.75rem;
  color: #fff;
  margin-left: 0.5rem;
}

/* 标签 */
.tag {
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  color: #fff;
  margin-right: 0.25rem;
}

/* 引用链接 */
.issue-ref {
  color: #0ea5e9;
  text-decoration: none;
  font-weight: 600;
}
.issue-ref:hover {
  text-decoration: underline;
}

/* 全局提示样式 */
#global-toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 10px 20px;
  border-radius: 5px;
  z-index: 10000;
  transition: opacity 0.3s;
  opacity: 0;
  pointer-events: none;
}

/* 添加卡片悬停动画 */
.card {
  transition: all 0.3s ease;
  transform: translateY(0);
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 15px rgba(0,0,0,0.15);
}

/* 添加状态图标样式 */
.state-badge svg {
  margin-right: 4px;
}

/* 加载动画优化 */
.spinner {
  border: 4px solid rgba(0,0,0,0.1);
  border-top: 4px solid var(--accent);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 0 auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 淡入动画 */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.card, .comment-card {
  animation: fadeIn 0.3s ease-out;
}

/* 页面切换动画 */
#content {
  animation: fadeIn 0.5s ease;
}

/* style.css 新增部分 */
/* 返回按钮样式 */
.back-btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  margin-right: 1rem;
  background: var(--accent);
  color: white;
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.2s;
}

.back-btn:hover {
  background: #0284c7;
  transform: translateY(-2px);
}

/* 错误提示样式 */
.error {
  color: #ff6b6b;
  padding: 1rem;
  text-align: center;
}

/* 刷新按钮样式 */
.refresh-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.refresh-btn:hover {
  background: #0284c7;
  transform: translateY(-2px);
}

.refresh-btn svg {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 新增样式 */
.result-item {
  border-left: 4px solid var(--accent);
  padding: 1rem;
  margin-bottom: 1rem;
}

.result-title {
  font-size: 1.2rem;
  font-weight: bold;
}

.result-artist {
  color: #888;
  margin-bottom: 0.5rem;
}

.result-platforms span {
  display: inline-block;
  background: rgba(14, 165, 233, 0.2);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  margin-right: 0.5rem;
}

.lyric-match {
  color: #10b981;
  font-weight: bold;
  margin: 0.5rem 0;
}

/* 添加在文件末尾 */
/* 搜索结果容器 */
.results-container {
  max-height: 60vh;
  overflow-y: auto;
  margin-top: 1rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
}

/* 平台标签 */
.platform-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1rem;
  margin-right: 0.5rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s;
}

.platform-tag.selected {
  background: var(--accent);
  color: white;
}

/* 搜索输入框 */
.search-input {
  width: 100%;
  padding: 0.8rem 1rem;
  margin-bottom: 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  color: var(--fg);
  font-size: 1rem;
}

/* 加载动画 */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.spinner {
  display: inline-block;
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top: 4px solid var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}