/* ============================================================
   文件分享平台 - 全局样式
   ============================================================ */

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

:root {
  --primary-color: #4a90e2;
  --primary-hover: #357abd;
  --primary-light: #e8f4fd;
  --secondary-color: #6b7280;
  --text-primary: #1a1a2e;
  --text-secondary: #5a5a6e;
  --text-light: #8a8aa0;
  --bg-primary: #f5f7fa;
  --bg-white: #ffffff;
  --bg-gray: #f0f2f5;
  --border-color: #e1e5eb;
  --border-light: #edf0f5;
  --danger-color: #ef4444;
  --danger-hover: #dc2626;
  --success-color: #10b981;
  --warning-color: #f59e0b;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
}

html, body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
    'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--primary-hover);
}

/* ============================================================
   页面布局
   ============================================================ */

.page-container {
  max-width: 960px;
  margin: 0 auto;
  padding: 20px;
  min-height: 100vh;
}

.page-header {
  background: linear-gradient(135deg, var(--primary-color) 0%, #67b8f5 100%);
  color: white;
  padding: 24px 20px;
  margin: -20px -20px 20px;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.page-header h1 {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 8px;
}

.page-header .subtitle {
  font-size: 14px;
  opacity: 0.9;
}

/* ============================================================
   网站统计栏
   ============================================================ */

.site-stats-bar {
  max-width: 960px;
  margin: 8px auto 0;
  padding: 6px 12px;
  background: linear-gradient(90deg, #eaf4ff 0%, #f5f9ff 100%);
  border: 1px solid #d6e7ff;
  border-radius: 8px;
  font-size: 11px;
  color: #445566;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 3px 6px;
  line-height: 1.6;
}
.site-stats-bar .stats-icon {
  font-size: 12px;
}
.site-stats-bar .stats-item {
  white-space: nowrap;
}
.site-stats-bar .stats-item b {
  color: #1677ff;
  font-weight: 600;
  margin: 0 1px;
}
.site-stats-bar .stats-arrow {
  color: #aabbcc;
  font-size: 9px;
  margin-left: 1px;
}
.site-stats-bar .stats-sep {
  color: #c8d4e3;
}
.site-stats-bar .stats-welcome b {
  color: #e67e22;
  font-weight: 600;
  margin-left: 2px;
}
.site-stats-bar .stats-detail {
  width: 100%;
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px dashed #d6e7ff;
  font-size: 11px;
  color: #667788;
}
.site-stats-bar .stats-detail b {
  color: #1677ff;
  font-weight: 600;
  margin: 0 2px;
}

/* ============================================================
   导航栏
   ============================================================ */

.nav-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-white);
  padding: 14px 20px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
  position: sticky;
  top: 20px;
  z-index: 10;
}

.nav-logo {
  font-size: 18px;
  font-weight: 600;
  color: var(--primary-color);
  cursor: pointer;
}

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

/* 我的页面：隐藏顶部导航栏的用户信息+退出，但保留登录按钮（未登录时）和消息铃铛 */
.body-mine .nav-right .nav-user,
.body-mine .nav-right #logoutBtn {
  display: none !important;
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-secondary);
}

.nav-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.nav-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.nav-avatar-placeholder {
  font-size: 16px;
}

.nav-admin-badge {
  background: var(--warning-color);
  color: white;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 500;
}

.nav-message-icon {
  position: relative;
  cursor: pointer;
  font-size: 20px;
  padding: 4px;
  border-radius: 50%;
  transition: background 0.2s;
}
.nav-message-icon:hover {
  background: rgba(0, 0, 0, 0.05);
}
.nav-message-badge {
  position: absolute;
  top: -2px;
  right: -4px;
  background: #ff4d4f;
  color: white;
  font-size: 10px;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  font-weight: 600;
  line-height: 1;
}

/* ============================================================
   文件卡片列表
   ============================================================ */

.file-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.file-card {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.file-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--primary-light);
}

.file-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.publisher-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.publisher-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.publisher-avatar-placeholder {
  font-size: 16px;
}

.publisher-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.publisher-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

/* 管理员头衔徽章 */
.admin-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  padding: 2px 6px;
  margin-left: 4px;
  border-radius: 4px;
  background: linear-gradient(135deg, #ff9500, #ff6b00);
  color: #fff;
  vertical-align: middle;
  white-space: nowrap;
}

/* ============ 管理员管理面板 ============ */
.admin-panel {
  padding: 20px;
  box-sizing: border-box;
  max-height: 90vh;
  overflow-y: auto;
}
.admin-panel .modal-title {
  margin: 0 0 14px;
  text-align: center;
}

/* 标签页 */
.admin-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-gray);
  padding: 4px;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
}
.admin-tab {
  flex: 1;
  padding: 8px 4px;
  font-size: 13px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
.admin-tab.active {
  background: var(--bg-white);
  color: var(--primary-color);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

/* 标签页内容 */
.admin-tab-content {
  display: none;
  animation: fadeIn 0.2s;
}
.admin-tab-content.active {
  display: block;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.admin-tab-desc {
  font-size: 12px;
  color: var(--text-tertiary);
  line-height: 1.6;
  margin-bottom: 12px;
  padding: 8px 10px;
  background: var(--bg-gray);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--primary-color);
}

/* 管理员列表 */
.admin-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.admin-list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: var(--bg-gray);
  border-radius: var(--radius-md);
  transition: background 0.2s;
}
.admin-list-item:hover {
  background: var(--border-light);
}
.admin-list-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  font-size: 16px;
}
.admin-list-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.admin-list-info {
  flex: 1;
  min-width: 0;
}
.admin-list-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 2px;
}
.admin-list-meta {
  font-size: 12px;
  color: var(--text-tertiary);
}
.admin-list-badge {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--warning-color);
  color: #fff;
  font-weight: 500;
  margin-left: 6px;
}
.admin-list-self-badge {
  background: var(--success-color);
}
.admin-list-remove-btn {
  padding: 4px 10px;
  font-size: 12px;
  background: transparent;
  border: 1px solid var(--danger-color);
  color: var(--danger-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.admin-list-remove-btn:hover:not(:disabled) {
  background: var(--danger-color);
  color: #fff;
}
.admin-list-remove-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.admin-empty {
  text-align: center;
  padding: 20px;
  font-size: 13px;
  color: var(--text-tertiary);
}

/* 表单 */
.admin-form-row {
  margin-bottom: 14px;
}
.admin-form-row .edit-field-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.admin-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.admin-form-actions .btn {
  padding: 8px 20px;
  font-size: 13px;
}

.publish-time {
  font-size: 12px;
  color: var(--text-light);
}

.file-card-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  word-break: break-word;
}

.file-card-desc {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 12px;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.file-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.file-tag {
  display: inline-block;
  padding: 3px 10px;
  background: var(--primary-light);
  color: var(--primary-color);
  font-size: 12px;
  border-radius: 20px;
  font-weight: 500;
}

.file-preview-section {
  background: var(--bg-gray);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.file-preview-image {
  width: 80px;
  height: 60px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.file-preview-icon {
  font-size: 32px;
  flex-shrink: 0;
}

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

.file-preview-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-preview-size {
  font-size: 12px;
  color: var(--text-light);
}

.file-card-footer {
  display: flex;
  align-items: center;
  gap: 20px;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--text-secondary);
}

.stat-icon {
  font-size: 14px;
}

.stat-value {
  font-weight: 500;
}

.delete-btn-wrapper {
  margin-left: auto;
}

.btn-delete-sm {
  background: transparent;
  border: 1px solid var(--danger-color);
  color: var(--danger-color);
  padding: 4px 12px;
  font-size: 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-delete-sm:hover {
  background: var(--danger-color);
  color: white;
}

/* ============================================================
   按钮
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary-color);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: var(--bg-gray);
  color: var(--text-secondary);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--border-color);
}

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

.btn-danger:hover:not(:disabled) {
  background: var(--danger-hover);
}

.btn-lg {
  padding: 14px 28px;
  font-size: 16px;
}

.btn-block {
  width: 100%;
}

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

/* ============================================================
   表单
   ============================================================ */

.form-container {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

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

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

.required {
  color: var(--danger-color);
  margin-left: 2px;
}

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

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px var(--primary-light);
}

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

.input-counter {
  display: block;
  text-align: right;
  font-size: 12px;
  color: var(--text-light);
  margin-top: 4px;
}

.form-hint {
  display: block;
  font-size: 12px;
  color: var(--text-light);
  margin-top: 6px;
}

/* 标签输入 */
.tags-input-container {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px;
  min-height: 44px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  transition: border-color 0.2s;
}

.tags-input-container:focus-within {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--primary-light);
  color: var(--primary-color);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
}

.tag-chip-remove {
  cursor: pointer;
  font-size: 14px;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.tag-chip-remove:hover {
  opacity: 1;
}

.tag-input {
  flex: 1;
  min-width: 100px;
  border: none;
  outline: none;
  font-size: 14px;
  padding: 4px;
  background: transparent;
}

/* 文件上传 */
.file-upload-area {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-lg);
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--bg-gray);
}

.file-upload-area:hover,
.file-upload-area.dragover {
  border-color: var(--primary-color);
  background: var(--primary-light);
}

.file-upload-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.file-upload-text {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.file-upload-hint {
  font-size: 13px;
  color: var(--text-light);
}

.file-upload-info {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--primary-light);
  padding: 14px;
  border-radius: var(--radius-md);
  margin-top: 12px;
}

.file-upload-info-icon {
  font-size: 32px;
}

.file-upload-info-text {
  flex: 1;
  min-width: 0;
}

.file-upload-info-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-upload-info-size {
  font-size: 12px;
  color: var(--text-secondary);
}

.file-upload-remove {
  background: transparent;
  border: 1px solid var(--danger-color);
  color: var(--danger-color);
  padding: 6px 12px;
  font-size: 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.file-upload-remove:hover {
  background: var(--danger-color);
  color: white;
}

/* 进度条 */
.upload-progress {
  margin-top: 12px;
  height: 6px;
  background: var(--bg-gray);
  border-radius: 3px;
  overflow: hidden;
}

.upload-progress-bar {
  height: 100%;
  background: var(--primary-color);
  transition: width 0.3s;
}

/* ============================================================
   文件详情页
   ============================================================ */

.detail-container {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.detail-header {
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 20px;
}

.detail-title {
  font-size: 22px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
  line-height: 1.4;
}

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

.detail-publisher {
  display: flex;
  align-items: center;
  gap: 8px;
}

.detail-publisher-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.detail-publisher-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-publisher-name {
  font-size: 14px;
  font-weight: 500;
}

.detail-time {
  font-size: 13px;
  color: var(--text-light);
}

.detail-description {
  font-size: 15px;
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: 20px;
  white-space: pre-wrap;
}

.detail-file-section {
  background: var(--bg-gray);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 20px;
}

.detail-file-preview {
  text-align: center;
  margin-bottom: 16px;
}

.detail-file-preview img {
  max-width: 100%;
  max-height: 400px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.detail-file-icon-lg {
  font-size: 80px;
  margin-bottom: 12px;
}

.detail-file-name {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 4px;
  word-break: break-all;
}

.detail-file-size {
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 16px;
}

.detail-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 16px 0;
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 20px;
}

.detail-stat-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-secondary);
}

.detail-stat-icon {
  font-size: 18px;
}

.detail-stat-value {
  font-weight: 600;
  color: var(--text-primary);
}

.detail-delete-wrapper {
  margin-left: auto;
}

/* ============================================================
   评论区
   ============================================================ */

.comments-section {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  margin-top: 20px;
}

.comments-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-light);
}

.comments-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
}

.comments-count {
  font-size: 14px;
  color: var(--text-light);
  font-weight: 500;
}

.comment-input-section {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-light);
}

.comment-input-row {
  display: flex;
  gap: 12px;
}

.comment-input-wrapper {
  flex: 1;
}

.comment-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  resize: vertical;
  min-height: 44px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.comment-input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.comment-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.comment-item {
  display: flex;
  gap: 12px;
}

/* 回复评论：整体向右缩进，头像和字号缩小 */
.comment-item.comment-item-reply {
  margin-left: 36px;
  padding-left: 12px;
  border-left: 2px solid var(--border-color-light);
  margin-top: 4px;
}

.comment-item.comment-item-reply .comment-avatar {
  width: 28px;
  height: 28px;
}

.comment-item.comment-item-reply .comment-avatar-placeholder {
  font-size: 13px;
}

.comment-item.comment-item-reply .comment-author {
  font-size: 13px;
}

.comment-item.comment-item-reply .comment-time {
  font-size: 11px;
}

.comment-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.comment-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.comment-avatar-placeholder {
  font-size: 16px;
}

.comment-body {
  flex: 1;
  min-width: 0;
}

.comment-header-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.comment-author {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.comment-time {
  font-size: 12px;
  color: var(--text-light);
}

.comment-content {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 6px;
  word-break: break-word;
}

.comment-reply-to {
  color: var(--primary-color);
  font-weight: 500;
}

.comment-actions {
  display: flex;
  gap: 12px;
}

.comment-action-btn {
  font-size: 12px;
  color: var(--text-light);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: color 0.2s, background 0.2s;
  background: transparent;
  border: none;
  font-family: inherit;
}

.comment-action-btn:hover {
  color: var(--primary-color);
  background: var(--primary-light);
}

.comment-action-btn.delete-btn {
  color: var(--danger-color);
}

.comment-action-btn.delete-btn:hover {
  background: rgba(239, 68, 68, 0.1);
}

/* 评论图片 */
.comment-image {
  margin-top: 10px;
}

.comment-thumb {
  max-width: 80px;
  max-height: 80px;
  width: auto;
  height: auto;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform 0.2s;
  display: block;
  object-fit: cover;
  border: 1px solid var(--border-color-light);
}

.comment-thumb:hover {
  transform: scale(1.02);
}

/* 评论输入区工具栏 */
.comment-input-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
}

.comment-toolbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.comment-image-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: white;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.2s;
}

.comment-image-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
  background: rgba(24, 144, 255, 0.05);
}

/* 图片预览 */
.comment-image-preview {
  position: relative;
  margin-top: 12px;
  display: inline-block;
}

.comment-image-preview img {
  max-width: 160px;
  max-height: 160px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.comment-image-remove {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--danger-color);
  color: white;
  border: none;
  cursor: pointer;
  font-size: 14px;
  line-height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

/* 图片放大预览 Lightbox */
.image-preview-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
  cursor: pointer;
  animation: fadeIn 0.2s;
}

.image-preview-content {
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-preview-content img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  object-fit: contain;
  cursor: default;
}

/* 我的页面 Tab 切换 */
.mine-tabs {
  display: flex;
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: 4px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  align-items: center;
  gap: 4px;
}

/* 子Tab（列表详情页面内的返回 + 标题，无Tab切换） */
.mine-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: 8px 12px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 60px;
  z-index: 10;
}
.mine-list-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}
.mine-back-btn {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-gray);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s;
}
.mine-back-btn:hover {
  background: var(--border-color);
  color: var(--primary-color);
}

.mine-tab {
  flex: 1;
  text-align: center;
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s;
}

.mine-tab:hover {
  color: var(--primary-color);
}

.mine-tab.active {
  background: var(--primary-color);
  color: white;
  box-shadow: 0 2px 8px rgba(24, 144, 255, 0.3);
}

/* 我的评论卡片 */
.comment-card {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 12px;
  transition: box-shadow 0.2s;
}

.comment-card:hover {
  box-shadow: var(--shadow-md);
}

.comment-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.comment-card-header .publisher-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}

.comment-card-header .publisher-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.comment-card-header .publisher-info {
  flex: 1;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.comment-card-header .publisher-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.comment-card-header .publish-time {
  font-size: 12px;
  color: var(--text-light);
}

.comment-card-header .btn-delete-sm {
  padding: 4px 12px;
  font-size: 12px;
}

/* 紧凑删除按钮（我的发布/我的评论 用） */
.mine-delete-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: rgba(239, 68, 68, 0.06);
  color: #ef4444;
  cursor: pointer;
  transition: all 0.18s;
  flex-shrink: 0;
  padding: 0;
}

.mine-delete-btn:hover {
  background: #ef4444;
  color: white;
  border-color: #ef4444;
  transform: translateY(-1px);
}

.mine-delete-btn:active {
  transform: translateY(0);
}

.comment-delete-btn {
  /* 评论卡片里的删除按钮略微缩小 */
  width: 24px;
  height: 24px;
}

.comment-card .comment-content {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
  margin-bottom: 8px;
  word-break: break-word;
}

.comment-card .comment-image {
  margin-top: 8px;
}

/* 评论关联文件引用 */
.comment-file-ref {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--bg-gray);
  border-radius: var(--radius-md);
  font-size: 13px;
  color: var(--primary-color);
  cursor: pointer;
  margin-bottom: 8px;
  transition: background 0.2s;
}

.comment-file-ref:hover {
  background: rgba(24, 144, 255, 0.1);
}

.comment-file-icon {
  font-size: 14px;
}

.comment-file-title {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.empty-comments {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-light);
  font-size: 14px;
}

.login-hint {
  text-align: center;
  padding: 16px;
  background: var(--bg-gray);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 16px;
}

/* ============================================================
   空状态和加载
   ============================================================ */

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-light);
}

/* ============================================================
   我的发布页 - 用户信息卡片
   ============================================================ */

.mine-profile-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-white);
  padding: 16px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
}

.mine-profile-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--bg-gray);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  overflow: hidden;
  flex-shrink: 0;
}

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

.mine-profile-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mine-profile-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  font-size: 12px;
  color: var(--text-light);
  align-items: center;
  line-height: 1.4;
}

.mine-profile-meta span {
  white-space: nowrap;
}

.mine-profile-stat strong {
  color: var(--primary-color);
  font-weight: 600;
}

.mine-section-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
  padding-left: 4px;
}

/* 我的页面菜单 */
.mine-menu-section {
  margin-top: 14px;
  margin-bottom: 20px;
}
.mine-menu-card {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.mine-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  cursor: pointer;
  transition: background 0.2s;
  border-bottom: 1px solid var(--border-color);
  font-size: 14px;
  color: var(--text-primary);
}
.mine-menu-item:last-child {
  border-bottom: none;
}
.mine-menu-item:hover {
  background: var(--bg-secondary);
}
.mine-menu-icon {
  width: 32px;
  height: 32px;
  background: var(--primary-light);
  color: var(--primary-color);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.mine-menu-label {
  flex: 1;
}
.mine-menu-value {
  color: var(--text-tertiary);
  font-size: 13px;
  margin-right: 2px;
  background: var(--bg-gray);
  padding: 2px 10px;
  border-radius: 10px;
  min-width: 28px;
  text-align: center;
}
.mine-menu-chevron {
  color: var(--text-tertiary);
  font-size: 18px;
}

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

.empty-title {
  font-size: 17px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.empty-subtitle {
  font-size: 14px;
  color: var(--text-light);
}

.loading-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-light);
}

.loading-spinner-sm {
  width: 32px;
  height: 32px;
  border: 3px solid var(--bg-gray);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 16px;
}

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

.load-more-container {
  text-align: center;
  padding: 20px;
}

.load-more-btn {
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 10px 24px;
  font-size: 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s;
}

.load-more-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

/* ============================================================
   Toast 消息
   ============================================================ */

.toast-message {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: var(--text-primary);
  color: white;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-size: 14px;
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  opacity: 0;
  transition: transform 0.3s, opacity 0.3s;
  max-width: 90%;
  text-align: center;
}

.toast-message.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.toast-message.toast-success {
  background: var(--success-color);
}

.toast-message.toast-error {
  background: var(--danger-color);
}

/* ============================================================
   弹窗/模态框
   ============================================================ */

.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
  animation: fadeIn 0.2s;
}

/* 通用模态遮罩：编辑资料弹窗使用 modal-overlay 类 */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
  animation: fadeIn 0.2s;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  max-width: 440px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.2s;
}

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-light);
}

.modal-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
}

.modal-body {
  padding: 24px;
}

.modal-body p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* 登录弹窗 */
.login-modal-input {
  margin-bottom: 16px;
}

.login-modal-input input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.login-modal-input input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px var(--primary-light);
}

/* ============ 编辑资料弹窗 ============ */
.edit-profile-form {
  padding: 8px 0;
}

.edit-avatar-section {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
}

.edit-avatar-preview {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--bg-white);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 2px solid var(--border-color);
  flex-shrink: 0;
}

.edit-avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.edit-avatar-preview .publisher-avatar-placeholder {
  font-size: 28px;
}

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

.edit-avatar-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.edit-avatar-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.edit-nickname-section {
  margin-bottom: 16px;
}

.edit-field-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

#editNicknameInput {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

#editNicknameInput:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px var(--primary-light);
}

/* 编辑资料模态框内容区内边距（因为没有用 modal-header/modal-body 包裹） */
#editProfileModal .modal-content {
  padding: 20px;
  box-sizing: border-box;
}
#editProfileModal .modal-title {
  margin: 0 0 16px;
}

/* 模态框底部操作按钮行 */
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}
.modal-btn {
  padding: 8px 20px;
  border-radius: var(--radius-md);
  font-size: 14px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s;
  font-family: inherit;
}
.modal-btn.btn-cancel {
  background: var(--bg-gray);
  color: var(--text-secondary);
  border-color: var(--border-color);
}
.modal-btn.btn-cancel:hover {
  background: var(--border-color);
}
.modal-btn.btn-confirm {
  background: var(--primary-color);
  color: #fff;
}
.modal-btn.btn-confirm:hover {
  background: var(--primary-hover);
}
/* 小按钮样式：供"选择图片"等使用 */
.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

/* 我的页面操作按钮组 */
.mine-profile-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
}

/* ============ 加载遮罩 ============ */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 999;
  gap: 12px;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--bg-gray);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.loading-text {
  font-size: 14px;
  color: var(--text-secondary);
}

/* ============================================================
   Tab 切换
   ============================================================ */

.tabs-container {
  display: flex;
  gap: 8px;
  background: var(--bg-white);
  padding: 6px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
}

.tab-item {
  flex: 1;
  padding: 10px 16px;
  text-align: center;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.tab-item:hover {
  background: var(--bg-gray);
}

.tab-item.active {
  background: var(--primary-color);
  color: white;
}

/* ============================================================
   登录/注册弹窗内部切换
   ============================================================ */

.auth-tabs {
  display: flex;
  gap: 6px;
  background: var(--bg-gray);
  padding: 4px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
}

.auth-tab {
  flex: 1;
  padding: 8px 12px;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
}

.auth-tab:hover {
  color: var(--text-primary);
}

.auth-tab.active {
  background: var(--bg-white);
  color: var(--primary-color);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* ============================================================
   返回按钮
   ============================================================ */

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 16px;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
  background: var(--bg-white);
  width: fit-content;
}

.back-link:hover {
  color: var(--primary-color);
  background: var(--primary-light);
}

/* ============================================================
   浮动按钮
   ============================================================ */

.floating-btn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary-color);
  color: white;
  border: none;
  font-size: 28px;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  transition: all 0.2s;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
}

.floating-btn:hover {
  background: var(--primary-hover);
  transform: scale(1.05);
  box-shadow: 0 12px 32px rgba(74, 144, 226, 0.4);
}

.floating-btn.hidden-scroll,
.floating-btn.hidden-scroll:hover {
  transform: translateY(140%) !important;
  opacity: 0;
  pointer-events: none;
}

/* ============================================================
   引流：公众号 + 小程序二维码
   ============================================================ */

.promo-section {
  margin: 32px 0 0;
  padding: 24px 16px 32px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  text-align: center;
}
.promo-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 16px;
}
.promo-cards {
  display: flex;
  justify-content: center;
  gap: 32px;
}
.promo-card {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.promo-qr {
  width: 120px;
  height: 120px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-light);
}
.promo-qr img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.promo-label {
  margin-top: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}
.promo-desc {
  margin-top: 2px;
  font-size: 12px;
  color: var(--text-secondary);
}

/* ============================================================
   底部导航（默认隐藏，仅手机端 mobile.css 中显示）
   ============================================================ */

.bottom-nav {
  display: none;
}

.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 6px 0;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.bottom-nav-item.active {
  color: var(--primary-color);
  font-weight: 600;
}
.bottom-nav-item.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: var(--primary-color);
}
.bottom-nav-item.active .bottom-nav-icon {
  transform: scale(1.1);
  transition: transform 0.2s;
}

.bottom-nav-icon {
  font-size: 20px;
  line-height: 1;
}

.bottom-nav-label {
  font-size: 11px;
}

/* ============================================================
   工具类
   ============================================================ */

.text-center { text-align: center; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.hidden { display: none !important; }
