/* 识图下单条 — 搜索栏下单行横条，色系跟随站点 --brand */

.portal-layout .home-screenshot-strip {
    width: 100%;
    background: linear-gradient(90deg, var(--brand-light) 0%, var(--surface) 50%, var(--brand-light) 100%);
    border-bottom: 1px solid var(--border);
}

.portal-layout .home-screenshot-strip__inner {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 8px 0;
}

.portal-layout .home-screenshot-strip__icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    color: var(--brand);
}

.portal-layout .home-screenshot-strip__icon svg {
    display: block;
    width: 20px;
    height: 20px;
}

.portal-layout .home-screenshot-strip__text {
    flex: 1;
    min-width: 0;
    margin: 0;
    font-size: 13px;
    line-height: 1.35;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.portal-layout .home-screenshot-strip__label {
    font-weight: 700;
    color: var(--text);
}

.portal-layout .home-screenshot-strip__sep {
    margin: 0 5px;
    color: var(--border);
    font-weight: 400;
}

.portal-layout .home-screenshot-strip__sub {
    font-weight: 400;
    color: var(--text-secondary);
}

.portal-layout .home-screenshot-strip__help {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: var(--brand);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.portal-layout .home-screenshot-strip__help:hover {
    background: var(--brand-dark);
    box-shadow: 0 2px 8px color-mix(in srgb, var(--brand) 35%, transparent);
    transform: scale(1.06);
}

.portal-layout .home-screenshot-strip__help:active {
    transform: scale(0.96);
}

/* 识图说明弹窗 */
.home-screenshot-help.hidden {
    display: none !important;
}

.home-screenshot-help {
    position: fixed;
    inset: 0;
    z-index: 1250;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0;
}

.home-screenshot-help__mask {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.48);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    animation: home-screenshot-help-fade-in 0.22s ease;
}

.home-screenshot-help__panel {
    position: relative;
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    background: var(--surface);
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -12px 40px rgba(15, 23, 42, 0.14);
    overflow: hidden;
    animation: home-screenshot-help-slide-up 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.home-screenshot-help__head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 20px 20px 0;
}

.home-screenshot-help__badge {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: linear-gradient(145deg, var(--brand-light) 0%, color-mix(in srgb, var(--brand-light) 60%, #fff) 100%);
    color: var(--brand);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand) 12%, transparent);
}

.home-screenshot-help__badge svg {
    display: block;
}

.home-screenshot-help__titles {
    flex: 1;
    min-width: 0;
    padding-top: 2px;
}

.home-screenshot-help__titles strong {
    display: block;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.35;
    color: var(--text);
}

.home-screenshot-help__subtitle {
    display: block;
    margin-top: 4px;
    font-size: 13px;
    line-height: 1.45;
    color: var(--text-secondary);
}

.home-screenshot-help__close {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin: -4px -4px 0 0;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.home-screenshot-help__close:hover {
    background: var(--background);
    color: var(--text);
}

.home-screenshot-help__body {
    padding: 16px 20px 0;
}

.home-screenshot-help__lead {
    margin: 0 0 14px;
    font-size: 14px;
    line-height: 1.65;
    color: var(--text-secondary);
}

.home-screenshot-help__lead strong {
    color: var(--text);
    font-weight: 600;
}

.home-screenshot-help__list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 10px;
}

.home-screenshot-help__list li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 11px 12px;
    border-radius: 12px;
    background: var(--background);
    border: 1px solid var(--border);
}

.home-screenshot-help__check {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    margin-top: 1px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--brand) 12%, #fff);
    color: var(--brand);
}

.home-screenshot-help__list li span:last-child {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    font-size: 14px;
    line-height: 1.4;
    color: var(--text);
}

.home-screenshot-help__list li strong {
    font-weight: 600;
}

.home-screenshot-help__list li em {
    font-style: normal;
    font-size: 12px;
    color: var(--text-secondary);
}

.home-screenshot-help__tips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.home-screenshot-help__tip {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 999px;
    background: var(--brand-light);
    color: var(--brand-dark);
    font-size: 12px;
    line-height: 1.3;
    font-weight: 500;
}

.home-screenshot-help__foot {
    padding: 18px 20px calc(18px + env(safe-area-inset-bottom));
}

.home-screenshot-help__btn {
    display: block;
    width: 100%;
    min-height: 46px;
    padding: 0 20px;
    border: none;
    border-radius: 23px;
    background: linear-gradient(180deg, var(--brand) 0%, var(--brand-dark) 100%);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    line-height: 46px;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 4px 14px color-mix(in srgb, var(--brand) 32%, transparent);
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.home-screenshot-help__btn:hover {
    box-shadow: 0 6px 18px color-mix(in srgb, var(--brand) 38%, transparent);
}

.home-screenshot-help__btn:active {
    transform: scale(0.98);
}

@keyframes home-screenshot-help-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes home-screenshot-help-slide-up {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (min-width: 768px) {
    .home-screenshot-help {
        align-items: center;
        padding: 24px;
    }

    .home-screenshot-help__panel {
        border-radius: 20px;
        max-width: 440px;
        animation-name: home-screenshot-help-pop-in;
    }

    .home-screenshot-help__foot {
        padding-bottom: 20px;
    }
}

@keyframes home-screenshot-help-pop-in {
    from {
        opacity: 0;
        transform: scale(0.94) translateY(8px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.portal-layout .home-screenshot-strip__btn {
    flex-shrink: 0;
    min-height: 30px;
    padding: 0 14px;
    border: none;
    border-radius: 15px;
    background: linear-gradient(180deg, var(--brand) 0%, var(--brand-dark) 100%);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    line-height: 30px;
    cursor: pointer;
    box-shadow: 0 1px 4px color-mix(in srgb, var(--brand) 38%, transparent);
}

.portal-layout .home-screenshot-strip__btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

@media (min-width: 768px) {
    .portal-layout .home-screenshot-strip__inner {
        gap: 12px;
        min-height: 52px;
        padding: 10px 0;
    }

    .portal-layout .home-screenshot-strip__text {
        font-size: 14px;
    }

    .portal-layout .home-screenshot-strip__btn {
        min-height: 36px;
        padding: 0 18px;
        border-radius: 18px;
        font-size: 14px;
        line-height: 36px;
    }
}

.home-screenshot-modal.hidden {
    display: none !important;
}

.home-screenshot-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.home-screenshot-modal__mask {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
}

.home-screenshot-modal__panel {
    position: relative;
    width: 100%;
    max-width: 520px;
    max-height: 85vh;
    overflow: auto;
    background: var(--surface);
    border-radius: 16px 16px 0 0;
    padding: 20px 20px calc(20px + env(safe-area-inset-bottom));
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.12);
}

@media (min-width: 768px) {
    .home-screenshot-modal {
        align-items: center;
        padding: 24px;
    }

    .home-screenshot-modal__panel {
        border-radius: 16px;
        max-height: 90vh;
    }
}

.home-screenshot-modal__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.home-screenshot-modal__head strong {
    font-size: 17px;
    color: var(--text);
}

.home-screenshot-modal__close {
    border: none;
    background: transparent;
    font-size: 24px;
    line-height: 1;
    color: var(--text-secondary);
    cursor: pointer;
}

.home-screenshot-upload {
    border: 2px dashed color-mix(in srgb, var(--brand) 35%, transparent);
    border-radius: 12px;
    padding: 28px 16px;
    text-align: center;
    background: var(--brand-light);
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.home-screenshot-upload.is-dragover {
    border-color: var(--brand);
    background: color-mix(in srgb, var(--brand-light) 70%, var(--brand) 30%);
}

.home-screenshot-upload__hint {
    margin: 0 0 8px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}

.home-screenshot-upload__sub {
    margin: 0;
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.home-screenshot-preview {
    margin-top: 12px;
    display: none;
}

.home-screenshot-preview.is-visible {
    display: block;
}

.home-screenshot-preview img {
    width: 100%;
    max-height: 200px;
    object-fit: contain;
    border-radius: 8px;
    background: var(--background);
}

.home-screenshot-status {
    margin-top: 14px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.5;
    display: none;
}

.home-screenshot-status.is-visible {
    display: block;
}

.home-screenshot-status.is-loading {
    background: var(--brand-light);
    color: var(--brand-dark);
}

.home-screenshot-status.is-error {
    background: #fff5f5;
    color: #c53030;
}

.home-screenshot-fallback {
    margin-top: 10px;
    font-size: 13px;
}

.home-screenshot-fallback a {
    color: var(--brand);
}

.home-screenshot-modal input[type="file"] {
    display: none;
}

/* 手机端：拍摄 / 相册 底部菜单 */
.home-screenshot-sheet.hidden {
    display: none !important;
}

.home-screenshot-sheet {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.home-screenshot-sheet__mask {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
}

.home-screenshot-sheet__panel {
    position: relative;
    width: 100%;
    max-width: 520px;
    padding: 0 10px calc(10px + env(safe-area-inset-bottom));
    box-sizing: border-box;
}

.home-screenshot-sheet__group {
    background: var(--surface);
    border-radius: 12px;
    overflow: hidden;
}

.home-screenshot-sheet__item {
    display: block;
    width: 100%;
    padding: 16px;
    border: none;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-size: 16px;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
}

.home-screenshot-sheet__item:last-child {
    border-bottom: none;
}

.home-screenshot-sheet__cancel {
    display: block;
    width: 100%;
    margin-top: 8px;
    padding: 16px;
    border: none;
    border-radius: 12px;
    background: var(--surface);
    color: var(--text);
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
}

.home-screenshot-file-input {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
}

@media (min-width: 768px) {
    .home-screenshot-sheet {
        display: none !important;
    }
}

.home-screenshot-modal--processing .home-screenshot-modal__head strong {
    font-size: 16px;
}

.home-screenshot-modal--processing .home-screenshot-upload,
.home-screenshot-modal--processing .home-screenshot-preview {
    display: none !important;
}

.home-screenshot-modal--processing .home-screenshot-status.is-visible {
    display: block;
    margin-top: 0;
}
