/* contribute.css — 公开投稿页专属样式（页面无 nav.js，自含顶栏） */

.cb-body { min-height: 100vh; display: flex; flex-direction: column; }
.cb-body [hidden] { display: none !important; }

.cb-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px max(24px, calc((100% - 1384px) / 2)); border-bottom: 1px solid var(--line);
  background: rgba(var(--c-panel), 0.85); backdrop-filter: blur(10px);
  position: sticky; top: 0; z-index: 10;
}
.cb-brand { font-weight: 700; font-size: 15px; color: var(--text); letter-spacing: 0.02em; }
.cb-home { font-size: 13px; color: var(--muted); text-decoration: none; }
.cb-home:hover { color: var(--accent); }

.cb-main { width: 100%; max-width: 1440px; margin: 0 auto; padding: 24px 28px 36px; flex: 1; }
.cb-page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; margin-bottom: 18px; }
.cb-eyebrow { color: var(--accent); font-size: 13px; font-weight: 600; margin: 0 0 6px; }
.cb-page-head h1 { font-size: clamp(24px, 2.2vw, 32px); line-height: 1.4; margin: 0 0 6px; letter-spacing: -0.02em; }
.cb-page-intro { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.8; }

.cb-tabs { display: flex; flex-shrink: 0; gap: 6px; width: 256px; padding: 5px; border: 1px solid var(--line); border-radius: 14px; background: rgba(var(--c-panel), 0.65); }
.cb-tab {
  flex: 1; padding: 11px 0; border-radius: 10px; font-size: 14px; font-weight: 600;
  background: rgba(var(--c-panel), 0.6); color: var(--muted);
  border: 1px solid var(--line); cursor: pointer; transition: all 0.15s;
}
.cb-tab.active { color: rgb(var(--c-deep)); background: var(--accent); border-color: var(--accent); }

.cb-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
  padding: 24px; box-shadow: 0 8px 30px rgba(var(--c-shadow), 0.12);
}
.cb-lead { font-size: 13px; color: var(--muted); line-height: 1.7; margin: 0 0 18px; }
.cb-form-grid { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(320px, 1fr); gap: 32px; }
.cb-editor, .cb-sidebar, .cb-submit-confirm { min-width: 0; }
.cb-sidebar { border-left: 1px solid var(--line); padding-left: 28px; }
.cb-section-head { margin-bottom: 14px; }
.cb-section-head h2 { margin: 0 0 6px; font-size: 18px; line-height: 1.5; }
.cb-section-head p, .cb-field-hint { color: var(--muted); font-size: 13px; line-height: 1.7; margin: 0; }
.cb-field-hint { margin-bottom: 10px; }
.cb-contact-section { padding-top: 16px; border-top: 1px solid var(--line); margin-top: 16px; }
.cb-editor > .cb-field:last-child, .cb-sidebar > .cb-field:last-child { margin-bottom: 0; }
.cb-submit-area { display: grid; grid-template-columns: minmax(300px, 1fr) minmax(0, 1.3fr); gap: 24px; border-top: 1px solid var(--line); padding-top: 16px; margin-top: 20px; }
.cb-submit-note { margin: 12px 0 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
#cbQueryCard, #cbSuccessCard { max-width: 960px; margin-inline: auto; }
#cbQueryCard { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; }
#cbQueryCard > :not(.cb-field) { grid-column: 1 / -1; }
#cbQueryBtn { width: 200px; justify-self: end; }

.cb-field { margin-bottom: 16px; min-width: 0; }
.cb-label { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 9px; }
.cb-label em { color: var(--error, #e5484d); font-style: normal; }
.cb-label-title { flex-shrink: 0; white-space: nowrap; }
.cb-optional { font-weight: 400; font-size: 12px; color: var(--muted); min-width: 0; }
.cb-counter { margin-left: auto; font-weight: 400; font-size: 12px; color: var(--muted); }

.cb-input {
  width: 100%; box-sizing: border-box; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: rgb(var(--c-input));
  color: var(--text); font-size: 16px; font-family: inherit; outline: none; min-width: 0; min-height: 44px;
}
.cb-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--c-accent), 0.12); }
.cb-textarea { min-height: 220px; resize: vertical; line-height: 1.85; }

.cb-chips { display: flex; gap: 10px; flex-wrap: wrap; }
.cb-chip {
  padding: 10px 18px; min-height: 44px; border-radius: 10px; font-size: 14px; cursor: pointer;
  background: rgb(var(--c-input)); color: var(--muted); border: 1px solid var(--line);
  transition: all 0.15s;
}
.cb-chip:hover { color: var(--text); }
.cb-chip.active { color: rgb(var(--c-deep)); background: var(--accent); border-color: var(--accent); font-weight: 600; }

.cb-link-row { display: flex; gap: 8px; margin-bottom: 8px; }
.cb-link-row .cb-input { flex: 1; }
.cb-link-del {
  flex-shrink: 0; width: 38px; border-radius: 10px; border: 1px solid rgb(var(--c-edge));
  background: rgb(var(--c-input)); color: var(--muted); cursor: pointer; font-size: 15px;
}
.cb-link-del:hover { color: var(--error, #e5484d); }

.cb-btn-ghost {
  padding: 10px 14px; min-height: 44px; border-radius: 10px; font-size: 13px; cursor: pointer;
  background: rgb(var(--c-input)); color: var(--text);
  border: 1px solid var(--line); transition: all 0.15s; text-decoration: none; display: inline-block;
}
.cb-btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.cb-up-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.cb-up-hint { font-size: 12px; color: var(--muted); margin-top: 12px; line-height: 1.8; }

.cb-previews { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.cb-preview {
  position: relative; width: 76px; height: 76px; border-radius: 10px; overflow: hidden;
  border: 1px solid rgb(var(--c-edge));
}
.cb-preview img { width: 100%; height: 100%; object-fit: cover; }
.cb-preview .cb-x {
  position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; border-radius: 6px;
  background: rgba(0,0,0,0.62); color: #fff; border: 0; font-size: 12px; cursor: pointer; line-height: 20px;
}

.cb-filelist { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.cb-filelist li {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 10px;
  background: rgb(var(--c-input)); border: 1px solid rgb(var(--c-edge)); font-size: 13px;
}
.cb-filelist .cb-file-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.cb-filelist .cb-file-size { color: var(--muted); font-size: 12px; flex-shrink: 0; }
.cb-filelist .cb-file-kind {
  flex-shrink: 0; font-size: 11px; padding: 2px 8px; border-radius: 999px;
  background: rgba(var(--c-accent), 0.12); color: var(--accent);
}
.cb-filelist button {
  border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 15px; flex-shrink: 0;
}
.cb-filelist button:hover { color: var(--error, #e5484d); }

.cb-contact { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.cb-contact > :last-child { grid-column: 1 / -1; }

.cb-captcha { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.cb-captcha .cb-input { width: 130px; text-transform: none; letter-spacing: 0.2em; }
.cb-captcha img { height: 44px; border-radius: 8px; cursor: pointer; }
.cb-captcha .cb-btn-ghost { flex-shrink: 0; white-space: nowrap; }

.cb-agree {
  display: flex; gap: 10px; align-items: flex-start; font-size: 12.5px; color: var(--muted);
  line-height: 1.7; margin: 4px 0 18px; cursor: pointer;
}
.cb-agree input { margin-top: 4px; }
.cb-agree input { flex-shrink: 0; width: 18px; height: 18px; accent-color: var(--accent); }
.cb-body button:focus-visible, .cb-body a:focus-visible, .cb-agree input:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.cb-msg {
  padding: 10px 14px; border-radius: 10px; font-size: 13px; margin-bottom: 14px; line-height: 1.6;
}
.cb-msg.err { background: rgba(225, 72, 77, 0.12); color: #e5484d; }
.cb-msg.ok { background: rgba(63, 167, 106, 0.12); color: #3fa76a; }

.cb-progress {
  position: relative; height: 26px; border-radius: 8px; overflow: hidden;
  background: rgb(var(--c-input)); border: 1px solid rgb(var(--c-edge)); margin-bottom: 14px;
}
.cb-progress-bar {
  height: 100%; width: 0%; border-radius: 7px;
  background: repeating-linear-gradient(45deg, var(--accent), var(--accent) 10px, rgba(var(--c-accent), 0.7) 10px, rgba(var(--c-accent), 0.7) 20px);
  background-size: 28px 100%; animation: cb-stripes 0.8s linear infinite; transition: width 0.2s;
}
@keyframes cb-stripes { from { background-position: 0 0; } to { background-position: 28px 0; } }
.cb-progress-text {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: var(--text); text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.cb-btn-primary {
  width: 100%; padding: 13px 0; border-radius: 12px; font-size: 15px; font-weight: 700;
  color: rgb(var(--c-deep)); background: var(--accent); border: 0; cursor: pointer;
  transition: filter 0.15s;
}
.cb-btn-primary:hover { filter: brightness(1.08); }
.cb-btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

/* 成功态 */
.cb-success { text-align: center; padding: 46px 24px; }
.cb-success-icon {
  width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 50%;
  background: rgba(63, 167, 106, 0.14); color: #3fa76a; font-size: 32px; line-height: 64px;
}
.cb-success h2 { margin: 0 0 6px; color: var(--text); }
.cb-success p { color: var(--muted); font-size: 13.5px; margin: 6px 0; }
.cb-success-id {
  font-size: 26px; font-weight: 800; letter-spacing: 0.06em; color: var(--accent);
  font-family: ui-monospace, Consolas, monospace; margin: 8px 0; user-select: all;
  overflow-wrap: anywhere;
}
.cb-muted { color: var(--muted); }
.cb-success-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 18px; }
.cb-success-actions .cb-btn-primary { width: auto; padding: 11px 30px; }
.cb-back-home { line-height: 20px; padding: 11px 22px; }

/* 查询结果 */
.cb-query-result { border: 1px solid rgb(var(--c-edge)); border-radius: 12px; padding: 16px; margin-bottom: 14px; }
.cb-query-result .qr-row { display: flex; gap: 12px; font-size: 13.5px; margin-bottom: 8px; }
.cb-query-result .qr-k { color: var(--muted); flex-shrink: 0; width: 64px; }
.cb-query-result .qr-v { color: var(--text); min-width: 0; overflow-wrap: anywhere; }
#cbRecover { margin-top: 12px; }
.qr-badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.qr-badge.pending { background: rgba(217, 119, 6, 0.14); color: #d97706; }
.qr-badge.accepted { background: rgba(63, 167, 106, 0.14); color: #3fa76a; }
.qr-badge.rejected { background: rgba(225, 72, 77, 0.12); color: #e5484d; }

.cb-foot {
  text-align: center; padding: 18px; font-size: 12px; color: var(--muted);
  border-top: 1px solid var(--line);
}

/* 草稿恢复提示 */
.cb-draft-note {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  margin: -6px 0 16px; padding: 8px 12px; border-radius: 10px; font-size: 12.5px;
  color: var(--text); background: rgba(var(--c-accent), 0.08); border: 1px solid rgba(var(--c-accent), 0.25);
}
.cb-link-btn { background: none; border: none; padding: 0; color: var(--accent); font-size: 12.5px; cursor: pointer; text-decoration: underline; }

/* 附件拖入 */
.cb-dropzone { padding: 16px; border: 1px dashed rgba(var(--c-accent), 0.4); background: rgba(var(--c-accent), 0.035); border-radius: 12px; transition: box-shadow 0.15s, background 0.15s; }
.cb-dropzone.dragover { box-shadow: 0 0 0 2px var(--accent); background: rgba(var(--c-accent), 0.06); }

/* 完整稿件：上传文档自动提炼标题与正文 */
.cb-doc-tip {
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  margin: -4px 0 18px; padding: 10px 12px; border-radius: 10px; font-size: 12.5px; line-height: 1.6;
  color: var(--text); background: rgba(var(--c-accent), 0.08); border: 1px solid rgba(var(--c-accent), 0.25);
}
.cb-doc-tip span { flex: 1 1 260px; }
.cb-autofill { color: var(--accent); }

/* 「查看全文」：投稿人确认系统读到的文档内容 */
.cb-filelist .cb-file-view { font-size: 12px; color: var(--accent); padding: 2px 6px; border-radius: 6px; }
.cb-filelist .cb-file-view:hover { color: var(--accent); background: rgba(var(--c-accent), 0.12); }
.cb-dv-mask { position: fixed; inset: 0; z-index: 1000; background: rgba(5, 10, 18, 0.62); display: flex; align-items: center; justify-content: center; padding: 16px; }
.cb-dv { width: min(760px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; border-radius: 14px; background: var(--panel); border: 1px solid rgb(var(--c-edge)); color: var(--text); box-shadow: 0 18px 50px rgba(0,0,0,0.35); }
.cb-dv-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px 6px; }
.cb-dv-title { flex: 1; min-width: 0; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cb-dv-close { border: 0; background: none; color: var(--muted); font-size: 16px; cursor: pointer; }
.cb-dv-tip { padding: 0 16px 10px; font-size: 12px; color: var(--muted); border-bottom: 1px solid rgb(var(--c-edge)); }
.cb-dv-body { overflow: auto; padding: 14px 18px 18px; font-size: 14px; line-height: 1.8; word-break: break-word; }
.cb-dv-body p { margin: 0 0 8px; }
.cb-dv-body h1, .cb-dv-body h2, .cb-dv-body h3 { margin: 12px 0 6px; line-height: 1.5; }
.cb-dv-body h1 { font-size: 19px; text-align: center; }
.cb-dv-body h2 { font-size: 17px; }
.cb-dv-body h3 { font-size: 15px; }
.cb-dv-body table { border-collapse: collapse; margin: 8px 0 12px; font-size: 13px; display: block; overflow-x: auto; }
.cb-dv-body td, .cb-dv-body th { border: 1px solid rgb(var(--c-edge)); padding: 4px 8px; vertical-align: top; }
.cb-dv-body img { display: block; max-width: 100%; margin: 8px auto; border-radius: 6px; background: #fff; }
.cb-dv-text { white-space: pre-wrap; }

@media (max-width: 1000px) {
  .cb-main { padding: 20px 20px 32px; }
  .cb-page-head { align-items: flex-start; flex-direction: column; gap: 14px; }
  .cb-card { padding: 20px; }
  .cb-form-grid { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .cb-sidebar { padding: 18px 0 0; border-left: 0; border-top: 1px solid var(--line); }
  .cb-contact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cb-contact > :last-child { grid-column: 1 / -1; }
  .cb-up-actions { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .cb-textarea { min-height: 200px; }
  .cb-submit-area { grid-template-columns: minmax(0, 1fr); gap: 8px; }
}
@media (max-width: 600px) {
  .cb-top { padding: 14px 16px; gap: 12px; }
  .cb-brand { font-size: 14px; }
  .cb-home { flex-shrink: 0; }
  .cb-main { padding: 18px 12px 24px; }
  .cb-page-head { padding-inline: 4px; margin-bottom: 14px; }
  .cb-page-head h1 { font-size: 24px; }
  .cb-tabs { width: 100%; }
  .cb-card { padding: 16px; border-radius: 14px; }
  .cb-textarea { min-height: 180px; }
  .cb-chips { gap: 8px; }
  .cb-chip { flex: 1; padding-inline: 8px; white-space: nowrap; }
  .cb-contact, #cbQueryCard { grid-template-columns: minmax(0, 1fr); }
  .cb-up-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cb-captcha { gap: 8px; }
  .cb-captcha .cb-input { flex: 1 1 100px; width: 100px; }
  .cb-captcha img { max-width: 100%; }
  .cb-captcha .cb-btn-ghost { padding-inline: 10px; }
  .cb-filelist li { flex-wrap: wrap; gap: 6px; padding: 8px; }
  .cb-filelist .cb-file-name { flex-basis: calc(100% - 65px); }
  #cbQueryBtn { width: 100%; }
  .cb-success-actions > * { width: 100%; }
  .cb-success-actions .cb-btn-primary { width: 100%; }
  .cb-success-id { font-size: 22px; }
  .cb-foot { line-height: 1.8; }
}
