/* 品牌标识页面样式 */

[x-cloak] { display: none; }

.main-content {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.brand-page {
    position: relative;
    flex: 1;
    display: flex;
    min-height: 0;
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
}

/* 左侧手机预览 */
.brand-preview-side {
    width: 460px;
    padding: 0 40px;
    background: #FAFAFA;
}

.brand-phone-preview {
    position: relative;
    width: 100%;
    container-type: inline-size;
}

.brand-phone-bg {
    width: 100%;
    height: auto;
    display: block;
}

.brand-preview-bar {
    position: absolute;
    z-index: 1;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #111;
    transition: left 0.2s ease, right 0.2s ease, bottom 0.2s ease,
                height 0.2s ease, border-radius 0.2s ease, background 0.2s ease;
}

.brand-preview-bar--bottom {
    left: 4.65%;
    right: 4.65%;
    bottom: 4.58%;
    height: 14%;
    padding: 0 calc(100cqw * 24 / 380);
    background: #fff;
    border-top: 1px solid #eee;
    border-radius: 0;
}

.brand-preview-bar--bottom .brand-preview-logo{
    background: #f4f5f7;
}

.brand-preview-bar--floating {
    left: 9.1%;
    right: 9.1%;
    bottom: 10.4%;
    height: 12%;
    padding: 0 3%;
    padding-left: 6px;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 999px;
    background: rgba(230, 230, 230, 0.72);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    -webkit-backdrop-filter: blur(9px);
    backdrop-filter: blur(9px);
}

.brand-preview-bar--fixed {
    left: 4.65%;
    right: 4.65%;
    bottom: 4.58%;
    height: 14%;
    padding: 0 7.3%;
    background: rgba(224, 224, 224, 0.78);
    border-top: 1px solid rgba(255, 255, 255, 0.7);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-radius: 0;
}

/* 按 1926 × 1911 手机示意 PNG 的内屏轮廓裁切，仅用于本页预览。 */
.brand-preview-bar--bottom,
.brand-preview-bar--fixed {
    clip-path: polygon(0 0,100% 0,99.89% 12.72%,99.71% 20.20%,99.54% 27.67%,99.26% 35.15%,98.86% 42.63%,98.40% 50.10%,97.77% 57.58%,97.02% 65.05%,96.05% 72.53%,94.73% 80%,93.42% 85.61%,92.33% 89.35%,90.96% 93.09%,89.24% 96.08%,87.69% 97.94%,86.09% 99.07%,83.57% 99.81%,80% 100%,20% 100%,16.43% 99.81%,13.91% 99.07%,12.31% 97.94%,10.76% 96.08%,9.04% 93.09%,7.67% 89.35%,6.58% 85.61%,5.27% 80%,3.95% 72.53%,2.98% 65.05%,2.23% 57.58%,1.60% 50.10%,1.14% 42.63%,.74% 35.15%,.46% 27.67%,.29% 20.20%,.11% 12.72%);
}

/* 底部两种预览的内容按 380px 名义手机宽度缩放，避免窄预览被内屏裁切。 */
.brand-preview-bar--bottom .brand-preview-logo,
.brand-preview-bar--fixed .brand-preview-logo {
    width: calc(100cqw * 36 / 380);
    height: calc(100cqw * 36 / 380);
}

.brand-preview-bar--bottom .brand-preview-name,
.brand-preview-bar--fixed .brand-preview-name {
    font-size: calc(100cqw * 16 / 380);
}

.brand-preview-bar--bottom .brand-preview-identity,
.brand-preview-bar--fixed .brand-preview-identity {
    gap: calc(100cqw * 8 / 380);
}

.brand-preview-bar--bottom .brand-preview-actions,
.brand-preview-bar--fixed .brand-preview-actions {
    gap: calc(100cqw * 22 / 380);
}

.brand-preview-bar--bottom .brand-preview-action,
.brand-preview-bar--bottom .brand-preview-action img,
.brand-preview-bar--fixed .brand-preview-action,
.brand-preview-bar--fixed .brand-preview-action img {
    width: calc(100cqw * 20 / 380);
    height: calc(100cqw * 20 / 380);
}

.brand-preview-identity,
.brand-preview-actions {
    display: flex;
    align-items: center;
}

.brand-preview-identity {
    flex: 1;
    min-width: 0;
    gap: 8px;
}

.brand-preview-logo {
    width: 36px;
    height: 36px;
    box-sizing: border-box;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #fff;
}

.brand-preview-logo img {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    object-fit: cover;
}

.brand-preview-name {
    flex: 1;
    min-width: 0;
    color: #111;
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.brand-preview-actions {
    flex-shrink: 0;
    gap: 22px;
}

.brand-preview-action,
.brand-preview-action img {
    display: block;
    width: 20px;
    height: 20px;
}

.brand-preview-action img {
    object-fit: contain;
    filter: brightness(0.38);
}

.brand-preview-action:last-child img {
    filter: none;
}

/* 右侧设置面板 */
.brand-setting-side{
    flex: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.brand-settings-wrap{
    flex: 1;
    min-height: 0;
    padding: 0 24px;
    overflow-y: auto;
    overflow-x: hidden;
}

.brand-settings-wrap::-webkit-scrollbar {
    width: 6px;
}

.brand-settings-wrap::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.brand-settings-wrap::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.brand-settings-wrap::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.brand-settings{
    width: 760px;
}

.brand-top-tip {
    text-align: center;
    padding: 40px 24px;
    font-size: 16px;
    color: #666;
    margin-bottom: 20px;
    line-height: 1.6;
}

.brand-section {
    padding: 24px 0;
    margin-bottom: 16px;
}

.brand-section-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
}

/* 品牌信息表单 */
.brand-form-row {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
}

.brand-form-row:last-child {
    margin-bottom: 0;
}

.brand-form-label {
    width: 90px;
    flex-shrink: 0;
    font-size: 15px;
    color: #333;
    font-weight: 500;
}

.brand-logo-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-logo-preview-wrap,
.brand-upload-btn {
    width: 72px;
    height: 72px;
    box-sizing: border-box;
    border: 1px dashed #c7c7c7;
    border-radius: 11px;
}

.brand-logo-preview-wrap {
    position: relative;
    flex-shrink: 0;
    overflow: hidden;
    background: #fff;
}

.brand-logo-preview {
    display: block;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    object-fit: contain;
}

.brand-logo-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.34);
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.brand-logo-preview-wrap:hover .brand-logo-overlay {
    opacity: 1;
}

.brand-logo-overlay-icon {
    width: 24x;
    height: 24px;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.brand-logo-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 18px;
    height: 18px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #fff;
    cursor: pointer;
}

.brand-logo-remove svg {
    display: block;
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
}

.brand-upload-btn {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 0;
    background: #fff;
    font: inherit;
    font-size: 12px;
    color: #aaa;
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease;
}

.brand-upload-btn:hover {
    border-color: #266fff;
    color: #266fff;
}

.brand-upload-icon {
    width: 30px;
    height: 30px;
    object-fit: contain;
    filter: grayscale(1);
    opacity: 0.3;
    transition: filter 0.15s ease, opacity 0.15s ease;
}

.brand-upload-btn:hover .brand-upload-icon {
    filter: none;
    opacity: 1;
}

.brand-input {
    flex: 1;
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.brand-input:focus {
    outline: none;
    border-color: #266fff;
}

/* 展示样式 */
.brand-style-list {
    display: flex;
    gap: 20px;
}

.brand-style-card {
    flex: 1;
    display: flex;
    gap: 10px;
    padding: 14px;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    background: #fff;
}

.brand-style-card:hover {
    border-color: #c8d8ff;
}

.brand-style-card.active {
    border-color: #266fff;
    background: #f3f7ff;
}

.brand-style-radio {
    width: 18px;
    height: 18px;
    margin-top: 4px;
    border-radius: 50%;
    border: 1px solid #a2a4a5;
    position: relative;
    flex-shrink: 0;
    transition: border-color .15s, background .15s;
}

.brand-style-card:hover .brand-style-radio {
    border-color: #266fff;
}

.brand-style-card.active .brand-style-radio {
    border-color: #266fff;
    background: #266fff;
}

.brand-radio-dot {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #fff;
    display: none;
}

.brand-style-card.active .brand-radio-dot {
    display: block;
}

.brand-style-info {
    flex: 1;
    min-width: 0;
}

.brand-style-name {
    display: flex;
    align-items: center;
    font-size: 16px;
    font-weight: 500;
    color: #333;
    margin-bottom: 4px;
}

.brand-style-tag {
    flex-shrink: 0;
    margin-left: 6px;
    padding: 1px 8px;
    font-size: 11px;
    font-weight: 400;
    line-height: 16px;
    color: #E08010;
    background: #FEEAD2;
    border: none;
    border-radius: 4px;
}

.brand-style-desc {
    font-size: 12px;
    color: #999;
    line-height: 1.4;
}

/* 展示功能卡片 */
.brand-feature-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.brand-feature-card {
    display: flex;
    align-items: flex-start;
    padding: 16px;
    border: 1px solid #f0f0f0;
    border-radius: 10px;
    background: #fff;
    transition: border-color 0.2s;
}

.brand-feature-card:hover {
    border-color: #e0e8ff;
}

.brand-feature-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-right: 14px;
    background: #f5f7fa;
    color: #666;
}

.brand-feature-icon-img {
    display: block;
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.brand-feature-text {
    flex: 1;
    min-width: 0;
    padding-right: 12px;
}

.brand-feature-name {
    font-size: 16px;
    font-weight: 500;
    color: #333;
    margin-bottom: 4px;
}

.brand-feature-desc {
    font-size: 12px;
    color: #999;
    line-height: 1.5;
}

/* 跳转链接设置 */
.brand-feature-card--link {
    display: block;
    padding: 0;
    overflow: hidden;
}

.brand-link-main {
    min-height: 80px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    padding: 18px 20px;
}

.brand-link-main .brand-feature-icon {
    margin-right: 20px;
}

.brand-link-main .brand-switch {
    margin-top: 0;
}

.brand-link-row {
    min-height: 68px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    padding: 12px 20px;
    border-top: 1px solid #f0f0f0;
    background: #f7f8fa;
    font-size: 14px;
}

.brand-link-label {
    flex-shrink: 0;
    margin-right: 14px;
    color: #666;
}

.brand-link-view {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-link-value {
    min-width: 90px;
    max-width: 360px;
    display: inline-flex;
    min-height: 20px;
    align-items: center;
}

.brand-link-status {
    color: #111;
    font-weight: 500;
}

.brand-link-url {
    color: #333;
    max-width: 360px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.brand-link-set-btn {
    padding: 4px 0;
    border: 0;
    background: transparent;
    color: #266fff;
    font: inherit;
    cursor: pointer;
}

.brand-link-set-btn:hover {
    color: #1a5fd9;
}

/* 开关 */
.brand-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
    margin-top: 4px;
}

.brand-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.brand-switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 24px;
}

.brand-switch-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.brand-switch input:checked + .brand-switch-slider {
    background-color: #266fff;
}

.brand-switch input:checked + .brand-switch-slider:before {
    transform: translateX(20px);
}

/* 保存按钮 */
.brand-save-btn {
    display: block;
    width: 120px;
    height: 40px;
    background: #266fff;
    color: #fff;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.brand-save-btn:hover {
    background: #1a5fd9;
}

.brand-save-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.brand-footer{
    padding: 12px 24px;
    border-top: 1px solid #d3d3d3;
}

/* 设置链接弹窗 */
.brand-link-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.45);
}

.brand-link-modal {
    width: 860px;
    height: 654px;
    max-width: calc(100vw - 40px);
    max-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.16);
}

.brand-link-modal-header {
    height: 64px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 22px;
    border-bottom: 1px solid #ddd;
}

.brand-link-modal-header h3 {
    margin: 0;
    color: #111;
    font-size: 18px;
    font-weight: 600;
}

.brand-link-modal-close {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: #999;
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease;
}

.brand-link-modal-close:hover {
    color: #333;
    background: #f5f5f5;
}

.brand-link-modal-close svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
}

.brand-link-modal-body {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 0 22px;
}

.brand-link-modal-toolbar {
    height: 64px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand-link-type-group {
    display: flex;
    align-items: center;
    gap: 54px;
}

.brand-link-type-option {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: #222;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.brand-link-type-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.brand-link-type-radio {
    position: relative;
    width: 17px;
    height: 17px;
    flex-shrink: 0;
    border: 1px solid #bbb;
    border-radius: 50%;
    background: #fff;
}

.brand-link-type-option input:checked + .brand-link-type-radio {
    border-color: #3478f6;
    background: #3478f6;
}

.brand-link-type-option input:checked + .brand-link-type-radio::after {
    content: "";
    position: absolute;
    inset: 5px;
    border-radius: 50%;
    background: #fff;
}

.brand-link-search {
    position: relative;
    width: 310px;
    height: 36px;
}

.brand-link-search input {
    width: 100%;
    height: 100%;
    padding: 0 42px 0 13px;
    border: 1px solid #ccc;
    border-radius: 18px;
    background: #fff;
    color: #333;
    font-size: 14px;
}

.brand-link-search input:focus,
.brand-website-link-input:focus {
    border-color: #266fff;
}

.brand-link-search input::placeholder,
.brand-website-link-input::placeholder {
    color: #bbb;
}

.brand-link-search button {
    position: absolute;
    top: 0;
    right: 3px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    background: transparent;
    color: #aaa;
    cursor: pointer;
}

.brand-link-search button:hover {
    color: #266fff;
}

.brand-link-search svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
}

.brand-active-link-panel,
.brand-website-link-panel {
    flex: 1;
    min-height: 0;
}

.brand-active-link-panel {
    display: flex;
    flex-direction: column;
}

.brand-active-link-table-wrap {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

.brand-active-link-table-head,
.brand-active-link-row {
    display: grid;
    grid-template-columns: 74px minmax(0, 1fr) 200px;
    align-items: center;
}

.brand-active-link-table-head {
    height: 54px;
    background: #fafafa;
    color: #222;
    font-size: 14px;
    font-weight: 500;
}

.brand-active-link-row {
    width: 100%;
    height: 54px;
    padding: 0;
    border: 0;
    border-bottom: 1px solid #eee;
    background: #fff;
    color: #222;
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s ease;
}

.brand-active-link-row:hover,
.brand-active-link-row.selected {
    background: #f8fbff;
}

.brand-active-link-check {
    position: relative;
    width: 20px;
    height: 20px;
    justify-self: center;
    border: 1px solid #c5c5c5;
    border-radius: 50%;
    background: #fff;
}

.brand-active-link-check.checked {
    border-color: #3478f6;
    background: #3478f6;
}

.brand-active-link-check.checked::after {
    content: "";
    position: absolute;
    left: 6px;
    top: 3px;
    width: 5px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.brand-active-link-name,
.brand-active-link-time {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.brand-active-link-time {
    padding-right: 14px;
}

.brand-active-link-loading,
.brand-active-link-empty {
    padding: 46px 20px;
    color: #999;
    font-size: 14px;
    text-align: center;
}

.brand-link-pagination {
    height: 70px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.brand-link-pagination button {
    min-width: 34px;
    height: 34px;
    padding: 0 9px;
    border: 1px solid #eee;
    border-radius: 4px;
    background: #fff;
    color: #999;
    font-size: 14px;
    cursor: pointer;
}

.brand-link-pagination button.active {
    border-color: #266fff;
    background: #266fff;
    color: #fff;
}

.brand-link-pagination button:disabled {
    color: #ddd;
    cursor: not-allowed;
}

.brand-website-link-panel {
    padding-top: 4px;
}

.brand-website-link-input {
    width: 100%;
    height: 42px;
    padding: 0 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    background: #fff;
    color: #333;
    font-size: 14px;
}

.brand-link-modal-footer {
    height: 62px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 18px;
    padding: 0 24px;
    border-top: 1px solid #ddd;
}

.brand-link-modal-btn {
    width: 114px;
    height: 32px;
    padding: 0;
    border-radius: 17px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.brand-link-modal-btn--cancel {
    border: 1px solid #266fff;
    background: #fff;
    color: #266fff;
}

.brand-link-modal-btn--cancel:hover {
    background: #f5f9ff;
}

.brand-link-modal-btn--confirm {
    border: 0;
    background: linear-gradient(90deg, #43b9e9 0%, #266fff 100%);
    color: #fff;
}

.brand-link-modal-btn--confirm:hover {
    filter: brightness(0.97);
}

.brand-link-modal-btn--confirm:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

@media (max-width: 720px) {
    .brand-link-modal {
        height: calc(100vh - 24px);
        max-width: calc(100vw - 24px);
        max-height: calc(100vh - 24px);
    }

    .brand-link-modal-toolbar {
        height: auto;
        min-height: 104px;
        align-items: flex-start;
        flex-direction: column;
        justify-content: center;
        gap: 12px;
    }

    .brand-link-search {
        width: 100%;
    }

    .brand-active-link-table-head,
    .brand-active-link-row {
        grid-template-columns: 52px minmax(0, 1fr) 150px;
    }
}
