:root {
  --bg-main: #f7f7f7;
  --bg-primary: #ffffff;
  --bg-secondary: #f0f0f0;
  --bg-hover: #e9e9e9;

  --text-primary: #111111;
  --text-secondary: #555555;
  --text-muted: #888888;
  --text-on-primary: #ffffff;

  --border-color: #dddddd;
  --border-light: #eeeeee;
  --focus-ring: #000000;

  --danger-color: #d9534f;
  --success-color: #28a745;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.07), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 12px;

  --sidebar-width: 320px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

.app-container {
  display: flex;
  min-height: 100vh;
  max-width: 1800px;
  margin: 0 auto;
  position: relative;
}

/* 高级悬浮按钮（仅在折叠状态显示） */
.sidebar-float-btn {
  position: fixed;
  bottom: 32px;
  left: 32px;
  width: 64px;
  height: 64px;
  background: var(--text-primary);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: var(--shadow-xl);
  color: var(--text-on-primary);
  opacity: 0;
  visibility: hidden;
  transform: scale(0.8) translateY(20px);
  overflow: hidden;
}

.sidebar-float-btn.show {
  opacity: 1;
  visibility: visible;
  transform: scale(1) translateY(0);
}

.sidebar-float-btn:hover {
  background: #333; /* 悬停时稍微变亮 */
  transform: scale(1.1) translateY(-2px);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.sidebar-float-btn:active {
  transform: scale(0.95) translateY(0);
}

.float-btn-icon {
  position: relative;
  z-index: 2;
  transition: transform 0.3s ease;
}

.sidebar-float-btn:hover .float-btn-icon {
  transform: rotate(180deg);
}

/* 悬浮按钮的波纹效果 */
.float-btn-ripple {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.sidebar-float-btn:active .float-btn-ripple {
  width: 120px;
  height: 120px;
}

/* 侧边栏内部折叠按钮 */
.sidebar-collapse-btn {
  position: absolute;
  top: 20px;
  right: 16px;
  width: 36px;
  height: 36px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 101;
  transition: all 0.3s ease;
  color: var(--text-secondary);
  opacity: 0.7;
}

.sidebar-collapse-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  opacity: 1;
  transform: scale(1.05);
  box-shadow: var(--shadow-sm);
}

/* 侧边栏样式 */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg-primary);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  z-index: 999;
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  transform: translateX(0);
}

.sidebar.hidden {
  transform: translateX(-100%);
}

/* 侧边栏遮罩层（仅移动端） */
.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 998;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.sidebar-overlay.show {
  opacity: 1;
  visibility: visible;
}

.sidebar-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
  position: relative;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo h2 {
  font-size: 16px;
  font-weight: 600;
}

.sidebar-content {
  flex: 1;
  overflow-y: auto;
}

.sidebar-sections {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* 侧边栏区域样式 */
.sidebar-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.section-header {
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 8px;
}

.section-header h3 {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* 统一按钮样式 */
.btn-small {
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s;
  white-space: nowrap;
  height: 32px;
  box-sizing: border-box;
}

.btn-small.btn-primary {
  background: var(--text-primary);
  color: var(--text-on-primary);
  border-color: var(--text-primary);
}

.btn-small.btn-primary:hover {
  background: #333;
  border-color: #333;
}

.btn-small.btn-secondary,
.btn-small.btn-outline {
  background: var(--bg-primary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-small.btn-secondary:hover,
.btn-small.btn-outline:hover {
  background: var(--bg-secondary);
  border-color: #ccc;
}

.btn-small.btn-danger {
  background: var(--danger-color);
  color: white;
  border-color: var(--danger-color);
}

.btn-small.btn-danger:hover {
  background: #c9302c;
  border-color: #c12e2a;
}

/* 搜索区域 */
.search-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.search-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.search-box input {
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 13px;
  transition: all 0.2s;
  background: var(--bg-primary);
  height: 32px;
}

.search-box input:focus {
  outline: none;
  border-color: var(--focus-ring);
}

.search-controls {
  display: flex;
  gap: 8px;
}

.sort-select {
  flex: 1;
  padding: 8px 24px 8px 10px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='%23666'%3E%3Cpath d='M6 8L2 4h8l-4 4z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 10px;
  height: 32px;
}

.sort-select:focus {
  outline: none;
  border-color: var(--focus-ring);
}

.sort-select:hover {
  background-color: var(--bg-secondary);
  border-color: #ccc;
}

/* 浏览模式区域 */
.browse-modes {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.browse-modes .btn-small {
  width: 100%;
  justify-content: flex-start;
}

/* 文件操作区域 */
.file-operations {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.file-operations .btn-small {
  width: 100%;
  justify-content: center;
}

/* 分类筛选 */
.category-filter {
  display: flex;
  flex-direction: column;
}

.category-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.category-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
  font-size: 13px;
  width: 100%;
  text-align: left;
  height: 32px;
}

.category-btn:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.category-btn.active {
  background: var(--text-primary);
  color: var(--text-on-primary);
  font-weight: 600;
}

.count {
  background: var(--bg-secondary);
  padding: 2px 6px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
}

.category-btn.active .count {
  background: rgba(255, 255, 255, 0.2);
  color: var(--text-on-primary);
}

/* 统计信息 */
.stats-section {
  display: flex;
  flex-direction: column;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.stat-item {
  text-align: center;
}

.stat-number {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.stat-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* 缓存信息样式 */
.cache-info {
  display: flex;
  flex-direction: column;
}

.cache-status {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 12px;
  border: 1px solid var(--border-light);
}

.cache-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  font-size: 11px;
}

.cache-item:last-child {
  margin-bottom: 0;
}

.cache-label {
  color: var(--text-secondary);
}

.cache-value {
  color: var(--text-primary);
  font-weight: 500;
}

.cache-actions {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}

.btn-cache {
  flex: 1;
  padding: 6px 8px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
  color: var(--text-secondary);
  font-size: 10px;
  cursor: pointer;
  transition: all 0.2s;
  height: 24px;
}

.btn-cache:hover:not(:disabled) {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.btn-cache:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* 主内容区样式 */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg-main);
  min-width: 0;
  transition: margin-left 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  margin-left: var(--sidebar-width);
}

.main-content.full-width {
  margin-left: 0;
}

.content-area {
  flex: 1;
  padding: 32px;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
}

.replies-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 24px;
  width: 100%;
}

.reply-card {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  padding: 24px;
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
}

.reply-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.reply-info {
  flex: 1;
  min-width: 0;
}

.reply-info h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.reply-category {
  display: inline-block;
  padding: 4px 12px;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border-radius: 16px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid var(--border-light);
}

.reply-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.action-btn {
  padding: 6px 10px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s;
  font-size: 12px;
  background: var(--bg-primary);
  color: var(--text-secondary);
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.action-btn:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.reply-content {
  color: var(--text-secondary);
  line-height: 1.6;
  font-size: 14px;
  word-wrap: break-word;
  overflow-wrap: break-word;
  display: none;
}

.reply-content.visible {
  display: block;
  margin-top: 16px;
}

.card-footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
}

.copy-btn {
  width: 100%;
  padding: 12px;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
}

.copy-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: #ccc;
}

/* 空状态样式 */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  display: none;
}

.empty-icon {
  font-size: 64px;
  margin-bottom: 24px;
}

.empty-state h3 {
  font-size: 24px;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.empty-state p {
  color: var(--text-secondary);
  font-size: 16px;
  margin-bottom: 32px;
}

/* ==================== 提词卡模式样式 ==================== */
.prompt-card-mode {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-main);
  z-index: 2000;
  display: none;
  flex-direction: column;
  color: var(--text-primary);
  overflow: hidden;
}

.prompt-card-mode.active {
  display: flex;
}

.prompt-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.prompt-card-info {
  display: flex;
  align-items: center;
  gap: 16px;
}

.prompt-card-counter {
  font-size: 14px;
  font-weight: 600;
  background: var(--bg-secondary);
  color: var(--text-primary);
  padding: 6px 12px;
  border-radius: 16px;
  border: 1px solid var(--border-color);
}

.prompt-card-category {
  font-size: 12px;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  padding: 4px 10px;
  border-radius: 12px;
  border: 1px solid var(--border-light);
}

.prompt-card-exit {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.prompt-card-exit:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  transform: scale(1.05);
}

.prompt-card-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 20px;
  cursor: pointer;
  user-select: none;
  position: relative;
  min-height: 0;
  overflow: hidden;
}

.prompt-card-content {
  max-width: 1000px;
  width: 100%;
  height: 100%;
  max-height: calc(100vh - 160px);
  display: flex;
  flex-direction: column;
  background: var(--bg-primary);
  border-radius: var(--radius-xl);
  padding: 32px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  transition: all 0.3s ease;
  overflow: hidden;
}

.prompt-card-content:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
}

.prompt-card-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 20px;
  line-height: 1.3;
  color: var(--text-primary);
  text-align: center;
  flex-shrink: 0;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.prompt-card-text {
  font-size: 18px;
  line-height: 1.7;
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: break-word;
  flex: 1;
  overflow-y: auto;
  padding-right: 8px;
  text-align: left;
}

/* 自定义滚动条样式 */
.prompt-card-text::-webkit-scrollbar {
  width: 6px;
}

.prompt-card-text::-webkit-scrollbar-track {
  background: var(--bg-secondary);
  border-radius: 3px;
}

.prompt-card-text::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

.prompt-card-text::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

.prompt-card-controls {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 12px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  padding: 8px 16px;
  border-radius: 50px;
  box-shadow: var(--shadow-md);
}

.prompt-card-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  font-size: 16px;
}

.prompt-card-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  transform: scale(1.1);
  border-color: var(--text-muted);
}

.prompt-card-btn.primary {
  background: var(--text-primary);
  color: var(--text-on-primary);
  border-color: var(--text-primary);
}

.prompt-card-btn.primary:hover {
  background: #333;
  border-color: #333;
}

.prompt-card-hint {
  position: absolute;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  background: var(--bg-primary);
  padding: 6px 12px;
  border-radius: 16px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}

/* 提词卡模式响应式 */
@media (max-width: 768px) {
  .prompt-card-header {
    padding: 12px 16px;
  }

  .prompt-card-container {
    padding: 16px;
  }

  .prompt-card-content {
    padding: 24px 20px;
    max-height: calc(100vh - 140px);
  }

  .prompt-card-title {
    font-size: 22px;
    margin-bottom: 16px;
  }

  .prompt-card-text {
    font-size: 16px;
    line-height: 1.6;
  }

  .prompt-card-controls {
    bottom: 16px;
    gap: 10px;
    padding: 6px 12px;
  }

  .prompt-card-btn {
    width: 40px;
    height: 40px;
  }

  .prompt-card-hint {
    bottom: 70px;
    font-size: 12px;
    padding: 4px 10px;
  }

  .prompt-card-info {
    gap: 8px;
  }

  .prompt-card-counter {
    font-size: 12px;
    padding: 4px 8px;
  }

  .prompt-card-category {
    font-size: 11px;
    padding: 3px 8px;
  }
}

@media (max-width: 480px) {
  .prompt-card-content {
    padding: 20px 16px;
    max-height: calc(100vh - 120px);
  }

  .prompt-card-title {
    font-size: 20px;
    margin-bottom: 14px;
  }

  .prompt-card-text {
    font-size: 15px;
  }

  .prompt-card-controls {
    bottom: 12px;
    gap: 8px;
    padding: 4px 8px;
  }

  .prompt-card-btn {
    width: 36px;
    height: 36px;
  }

  .prompt-card-hint {
    bottom: 60px;
    font-size: 11px;
  }
}

/* 模态框样式 */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
  background-color: var(--bg-primary);
  margin: 5% auto;
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 500px;
  overflow: hidden;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-content.small {
  max-width: 500px;
}

.modal-header {
  padding: 24px 32px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
}

.close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  transition: all 0.2s;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.close-btn:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.modal-body {
  padding: 32px;
}

.form-group {
  margin-bottom: 24px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--text-primary);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 16px;
  transition: all 0.2s;
  font-family: inherit;
  background: var(--bg-primary);
}

/* 分类输入组件样式 */
.category-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.category-input-wrapper input {
  flex: 1;
  padding-right: 40px;
}

.category-dropdown-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.category-dropdown-btn:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.category-dropdown-btn.active {
  color: var(--text-primary);
  transform: translateY(-50%) rotate(180deg);
}

.category-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  z-index: 1000;
  max-height: 200px;
  overflow-y: auto;
  display: none;
  margin-top: 4px;
}

.category-dropdown.show {
  display: block;
  animation: dropdownFadeIn 0.2s ease-out;
}

@keyframes dropdownFadeIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.category-dropdown-content {
  padding: 8px 0;
}

.category-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  cursor: pointer;
  transition: background-color 0.2s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-size: 14px;
  color: var(--text-primary);
}

.category-option:hover {
  background: var(--bg-secondary);
}

.category-option:focus {
  outline: none;
  background: var(--bg-hover);
}

.category-option-name {
  flex: 1;
  font-weight: 500;
}

.category-option-count {
  background: var(--bg-secondary);
  color: var(--text-muted);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  margin-left: 8px;
}

.category-option:hover .category-option-count {
  background: var(--bg-hover);
  color: var(--text-secondary);
}

.category-dropdown-empty {
  padding: 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}

.new-category-hint {
  padding: 8px 16px;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-light);
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.new-category-hint::before {
  content: "✨";
  font-size: 14px;
}

.category-input-wrapper input:focus {
  outline: none;
  border-color: var(--focus-ring);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--focus-ring);
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

.char-count {
  text-align: right;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 32px;
}

/* 云数据库模态框样式 */
.cloud-modal {
  max-width: 500px;
}

.cloud-modal-body {
  padding: 24px 32px 32px;
}

.cloud-section {
  margin-bottom: 0;
}

.cloud-section-header {
  margin-bottom: 20px;
}

.cloud-section-info h3 {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 8px 0;
  color: var(--text-primary);
}

.cloud-section-info p {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.4;
}

.cloud-form {
  margin-bottom: 16px;
}

.cloud-input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 16px;
  transition: all 0.2s;
  background: var(--bg-primary);
  margin-bottom: 16px;
}

.cloud-input:focus {
  outline: none;
  border-color: var(--text-primary);
}

.cloud-action-btn {
  width: 100%;
  padding: 14px 20px;
  border: 1px solid var(--text-primary);
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  background: var(--bg-primary);
  color: var(--text-primary);
}

.cloud-action-btn:hover:not(:disabled) {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.cloud-action-btn:disabled {
  background: var(--bg-secondary);
  color: var(--text-muted);
  border-color: var(--border-color);
  cursor: not-allowed;
}

.cloud-help {
  text-align: center;
  margin-top: 12px;
}

.cloud-help small {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.4;
}

.cloud-divider {
  text-align: center;
  margin: 32px 0;
  position: relative;
}

.cloud-divider::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--border-light);
}

.cloud-divider span {
  background: var(--bg-primary);
  padding: 0 20px;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  position: relative;
  z-index: 1;
}

.load-section {
  margin-bottom: 32px;
}

.upload-section {
  margin-bottom: 0;
}

/* 上传结果模态框样式 */
.upload-success {
  text-align: center;
}

.success-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.upload-success h3 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 24px;
  color: var(--text-primary);
}

.file-code-display {
  margin-bottom: 24px;
}

.file-code-display label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.code-container {
  display: flex;
  gap: 8px;
  align-items: center;
}

.file-code-input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid var(--text-primary);
  border-radius: var(--radius-md);
  font-size: 18px;
  font-weight: 600;
  text-align: center;
  background: var(--bg-secondary);
  color: var(--text-primary);
  letter-spacing: 2px;
}

.copy-code-btn {
  padding: 12px 16px;
  background: var(--text-primary);
  color: var(--text-on-primary);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.copy-code-btn:hover {
  background: #333;
}

.upload-warning {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: left;
}

.upload-warning p {
  margin-bottom: 8px;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.5;
}

.upload-warning p:last-child {
  margin-bottom: 0;
}

/* Toast 提示样式 */
.toast {
  position: fixed;
  top: 24px;
  right: 24px;
  background: var(--text-primary);
  color: var(--text-on-primary);
  padding: 16px 24px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  z-index: 10000;
  transform: translateX(calc(100% + 48px));
  transition: transform 0.3s ease;
  opacity: 0;
  visibility: hidden;
  max-width: calc(100vw - 48px);
  word-wrap: break-word;
}

.toast.show {
  transform: translateX(0);
  opacity: 1;
  visibility: visible;
}

.loading-text {
  display: flex;
  align-items: center;
  gap: 8px;
}

.loading-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid transparent;
  border-top: 2px solid currentColor;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* 响应式设计 */
@media (max-width: 1200px) {
  .replies-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  }
}

@media (max-width: 1024px) {
  .replies-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }
}

/* 移动端样式 */
@media (max-width: 768px) {
  .main-content {
    margin-left: 0;
  }

  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.show {
    transform: translateX(0);
  }

  .sidebar-float-btn {
    bottom: 24px; /* 移动端也是 bottom */
    left: 24px;
    width: 56px;
    height: 56px;
  }

  .content-area {
    padding: 20px 16px;
    padding-bottom: 100px; /* 为悬浮按钮留出空间 */
  }

  .replies-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .reply-card {
    margin: 0;
    width: 100%;
  }

  .modal-content {
    width: 95%;
    margin: 10% auto;
  }

  .modal-body {
    padding: 20px;
  }

  .modal-header {
    padding: 16px 20px;
  }

  .form-actions {
    flex-direction: column;
    gap: 12px;
  }

  .form-actions .btn-small {
    width: 100%;
  }

  .toast {
    top: 24px;
    right: 16px;
    left: 16px;
    width: auto;
    max-width: none;
    transform: translateY(-120%);
    opacity: 0;
    visibility: hidden;
  }

  .toast.show {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .action-btn {
    min-width: 32px;
    min-height: 32px;
    padding: 8px;
  }

  .reply-actions {
    gap: 4px;
  }

  .code-container {
    flex-direction: column;
    gap: 12px;
  }

  .file-code-input {
    width: 100%;
  }

  .copy-code-btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .content-area {
    padding: 16px 12px;
    padding-bottom: 100px;
  }

  .reply-card {
    padding: 16px;
  }

  .modal-body {
    padding: 16px;
  }

  .modal-header {
    padding: 16px 20px;
  }

  .sidebar-float-btn {
    bottom: 20px; /* 小屏幕设备也是 bottom */
    left: 20px;
    width: 52px;
    height: 52px;
  }
}

/* 滚动条样式 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}
::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #aaa;
}

/* 防止文本选择导致的布局问题 */
.reply-card * {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

.reply-content {
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}
