/* ==========================================================================
   全局右侧吸附工具条（Side Dock）+ 反馈抽屉
   复用 design-tokens.css 的设计令牌；本文件变量均带兜底值，未加载令牌层也可用。
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. 吸附工具条（桌面端 only）
   -------------------------------------------------------------------------- */
/* 站点顶部导航 .base-index-top 为 sticky + z-index: 9800，
   吸附条与抽屉必须高于它，否则抽屉顶部会被导航遮挡 */
.side-dock {
    position: fixed;
    right: 0;
    bottom: 5%;
    transform: translateY(-50%);
    z-index: 9850;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.side-dock-items {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.side-dock .side-dock-item {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    width: 48px;
    height: 48px;
    padding: 0 14px;
    box-sizing: border-box;
    overflow: hidden;
    white-space: nowrap;
    cursor: pointer;
    font-family: inherit;
    font-size: var(--font-md, 14px);
    font-weight: 600;
    color: var(--tech-accent-strong, #0284c7);
    background: var(--tech-panel, #ffffff);
    border: 1px solid var(--tech-line, #e2e8f0);
    border-right: 0;
    border-radius: var(--radius-md, 12px) 0 0 var(--radius-md, 12px);
    box-shadow: -4px 2px 14px rgba(15, 23, 42, .12);
    transition: width var(--dur-fast, .2s) var(--ease, ease),
        background var(--dur-fast, .2s) var(--ease, ease),
        color var(--dur-fast, .2s) var(--ease, ease),
        box-shadow var(--dur-fast, .2s) var(--ease, ease);
}

.side-dock .side-dock-item > i {
    flex-shrink: 0;
    width: 16px;
    text-align: center;
    font-size: var(--font-lg, 15px);
}

.side-dock .side-dock-label {
    display: inline-block;
    max-width: 0;
    overflow: hidden;
    opacity: 0;
    white-space: nowrap;
    transition: max-width var(--dur-fast, .2s) var(--ease, ease),
        opacity var(--dur-fast, .2s) var(--ease, ease);
}

.side-dock .side-dock-item:hover,
.side-dock .side-dock-item:focus-visible {
    background: var(--tech-grad, linear-gradient(135deg, #0ea5e9 0%, #6366f1 100%));
    border-color: transparent;
    color: #ffffff;
    box-shadow: var(--shadow-brand, 0 8px 18px rgba(14, 165, 233, .28));
    outline: none;
}

.side-dock:hover .side-dock-item,
.side-dock:focus-within .side-dock-item {
    width: 176px;
}

.side-dock:hover .side-dock-label,
.side-dock:focus-within .side-dock-label {
    max-width: 120px;
    opacity: 1;
}

/* 移动端不展示吸附条，页脚入口继续可用 */
@media (max-width: 991px) {
    .side-dock {
        display: none;
    }
}

/* --------------------------------------------------------------------------
   2. 反馈抽屉
   -------------------------------------------------------------------------- */
.feedback-drawer {
    position: fixed;
    inset: 0;
    /* 高于顶部导航 9800，避免抽屉头部与遮罩被导航栏压住；
       保持低于登录弹窗 52000，保证登录框始终在最上层 */
    z-index: 9900;
    display: flex;
    justify-content: flex-end;
}

.feedback-drawer[hidden] {
    display: none;
}

.feedback-drawer-mask {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .45);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    animation: fd-fade-in .2s ease both;
}

.feedback-drawer-panel {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    width: 460px;
    max-width: 100%;
    height: 100%;
    background: var(--tech-panel, #ffffff);
    color: var(--tech-text, #0f172a);
    border-left: 1px solid var(--tech-line, #e2e8f0);
    box-shadow: -12px 0 32px rgba(15, 23, 42, .18);
    animation: fd-slide-in .25s ease both;
}

.feedback-drawer-panel *,
.feedback-drawer-panel *::before,
.feedback-drawer-panel *::after {
    box-sizing: border-box;
}

@keyframes fd-fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fd-slide-in {
    from {
        transform: translateX(100%);
    }

    to {
        transform: translateX(0);
    }
}

/* ---------- 抽屉头部 ---------- */
.feedback-drawer-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-3, 12px);
    padding: var(--space-5, 20px) var(--space-5, 20px) var(--space-4, 16px);
    border-bottom: 1px solid var(--tech-line, #e2e8f0);
    background: linear-gradient(180deg, var(--tech-panel-2, #f8fafc) 0%, var(--tech-panel, #ffffff) 100%);
}

.feedback-drawer-head-main {
    min-width: 0;
}

.feedback-drawer-title {
    display: flex;
    align-items: center;
    gap: var(--space-2, 8px);
    margin: 0;
    font-size: var(--font-xl, 18px);
    font-weight: 700;
    line-height: 1.4;
    color: var(--tech-text, #0f172a);
}

.feedback-drawer-title > i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    font-size: var(--font-md, 14px);
    color: var(--tech-accent-strong, #0284c7);
    background: var(--tech-accent-soft, rgba(14, 165, 233, .10));
    border: 1px solid var(--tech-accent-line, rgba(14, 165, 233, .30));
    border-radius: var(--radius-circle, 50%);
}

.feedback-drawer-sub {
    margin: var(--space-2, 8px) 0 0;
    font-size: var(--font-xs, 12px);
    color: var(--tech-text-3, #94a3b8);
    line-height: 1.6;
}

.feedback-drawer-close {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    cursor: pointer;
    font-size: var(--font-md, 14px);
    color: var(--tech-text-2, #64748b);
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm, 8px);
    transition: color var(--dur-fast, .2s) var(--ease, ease),
        background var(--dur-fast, .2s) var(--ease, ease),
        border-color var(--dur-fast, .2s) var(--ease, ease);
}

.feedback-drawer-close:hover {
    color: var(--tech-text, #0f172a);
    background: var(--tech-panel-2, #f8fafc);
    border-color: var(--tech-line, #e2e8f0);
}

/* ---------- 表单骨架 ---------- */
.feedback-form {
    display: flex;
    flex: 1;
    min-height: 0;
    flex-direction: column;
}

.feedback-form-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: var(--space-4, 16px) var(--space-5, 20px) var(--space-2, 8px);
    -webkit-overflow-scrolling: touch;
}

.feedback-form-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-3, 12px);
    padding: var(--space-3, 12px) var(--space-5, 20px);
    border-top: 1px solid var(--tech-line, #e2e8f0);
    background: var(--tech-panel, #ffffff);
}

/* ---------- 字段 ---------- */
.fd-field {
    margin-bottom: var(--space-4, 16px);
}

.fd-label {
    display: block;
    margin-bottom: 7px;
    font-size: var(--font-sm, 13px);
    font-weight: 600;
    color: var(--tech-text, #0f172a);
    line-height: 1.4;
}

.fd-required {
    color: var(--tech-danger, #f43f5e);
}

.fd-control {
    display: block;
    width: 100%;
    padding: 9px var(--space-3, 12px);
    font-family: inherit;
    font-size: var(--font-md, 14px);
    line-height: 1.5;
    color: var(--tech-text, #0f172a);
    background: var(--tech-panel, #ffffff);
    border: 1px solid var(--tech-line, #e2e8f0);
    border-radius: var(--radius-sm, 8px);
    transition: border-color var(--dur-fast, .2s) var(--ease, ease),
        box-shadow var(--dur-fast, .2s) var(--ease, ease);
}

.fd-control::placeholder {
    color: var(--tech-text-3, #94a3b8);
}

.fd-control:focus {
    outline: none;
    border-color: var(--tech-accent, #0ea5e9);
    box-shadow: 0 0 0 3px var(--tech-accent-soft, rgba(14, 165, 233, .10));
}

textarea.fd-control {
    min-height: 84px;
    resize: vertical;
}

select.fd-control {
    height: 40px;
    padding-right: 30px;
    cursor: pointer;
}

/* 类型切换 */
.fd-segmented {
    display: flex;
    gap: 6px;
    padding: 4px;
    background: var(--tech-panel-2, #f8fafc);
    border: 1px solid var(--tech-line, #e2e8f0);
    border-radius: var(--radius-md, 12px);
}

.fd-seg {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 10px;
    cursor: pointer;
    font-family: inherit;
    font-size: var(--font-sm, 13px);
    font-weight: 600;
    color: var(--tech-text-2, #64748b);
    background: transparent;
    border: 0;
    border-radius: var(--radius-xs, 6px);
    transition: color var(--dur-fast, .2s) var(--ease, ease),
        background var(--dur-fast, .2s) var(--ease, ease),
        box-shadow var(--dur-fast, .2s) var(--ease, ease);
}

.fd-seg:hover {
    color: var(--tech-accent-strong, #0284c7);
}

.fd-seg.is-active {
    color: #ffffff;
    background: var(--tech-grad, linear-gradient(135deg, #0ea5e9 0%, #6366f1 100%));
    box-shadow: var(--shadow-brand, 0 8px 18px rgba(14, 165, 233, .28));
}

/* 联系方式折叠 */
.fd-contact-fold {
    margin: 0 0 var(--space-4, 16px);
    overflow: hidden;
    background: var(--tech-panel-2, #f8fafc);
    border: 1px solid var(--tech-line, #e2e8f0);
    border-radius: var(--radius-md, 12px);
}

.fd-contact-summary {
    display: flex;
    align-items: center;
    gap: var(--space-2, 8px);
    padding: 10px var(--space-3, 12px);
    cursor: pointer;
    list-style: none;
    font-size: var(--font-sm, 13px);
    font-weight: 600;
    color: var(--tech-text-2, #64748b);
}

.fd-contact-summary::-webkit-details-marker {
    display: none;
}

.fd-contact-arrow {
    margin-left: auto;
    font-size: var(--font-xs, 12px);
    transition: transform var(--dur-fast, .2s) var(--ease, ease);
}

.fd-contact-fold[open] .fd-contact-arrow {
    transform: rotate(180deg);
}

.fd-contact-fold .fd-field {
    margin: 0 var(--space-3, 12px) var(--space-3, 12px);
}

/* 机构定制勾选 */
.fd-check {
    display: flex;
    align-items: center;
    gap: var(--space-2, 8px);
    margin: 0 0 var(--space-4, 16px);
    cursor: pointer;
    font-size: var(--font-sm, 13px);
    color: var(--tech-text, #0f172a);
}

.fd-check input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--tech-accent, #0ea5e9);
    cursor: pointer;
}

/* ---------- 附件 ---------- */
.fd-attach-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2, 8px);
}

.fd-attach-list:not(:empty) {
    margin-bottom: var(--space-2, 8px);
}

.fd-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    padding: 5px 8px 5px 10px;
    font-size: var(--font-xs, 12px);
    color: var(--tech-text-2, #64748b);
    background: var(--tech-panel-2, #f8fafc);
    border: 1px solid var(--tech-line, #e2e8f0);
    border-radius: var(--radius-pill, 999px);
}

.fd-chip > i {
    flex-shrink: 0;
    color: var(--tech-accent-strong, #0284c7);
}

.fd-chip-name {
    max-width: 170px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--tech-text, #0f172a);
}

.fd-chip-size {
    flex-shrink: 0;
    font-size: 11px;
    color: var(--tech-text-3, #94a3b8);
}

.fd-chip-remove {
    flex-shrink: 0;
    padding: 0 2px;
    cursor: pointer;
    font-size: 15px;
    line-height: 1;
    color: var(--tech-text-3, #94a3b8);
    background: transparent;
    border: 0;
}

.fd-chip-remove:hover {
    color: var(--tech-danger, #f43f5e);
}

.fd-attach-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.fd-upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    cursor: pointer;
    font-family: inherit;
    font-size: var(--font-xs, 12px);
    font-weight: 600;
    color: var(--tech-accent-strong, #0284c7);
    background: var(--tech-accent-soft, rgba(14, 165, 233, .10));
    border: 1px dashed var(--tech-accent-line, rgba(14, 165, 233, .30));
    border-radius: var(--radius-pill, 999px);
    transition: background var(--dur-fast, .2s) var(--ease, ease),
        border-color var(--dur-fast, .2s) var(--ease, ease);
}

.fd-upload-btn:hover {
    border-color: var(--tech-accent, #0ea5e9);
}

.fd-upload-btn:disabled {
    cursor: not-allowed;
    opacity: .6;
}

.fd-file-input {
    display: none;
}

.fd-hint {
    font-size: var(--font-xs, 12px);
    color: var(--tech-text-3, #94a3b8);
}

/* ---------- 错误提示 ---------- */
.fd-error {
    margin: 0 0 var(--space-3, 12px);
    padding: 9px var(--space-3, 12px);
    font-size: var(--font-sm, 13px);
    line-height: 1.5;
    color: #be123c;
    background: var(--tech-danger-soft, rgba(244, 63, 94, .10));
    border: 1px solid rgba(244, 63, 94, .30);
    border-radius: var(--radius-sm, 8px);
}

.fd-error[hidden] {
    display: none;
}

/* ---------- 底部操作 ---------- */
.feedback-my-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: var(--font-sm, 13px);
    font-weight: 600;
    color: var(--tech-accent-strong, #0284c7);
    text-decoration: none;
}

.feedback-my-link:hover {
    text-decoration: underline;
}

.feedback-form-actions {
    display: flex;
    gap: var(--space-2, 8px);
    margin-left: auto;
}

.fd-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 18px;
    cursor: pointer;
    font-family: inherit;
    font-size: var(--font-sm, 13px);
    font-weight: 600;
    border-radius: var(--radius-sm, 8px);
    transition: filter var(--dur-fast, .2s) var(--ease, ease),
        background var(--dur-fast, .2s) var(--ease, ease),
        color var(--dur-fast, .2s) var(--ease, ease),
        border-color var(--dur-fast, .2s) var(--ease, ease);
}

.fd-btn-ghost {
    color: var(--tech-text-2, #64748b);
    background: var(--tech-panel, #ffffff);
    border: 1px solid var(--tech-line, #e2e8f0);
}

.fd-btn-ghost:hover {
    color: var(--tech-accent-strong, #0284c7);
    border-color: var(--tech-accent-line, rgba(14, 165, 233, .30));
}

.fd-btn-primary {
    color: #ffffff;
    background: var(--tech-grad, linear-gradient(135deg, #0ea5e9 0%, #6366f1 100%));
    border: 1px solid transparent;
    box-shadow: var(--shadow-brand, 0 8px 18px rgba(14, 165, 233, .28));
}

.fd-btn-primary:hover {
    filter: brightness(1.05);
}

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

/* --------------------------------------------------------------------------
   3. ElMessage 不可用时的轻量提示
   -------------------------------------------------------------------------- */
.side-dock-toast {
    position: fixed;
    top: 24px;
    left: 50%;
    z-index: 45000;
    max-width: 82vw;
    padding: 10px 18px;
    font-size: var(--font-sm, 13px);
    line-height: 1.5;
    color: #ffffff;
    background: rgba(15, 23, 42, .88);
    border-radius: var(--radius-md, 12px);
    box-shadow: 0 8px 24px rgba(15, 23, 42, .28);
    transform: translateX(-50%);
}

.side-dock-toast.is-success {
    background: #0f9f6e;
}

.side-dock-toast.is-error {
    background: #e11d48;
}

.side-dock-toast.is-warning {
    background: #d97706;
}

/* --------------------------------------------------------------------------
   4. 移动端抽屉
   -------------------------------------------------------------------------- */
@media (max-width: 640px) {
    .feedback-drawer-panel {
        width: 100%;
        border-left: 0;
    }

    .feedback-drawer-head {
        padding: var(--space-4, 16px);
    }

    .feedback-form-body {
        padding: var(--space-4, 16px) var(--space-4, 16px) var(--space-2, 8px);
    }

    .feedback-form-foot {
        padding: var(--space-3, 12px) var(--space-4, 16px);
    }

    .feedback-form-actions {
        width: 100%;
        margin-left: 0;
    }

    .feedback-form-actions .fd-btn {
        flex: 1;
    }
}

@media (prefers-reduced-motion: reduce) {

    .side-dock .side-dock-item,
    .side-dock .side-dock-label,
    .feedback-drawer-mask,
    .feedback-drawer-panel {
        animation: none;
        transition: none;
    }
}
