/**
 * ui.css — UI组件样式（弹窗 / 表单 / 按钮 / 卡片 / 徽标 / 拖拽区）
 *
 * 与 style.css 的分工：
 *   - style.css：场景级全局样式（对话区、悬浮菜单、字体变量）
 *   - ui.css   ：index.html 各弹窗与 wc-*.js 动态渲染卡片共用的组件类
 * JS 只负责切换 display / 增删状态类（如 .dragover），不再拼行内样式。
 */

/* ==================== 弹窗 ==================== */

.modal-overlay {
  display: none; /* JS 打开时置为 flex */
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.8);
  z-index: 9999999;
  justify-content: center;
  align-items: center;
}

.modal-overlay--dark {
  background: rgba(0, 0, 0, 0.9);
  flex-direction: column;
}

.modal-box {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  color: #fff;
  padding: 30px;
  border-radius: 16px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-box--sm { max-width: 380px; padding: 28px; border-radius: 14px; }
.modal-box--md { max-width: 450px; }
.modal-box--lg { max-width: 500px; }
.modal-box--xl { max-width: 720px; width: 92%; max-height: 86vh; }
.modal-box--xxl { max-width: 780px; width: 94%; max-height: 86vh; padding: 26px; }
.modal-box--max { max-width: 860px; width: 94%; max-height: 88vh; }

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.modal-header h2 {
  margin: 0;
  color: #d4af37;
}

.modal-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
}

.modal-sub {
  color: #a0a0a0;
  font-size: 14px;
  margin: 0 0 18px;
}

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

.form-label {
  display: block;
  margin-bottom: 8px;
  color: #a0a0a0;
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #4a4a6a;
  background: #2a2a4a;
  color: #fff;
  box-sizing: border-box;
  font-family: inherit;
  font-size: 14px;
}

.form-textarea { resize: vertical; }
.form-select { cursor: pointer; }

.row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.config-section { margin-bottom: 20px; }

.config-section--divided {
  padding-bottom: 16px;
  border-bottom: 1px solid #4a4a6a;
}

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

.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  white-space: nowrap;
}

.btn--gold {
  background: linear-gradient(135deg, #d4af37, #f0c14b);
  color: #1a1a2e;
  font-weight: bold;
}

.btn--secondary { background: #4a4a6a; }
.btn--muted { background: #5a5a8a; }
.btn--green { background: #4a6a4a; }

.btn--ghost {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid #4a4a6a;
  color: #c0c0d0;
}

.btn--danger-ghost {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid #7a3a3a;
  color: #f0a0a0;
}

.btn--sm { padding: 6px 14px; font-size: 13px; }
.btn--md { padding: 8px 16px; border-radius: 6px; }
.btn--block { width: 100%; }
.btn--big { padding: 15px 30px; font-size: 16px; }

/* 卡片内小操作按钮 */
.cbtn {
  padding: 6px 10px;
  border: none;
  border-radius: 6px;
  color: #fff;
  cursor: pointer;
  font-size: 12px;
  font-family: inherit;
}

.cbtn--green { background: #4a6a4a; }
.cbtn--purple { background: #4a4a6a; }
.cbtn--teal { background: #3a5a6a; }
.cbtn--olive { background: #5a5a3a; }
.cbtn--red { background: #7a3a3a; }

.cbtn--gold {
  background: linear-gradient(135deg, #d4af37, #f0c14b);
  color: #1a1a2e;
  font-weight: bold;
  font-size: 13px;
}

.flex1 { flex: 1; }

/* ==================== 文本辅助 ==================== */

.hint {
  font-size: 12px;
  color: #666;
  margin-top: 5px;
}

.status-text {
  min-height: 20px;
  font-size: 13px;
}

.link { color: #7ec8e3; }
.link--dim { color: #666; font-size: 13px; }

.empty-hint {
  display: none;
  text-align: center;
  color: #666;
  padding: 20px;
}

/* ==================== 卡片与网格 ==================== */

.grid-cards {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.grid-cards--190 { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.grid-cards--220 { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }

.grid-span-all { grid-column: 1 / -1; }

.card {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid transparent;
}

.card--active { border-color: #d4af37; }

.card-cover {
  height: 100px;
  background-size: cover;
  background-position: center;
}

.card-cover--h90 { height: 90px; }
.card-cover--h120 { height: 120px; }

.card-cover--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #3a3a6a, #5a5a8a);
  font-size: 34px;
}

.card-cover--placeholder-green {
  background: linear-gradient(135deg, #2a4d3a, #3a6a5a);
}

.card-body { padding: 10px; }
.card-body--roomy { padding: 12px; }

.card-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}

.card-title {
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-title--lg { font-size: 15px; display: block; }

.card-desc {
  font-size: 12px;
  color: #999;
  margin: 6px 0;
  height: 32px;
  overflow: hidden;
}

.card-meta {
  font-size: 11px;
  color: #777;
  margin-bottom: 8px;
}

.card-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.card-byline {
  font-size: 12px;
  color: #7ec8e3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.badge {
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  white-space: nowrap;
}

.badge--public { background: #2e7d32; color: #fff; }
.badge--private { background: #555; color: #ddd; }
.badge--warn { color: #f0c14b; font-size: 11px; }
.badge--ok { color: #4ade80; font-size: 11px; }
.badge--dim { color: #999; font-size: 11px; }

/* ==================== 拖拽上传区 ==================== */

.dropzone {
  border: 2px dashed #4a4a6a;
  border-radius: 12px;
  padding: 10px;
  transition: border-color 0.2s, background 0.2s;
}

.dropzone.dragover {
  border-color: #d4af37;
  background: rgba(212, 175, 55, 0.08);
}

.dropzone-hint {
  text-align: center;
  color: #666;
  font-size: 12px;
  margin: 0 0 10px;
}

/* ==================== 个人中心 ==================== */

.profile-head {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  margin-bottom: 20px;
}

.avatar-circle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #d4af37, #f0c14b);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: #1a1a2e;
  font-weight: bold;
}

.profile-name { font-size: 20px; font-weight: bold; }

.profile-stats {
  font-size: 13px;
  color: #a0a0a0;
  margin-top: 4px;
}

.repo-entries {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.repo-entry {
  flex: 1;
  padding: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid #4a4a6a;
  border-radius: 10px;
  color: #fff;
  cursor: pointer;
  font-size: 14px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.section-head h3 {
  margin: 0;
  color: #c0c0d0;
  font-size: 16px;
}

/* ==================== 登录 / 恢复码 ==================== */

.auth-error {
  min-height: 20px;
  color: #f87171;
  font-size: 13px;
  margin-bottom: 8px;
}

.auth-links {
  display: flex;
  justify-content: space-between;
  margin-top: 14px;
  font-size: 13px;
}

.recovery-code {
  font-family: monospace;
  font-size: 22px;
  letter-spacing: 2px;
  background: #2a2a4a;
  border: 1px dashed #d4af37;
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 14px;
  color: #f0c14b;
}

/* ==================== 悬浮条 ==================== */

.preview-bar {
  display: none; /* JS 打开时置为 flex */
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(26, 26, 46, 0.92);
  border: 1px solid #d4af37;
  border-radius: 10px;
  padding: 8px 16px;
  z-index: 9999998;
  align-items: center;
  gap: 12px;
}

.preview-bar-text {
  color: #f0c14b;
  font-size: 13px;
}

.visitor-banner {
  display: none; /* JS 打开时置为 block */
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: linear-gradient(90deg, #d4af37, #f0c14b);
  color: #000;
  padding: 10px 20px;
  z-index: 9999998;
  text-align: center;
  font-size: 14px;
}

.visitor-banner button {
  margin-left: 15px;
  padding: 5px 15px;
  background: #1a1a2e;
  border: none;
  border-radius: 4px;
  color: #fff;
  cursor: pointer;
  font-size: 13px;
}

/* ==================== 拍照 / 分享 ==================== */

.photo-frame {
  position: relative;
  max-width: 90vw;
  max-height: 80vh;
}

.photo-frame img {
  max-width: 100%;
  max-height: 70vh;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.photo-actions {
  display: flex;
  gap: 15px;
  justify-content: center;
  margin-top: 20px;
}

.btn--download {
  background: #4ade80;
  color: #000;
  font-size: 16px;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn--gray {
  background: #6b7280;
  font-size: 16px;
  padding: 12px 24px;
}

.share-stats {
  margin-top: 15px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  text-align: center;
  color: #7ec8e3;
}
