/* ============================================================
   反馈子站(feedback.html)专用样式,v73
   - 复用 css/styles.css 的主题变量与 .btn / .form-group
   - ⚠️ styles.css 里 html,body 是 height:100% + overflow:hidden(SPA 布局),
     本页必须显式放开滚动,否则整页无法滚动。
   - 全站约定:不用 emoji,图标一律内联 SVG;颜色只走主题变量。
   ============================================================ */

html.fb-html {
    height: auto;
    overflow-x: hidden;
    overflow-y: auto;
}

html.fb-html body {
    height: auto;
    overflow: visible;
    background:
        radial-gradient(900px 420px at 12% -8%, var(--accent-light), transparent 62%),
        var(--bg-primary);
    min-height: 100vh;
}

.fb-wrap {
    width: 100%;
    max-width: 880px;
    margin: 0 auto;
    padding: 28px 20px 72px;
    box-sizing: border-box;
}

/* ---------- 顶部 ---------- */
.fb-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 22px;
    flex-wrap: wrap;
}

.fb-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
}

.fb-brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex: 0 0 auto;
}

.fb-brand-mark svg {
    width: 18px;
    height: 18px;
    display: block;
}

.fb-header-spacer { flex: 1 1 auto; }

.fb-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 7px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    transition: color var(--transition), border-color var(--transition);
}

.fb-back:hover {
    color: var(--text-primary);
    border-color: var(--border-light);
}

.fb-back svg { width: 14px; height: 14px; }

/* ---------- 标题 ---------- */
.fb-title {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 6px;
    color: var(--text-primary);
}

.fb-sub {
    margin: 0 0 22px;
    font-size: 13.5px;
    color: var(--text-secondary);
    max-width: 62ch;
}

/* ---------- 卡片 ---------- */
.fb-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 22px;
    margin-bottom: 18px;
    box-shadow: var(--shadow-sm);
}

.fb-card > h2 {
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 4px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.fb-card > h2 svg { width: 16px; height: 16px; color: var(--accent); flex: 0 0 auto; }

.fb-card-desc {
    font-size: 12.5px;
    color: var(--text-muted);
    margin: 0 0 16px;
}

/* ---------- 类型选择(药丸按钮,不用原生 select) ---------- */
.fb-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
}

.fb-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 12.5px;
    cursor: pointer;
    transition: all var(--transition);
    user-select: none;
}

.fb-chip:hover { border-color: var(--border-light); color: var(--text-primary); }

.fb-chip-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.fb-chip-input:checked + .fb-chip {
    background: var(--accent-light);
    border-color: var(--accent);
    color: var(--text-primary);
    font-weight: 600;
}

.fb-chip-input:focus-visible + .fb-chip {
    box-shadow: 0 0 0 3px var(--accent-light);
}

/* ---------- 表单控件 ---------- */
.fb-field-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

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

.fb-input,
.fb-textarea {
    width: 100%;
    box-sizing: border-box;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    font-size: 13px;
    color: var(--text-primary);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.fb-textarea {
    resize: vertical;
    min-height: 96px;
    line-height: 1.65;
    font-family: inherit;
}

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

.fb-input::placeholder,
.fb-textarea::placeholder { color: var(--text-muted); }

.fb-counter {
    display: block;
    text-align: right;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

.fb-counter.is-over { color: var(--danger); }

/* ---------- 诊断信息 ---------- */
.fb-diag {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    margin-bottom: 18px;
}

.fb-diag-head {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.fb-diag-head svg { width: 15px; height: 15px; color: var(--accent); }

.fb-diag-desc {
    font-size: 12px;
    color: var(--text-muted);
    margin: 6px 0 10px;
    line-height: 1.6;
}

.fb-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    color: var(--text-secondary);
    cursor: pointer;
}

.fb-check input[type="checkbox"] { accent-color: var(--accent); }

.fb-diag details { margin-top: 10px; }

.fb-diag summary {
    font-size: 12.5px;
    color: var(--accent);
    cursor: pointer;
    user-select: none;
}

.fb-diag pre {
    margin: 8px 0 0;
    max-height: 240px;
    overflow: auto;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    font-size: 11.5px;
    line-height: 1.6;
    color: var(--text-secondary);
    white-space: pre-wrap;
    word-break: break-all;
}

/* ---------- 操作区 ---------- */
.fb-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.fb-actions .fb-spacer { flex: 1 1 auto; }

.fb-btn-icon { display: inline-flex; align-items: center; gap: 6px; }
.fb-btn-icon svg { width: 14px; height: 14px; }

.fb-btn[disabled] { opacity: 0.6; cursor: not-allowed; }

/* ---------- 内联提示条 ---------- */
.fb-alert {
    display: none;
    margin-top: 16px;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    font-size: 13px;
    line-height: 1.6;
    border: 1px solid transparent;
    white-space: pre-wrap;
    word-break: break-word;
}

.fb-alert.is-show { display: block; }
.fb-alert.is-error { background: rgba(239, 68, 68, 0.12); border-color: rgba(239, 68, 68, 0.4); color: var(--text-primary); }
.fb-alert.is-ok { background: rgba(16, 185, 129, 0.12); border-color: rgba(16, 185, 129, 0.4); color: var(--text-primary); }
.fb-alert.is-info { background: var(--accent-light); border-color: rgba(99, 102, 241, 0.4); color: var(--text-primary); }

/* ---------- 提交成功卡片 ---------- */
.fb-result { display: none; }
.fb-result.is-show { display: block; }

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

.fb-result-label {
    font-size: 12.5px;
    color: var(--text-muted);
    min-width: 62px;
}

.fb-result-value {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: var(--text-primary);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 5px 10px;
    word-break: break-all;
}

/* ---------- 我的提交 ---------- */
.fb-mine-list { display: flex; flex-direction: column; gap: 10px; }

.fb-mine-item {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 11px 13px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
}

.fb-mine-id {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12.5px;
    color: var(--text-primary);
    font-weight: 600;
}

.fb-mine-title {
    flex: 1 1 200px;
    min-width: 0;
    font-size: 13px;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fb-mine-time { font-size: 11.5px; color: var(--text-muted); }

.fb-empty {
    font-size: 13px;
    color: var(--text-muted);
    padding: 8px 0;
}

/* ---------- 状态徽标 ---------- */
.fb-badge {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 600;
    border: 1px solid transparent;
    white-space: nowrap;
}

.fb-badge--new { background: rgba(99, 102, 241, 0.16); color: #a5b4fc; border-color: rgba(99, 102, 241, 0.45); }
.fb-badge--doing { background: rgba(245, 158, 11, 0.16); color: #fbbf24; border-color: rgba(245, 158, 11, 0.45); }
.fb-badge--fixed { background: rgba(16, 185, 129, 0.16); color: #34d399; border-color: rgba(16, 185, 129, 0.45); }
.fb-badge--ignored { background: var(--bg-hover); color: var(--text-muted); border-color: var(--border-light); }

[data-theme="light"] .fb-badge--new { color: #4f46e5; }
[data-theme="light"] .fb-badge--doing { color: #b45309; }
[data-theme="light"] .fb-badge--fixed { color: #047857; }

/* ---------- 管理面板 ---------- */
.fb-admin-body { display: none; }
.fb-admin-body.is-show { display: block; }

.fb-admin-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin: 14px 0 12px;
}

.fb-admin-bar .fb-input { width: auto; flex: 1 1 200px; min-width: 160px; }

.fb-admin-counts {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
    font-size: 12.5px;
    color: var(--text-secondary);
    align-items: center;
}

.fb-admin-list { display: flex; flex-direction: column; gap: 12px; }

.fb-rep {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    overflow: hidden;
}

.fb-rep-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 13px;
    flex-wrap: wrap;
}

.fb-rep-head .fb-rep-title {
    flex: 1 1 220px;
    min-width: 0;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fb-rep-toggle {
    font-size: 12px;
    color: var(--accent);
    background: none;
    border: none;
    padding: 2px 4px;
}

.fb-rep-body {
    display: none;
    padding: 0 13px 13px;
    border-top: 1px solid var(--border-color);
}

.fb-rep.is-open .fb-rep-body { display: block; }

.fb-rep-field { margin-top: 12px; }

.fb-rep-field > span {
    display: block;
    font-size: 11.5px;
    color: var(--text-muted);
    margin-bottom: 4px;
    text-transform: none;
}

.fb-rep-field pre {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 12.5px;
    line-height: 1.65;
    color: var(--text-primary);
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    max-height: 320px;
    overflow: auto;
}

.fb-rep-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.fb-rep-actions .fb-input { flex: 1 1 180px; width: auto; }

.fb-btn-xs {
    padding: 5px 11px;
    font-size: 12px;
    border-radius: var(--radius-sm);
}

/* ---------- 图片附件(v75) ---------- */
.fb-img {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    margin-bottom: 18px;
}

.fb-img-head {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.fb-img-head svg { width: 15px; height: 15px; color: var(--accent); }

.fb-img-count { margin-left: auto; font-size: 12px; font-weight: 500; color: var(--text-muted); }

.fb-img-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin: 6px 0 10px;
    line-height: 1.6;
}

.fb-drop {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 14px;
    border-radius: var(--radius-md);
    border: 1px dashed var(--border-light);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 12.5px;
    cursor: pointer;
    transition: all var(--transition);
}

.fb-drop:hover,
.fb-drop.is-over {
    border-color: var(--accent);
    color: var(--text-primary);
    background: var(--accent-light);
}

.fb-drop svg { width: 15px; height: 15px; }

.fb-hidden-file {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.fb-img-status {
    display: none;
    margin-top: 9px;
    font-size: 12px;
    color: var(--text-secondary);
}

.fb-img-status.is-show { display: block; }
.fb-img-status.is-error { color: var(--danger); }

.fb-thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 11px;
}

.fb-thumbs:empty { margin-top: 0; }

.fb-thumb {
    position: relative;
    margin: 0;
    width: 118px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
    overflow: hidden;
}

.fb-thumb img {
    display: block;
    width: 100%;
    height: 78px;
    object-fit: cover;
    background: var(--bg-hover);
}

.fb-thumb.is-loading img { opacity: 0.35; }
.fb-thumb.is-broken img { opacity: 0.2; }

.fb-thumb figcaption {
    padding: 4px 6px;
    font-size: 10.5px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fb-thumb-del {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 14px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.fb-thumb-del:hover { background: var(--danger); }

.fb-thumb-open {
    position: absolute;
    top: 4px;
    left: 4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 12px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.fb-thumb-open:hover { background: var(--accent); }

.fb-ok-images { display: none; margin-top: 16px; }

.fb-ok-images-head {
    font-size: 12.5px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.fb-badge--img {
    background: rgba(14, 165, 233, 0.16);
    color: #38bdf8;
    border-color: rgba(14, 165, 233, 0.45);
}

[data-theme="light"] .fb-badge--img { color: #0369a1; }

/* ---------- 页脚 ---------- */
.fb-footer {
    margin-top: 26px;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.7;
    text-align: center;
}

.fb-footer-sep { margin: 0 8px; opacity: 0.5; }

.fb-footer-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    margin-left: 14px;
}

.fb-footer-link:hover { text-decoration: underline; }

/* ---------- 窄屏 ---------- */
@media (max-width: 640px) {
    .fb-wrap { padding: 18px 12px 56px; }
    .fb-card { padding: 16px; border-radius: var(--radius-md); }
    .fb-title { font-size: 20px; }
    .fb-result-value { font-size: 13.5px; }
    .fb-admin-bar .fb-input { flex: 1 1 100%; }
    .fb-actions .btn { flex: 1 1 auto; }
}

@media (prefers-reduced-motion: reduce) {
    .fb-chip,
    .fb-input,
    .fb-textarea,
    .fb-back { transition: none; }
}

/* 打印(把受理号打出来留档) */
@media print {
    .fb-back, .fb-actions, .fb-admin, .fb-diag { display: none !important; }
    html.fb-html body { background: #fff; }
    .fb-card { box-shadow: none; border-color: #ccc; }
}
