.db-main-hero {
    position: relative;
    margin-bottom: 28px;
    padding: 36px 36px 32px;
    border-radius: 20px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.82) 0%, rgba(255, 255, 255, 0.62) 100%);
    backdrop-filter: blur(18px) saturate(1.1);
    -webkit-backdrop-filter: blur(18px) saturate(1.1);
    border: 1px solid rgba(255, 255, 255, 0.7);
    box-shadow: 0 10px 30px rgba(31, 41, 51, 0.06);
    overflow: hidden;
    animation: dbMainIn 0.55s ease-out;
}

.db-main-hero::before {
    content: '';
    position: absolute;
    inset: 0 auto auto 0;
    width: 220px;
    height: 220px;
    background: radial-gradient(circle, rgba(159, 224, 216, 0.35) 0%, transparent 70%);
    pointer-events: none;
}

.db-main-hero::after {
    content: '';
    position: absolute;
    inset: auto 0 0 auto;
    width: 260px;
    height: 180px;
    background: radial-gradient(circle, rgba(245, 215, 110, 0.28) 0%, transparent 70%);
    pointer-events: none;
}

@keyframes dbMainIn {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.db-main-brand {
    position: relative;
    z-index: 1;
    margin: 0 0 10px;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #3d5a73;
}

.db-main-title {
    position: relative;
    z-index: 1;
    margin: 0 0 14px;
    font-size: 34px;
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: -0.04em;
    color: #1f2933;
}

.db-main-lead {
    position: relative;
    z-index: 1;
    margin: 0 0 20px;
    max-width: 760px;
    font-size: 16px;
    line-height: 1.7;
    color: #4b5563;
}

.db-main-body {
    position: relative;
    z-index: 1;
    max-width: 820px;
    padding-top: 18px;
    border-top: 1px solid rgba(31, 41, 51, 0.08);
}

.db-main-body > p {
    margin: 0 0 16px;
    font-size: 14px;
    line-height: 1.8;
    color: #5b6470;
}

.db-main-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 10px;
}

.db-main-list li {
    margin: 0;
    padding: 0 0 0 14px;
    position: relative;
    font-size: 14px;
    line-height: 1.6;
    color: #374151;
}

.db-main-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.55em;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #3d5a73;
}

.db-main-list strong {
    color: #1f2933;
    font-weight: 700;
}

@media (max-width: 768px) {
    .db-main-hero {
        padding: 28px 20px 24px;
        border-radius: 16px;
    }

    .db-main-title {
        font-size: 26px;
    }

    .db-main-lead {
        font-size: 15px;
    }

    .db-main-body > p,
    .db-main-list li {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .db-main-hero {
        padding: 24px 16px 20px;
    }

    .db-main-title {
        font-size: 23px;
    }

    .db-main-brand {
        font-size: 14px;
    }
}

.search-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    overflow: visible;
}

.search-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    background: linear-gradient(135deg, rgba(61,90,115, 0.05) 0%, rgba(255, 255, 255, 0.05) 100%);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.search-header-left {
    flex: 1;
}

.search-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #1a1a1a;
}

.search-title i {
    color: var(--primary);
}

.search-header-right {
    display: flex;
    align-items: center;
}

.search-info-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #666;
    padding: 8px 16px;
    background: rgba(61,90,115, 0.08);
    border-radius: 20px;
    border: 1px solid rgba(61,90,115, 0.15);
}

.search-info-badge i {
    color: var(--primary);
    font-size: 14px;
}

.search-info-badge strong {
    color: var(--primary);
    font-weight: 600;
}

.filter-toggle {
    display: flex;
    justify-content: center;
    padding: 12px;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.02);
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    transition: background 0.3s ease;
}

.filter-toggle:hover {
    background: rgba(0, 0, 0, 0.04);
}

.filter-toggle i {
    color: #666;
    font-size: 18px;
    transition: transform 0.3s ease;
}

.filter-toggle.active i {
    transform: rotate(180deg);
}

.filter-content {
    padding: 24px;
    display: none;
    animation: slideDown 0.3s ease-out;
    overflow: visible;
}

.filter-content.active {
    display: block;
    overflow: visible;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }

    to {
        opacity: 1;
        max-height: 2000px;
    }
}

@media (max-width: 768px) {
    .search-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 16px 20px;
    }

    .search-header-right {
        width: 100%;
    }

    .search-info-badge {
        width: 100%;
        justify-content: center;
        font-size: 12px;
        padding: 10px 14px;
    }

    .filter-content {
        padding: 20px 16px;
    }
}

@media (max-width: 480px) {
    .search-container {
        border-radius: 12px;
    }

    .search-header {
        padding: 14px 16px;
    }

    .search-title {
        font-size: 16px;
    }

    .search-info-badge {
        font-size: 11px;
        padding: 8px 12px;
        flex-wrap: wrap;
    }

    .filter-content {
        padding: 16px 12px;
    }
}

.search-section {
    margin-bottom: 32px;
}

.search-section h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 24px;
}

.search-box {
    display: flex;
    gap: 12px;
    max-width: 600px;
}

.search-box .form-control {
    flex: 1;
}

.search-info {
    margin-top: 16px;
    font-size: 13px;
    color: var(--text-light);
}

.search-info strong {
    color: var(--primary);
}

.result-section {
    background: #ffffff !important;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin-top: 24px;
}

#resultSection {
    display: none !important;
}

#resultSection.visible {
    display: block !important;
}

#randomRegionSection {
    display: block !important;
    background: #ffffff !important;
    padding: 24px !important;
    border-radius: 12px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05) !important;
}

.result-section .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.result-section .section-header h3 {
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.result-section .section-header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

#resultCount {
    color: var(--text-light);
    font-size: 14px;
    font-weight: 600;
}

#sortOptions {
    display: flex;
    gap: 8px;
}

#sortSelect {
    width: auto;
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: 6px;
}

#resultList {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
}

#pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
}

.progress-section {
    width: 100%;
    margin-top: 40px;
}

.progress-box {
    width: 100%;
    text-align: center;
}

.progress-bar {
    height: 8px;
    background: var(--bg-gray);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 16px;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    width: 0%;
    transition: width 0.3s;
}

#progressText {
    color: var(--text-gray);
    font-size: 14px;
}

.loading-spinner-container {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    min-height: 300px;
}

.heartbeat-loader {
    width: 400px;
    height: 120px;
    margin-bottom: 20px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 10px 0;
}

.heartbeat-line {
    width: 100%;
    height: 8px;
    background: linear-gradient(90deg,
            rgba(61,90,115, 0.1) 0%,
            rgba(61,90,115, 0.3) 20%,
            rgba(61,90,115, 0.8) 50%,
            rgba(61,90,115, 0.3) 80%,
            rgba(61,90,115, 0.1) 100%);
    border-radius: 4px;
    animation: heartbeat 1.5s ease-in-out infinite;
    position: relative;
    overflow: hidden;
}

.heartbeat-line::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.6),
            transparent);
    animation: heartbeat-shine 1.5s ease-in-out infinite;
}

.heartbeat-line:nth-child(1) {
    animation-delay: 0s;
}

.heartbeat-line:nth-child(2) {
    animation-delay: 0.1s;
}

.heartbeat-line:nth-child(3) {
    animation-delay: 0.2s;
}

.heartbeat-line:nth-child(4) {
    animation-delay: 0.3s;
}

.heartbeat-line:nth-child(5) {
    animation-delay: 0.4s;
}

@keyframes heartbeat {

    0%,
    100% {
        transform: scaleX(0.3);
        opacity: 0.5;
    }

    50% {
        transform: scaleX(1);
        opacity: 1;
    }
}

@keyframes heartbeat-shine {
    0% {
        left: -100%;
    }

    100% {
        left: 100%;
    }
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.loading-text {
    color: #666;
    font-size: 14px;
    margin: 0;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.filter-help-text {
    animation: fadeInUp 0.4s ease-out, pulseGlow 3s ease-in-out infinite;
    background: linear-gradient(135deg, rgba(61,90,115, 0.08) 0%, rgba(255, 140, 66, 0.04) 50%, rgba(255, 255, 255, 0.95) 100%);
    backdrop-filter: blur(10px);
    padding: 20px 24px;
    border-radius: 16px;
    margin-bottom: 24px;
    border: 1px solid rgba(61,90,115, 0.15);
    box-shadow: 0 4px 20px rgba(61,90,115, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.8);
    position: relative;
    overflow: hidden
}

.filter-help-text::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #3d5a73, #6b8aa3, #a8c0d0, #6b8aa3, #3d5a73);
    background-size: 200% 100%;
    animation: shimmer 3s linear infinite
}

@keyframes shimmer {
    0% {
        background-position: 200% 0
    }

    100% {
        background-position: -200% 0
    }
}

@keyframes pulseGlow {

    0%,
    100% {
        box-shadow: 0 4px 20px rgba(61,90,115, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.8)
    }

    50% {
        box-shadow: 0 4px 30px rgba(61,90,115, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.8)
    }
}

.filter-help-text>div {
    display: flex;
    align-items: flex-start;
    gap: 16px
}

.filter-help-text i {
    color: #3d5a73;
    font-size: 24px;
    flex-shrink: 0;
    margin-top: 4px;
    filter: drop-shadow(0 2px 4px rgba(61,90,115, 0.3));
    animation: iconBounce 2s ease-in-out infinite
}

@keyframes iconBounce {

    0%,
    100% {
        transform: translateY(0)
    }

    50% {
        transform: translateY(-3px)
    }
}

.filter-help-text strong {
    display: block;
    margin-bottom: 12px;
    color: #1a1a1a;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.02em
}

.filter-help-text ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px 20px
}

.filter-help-text ul li {
    position: relative;
    padding-left: 24px;
    color: #555;
    font-size: 13px;
    line-height: 1.6;
    transition: all 0.2s ease
}

.filter-help-text ul li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 6px;
    width: 14px;
    height: 14px;
    background: linear-gradient(135deg, #3d5a73, #6b8aa3);
    border-radius: 50%;
    opacity: 0.8
}

.filter-help-text ul li::after {
    content: '✓';
    position: absolute;
    left: 3px;
    top: 3px;
    font-size: 9px;
    color: #fff;
    font-weight: 700
}

.filter-help-text ul li:hover {
    color: #3d5a73;
    transform: translateX(4px)
}

.filter-help-text ul li strong {
    color: #333;
    font-weight: 600
}

@media(max-width:768px) {
    .filter-help-text {
        padding: 16px 18px
    }

    .filter-help-text ul {
        grid-template-columns: 1fr;
        gap: 8px
    }

    .filter-help-text strong {
        font-size: 15px
    }

    .filter-help-text ul li {
        font-size: 12px
    }
}

.filter-hint {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-light);
    line-height: 1.5
}

.tooltip-trigger {
    position: relative;
    display: inline-block;
    z-index: 1
}

.tooltip-trigger:hover {
    z-index: 99999
}

.tooltip-trigger:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 8px;
    padding: 6px 10px;
    background: #333;
    color: #fff;
    font-size: 12px;
    line-height: 1.3;
    border-radius: 6px;
    z-index: 99999 !important;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
    text-align: center
}

.tooltip-trigger:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 2px;
    border: 6px solid transparent;
    border-top-color: #333;
    z-index: 99998 !important;
    pointer-events: none
}

.progress-section .loading-spinner {
    display: inline-block
}

.progress-section .spinner-ring {
    width: 48px;
    height: 48px;
    border: 4px solid #eee;
    border-top-color: #3d5a73;
    border-radius: 50%;
    animation: spin 1s linear infinite
}

@keyframes spin {
    to {
        transform: rotate(360deg)
    }
}

.result-card {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #e8eaed;
    border-radius: 12px;
    overflow: hidden;
    color: inherit;
    display: flex;
    flex-direction: column;
    min-width: 0;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.result-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border-color: #cfd5dc;
}

.result-card-main {
    display: block;
    flex: 1;
    min-width: 0;
    color: inherit;
    text-decoration: none;
}

.result-card-main:focus-visible,
.product-card-main:focus-visible {
    outline: 3px solid rgba(13, 110, 96, 0.36);
    outline-offset: -3px;
}

.result-card-main:hover .result-card-title,
.product-card-main:hover h6 {
    color: #0b6b5e;
}

.result-card-image {
    width: 100%;
    height: 180px;
    background: #f5f5f5;
    overflow: hidden;
}

.result-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.result-card-content {
    padding: 16px;
}

.result-card-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-top: 0;
}

.result-card-price {
    font-size: 18px;
    font-weight: 700;
    color: #3d5a73;
    margin: 0;
}

.result-card-price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.product-status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-height: 22px;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}

.product-status-reserved {
    border: 1px solid #f6c453;
    background: #fff7d6;
    color: #9a6500;
}

.result-card-actions,
.product-card-actions {
    display: flex;
    align-items: stretch;
    gap: 8px;
    padding: 0 16px 16px;
}

.result-card-actions > button,
.product-card-actions > button {
    flex: 1 1 0;
    min-width: 0;
}

.result-card-actions .direct-chat-btn,
.product-card-actions .direct-chat-btn,
.result-card-actions .product-ai-analysis-btn,
.product-card-actions .product-ai-analysis-btn {
    min-height: 34px;
    justify-content: center;
    border-radius: 8px;
}

.product-ai-analysis-btn {
    border: 1px solid #b8e2d9;
    background: #eaf7f3;
    color: #0b6b5e;
    border-radius: 8px;
    padding: 7px 10px;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    box-shadow: none;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.product-ai-analysis-btn:hover {
    transform: translateY(-1px);
    border-color: #0b6b5e;
    background: #0b6b5e;
    color: #fff;
}

.product-ai-analysis-btn:focus-visible {
    outline: 3px solid rgba(13, 110, 96, 0.32);
    outline-offset: 2px;
}

.product-ai-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 10080;
    background: rgba(15, 23, 42, 0.58);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.product-ai-modal-box {
    position: relative;
    width: min(1180px, 100%);
    max-height: min(92vh, 940px);
    overflow-y: auto;
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 30px 70px rgba(15, 23, 42, 0.34);
}

.product-ai-modal-close {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    z-index: 1;
}

.product-ai-confirm-box {
    padding: 8px 4px;
    line-height: 1.6;
}

.product-ai-confirm-title {
    font-weight: 900;
    color: #111827;
    font-size: 17px;
    margin-bottom: 4px;
}

.product-ai-confirm-meta {
    color: #7c3aed;
    font-weight: 800;
    margin-bottom: 12px;
}

.product-ai-confirm-note {
    color: #64748b;
    font-size: 13px;
}

.product-ai-confirm-quota {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin: 14px 0;
    padding: 14px 16px;
    border-radius: 16px;
    background: #f5f3ff;
    border: 1px solid #ddd6fe;
}

.product-ai-confirm-quota span {
    color: #4c1d95;
    font-size: 13px;
    font-weight: 900;
}

.product-ai-confirm-quota strong {
    color: #6d28d9;
    font-size: 22px;
    font-weight: 900;
    white-space: nowrap;
}

.product-ai-confirm-quota em {
    color: #7c3aed;
    font-style: normal;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.product-ai-loading {
    min-height: 360px;
    padding: 72px 30px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.product-ai-spinner {
    width: 58px;
    height: 58px;
    border-radius: 999px;
    border: 5px solid #ede9fe;
    border-top-color: #7c3aed;
    animation: productAiSpin 0.9s linear infinite;
    margin-bottom: 22px;
}

@keyframes productAiSpin {
    to {
        transform: rotate(360deg);
    }
}

.product-ai-loading h3 {
    margin: 0 0 8px;
    font-size: 22px;
    font-weight: 900;
    color: #111827;
}

.product-ai-loading p {
    margin: 0 0 8px;
    color: #4c1d95;
    font-weight: 800;
}

.product-ai-loading span {
    color: #64748b;
    font-size: 14px;
}

.product-ai-result {
    padding: 42px;
}

.product-ai-result-header {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 18px;
    margin-bottom: 22px;
}

.product-ai-result-badge {
    display: inline-flex;
    padding: 5px 12px;
    border-radius: 999px;
    background: #ede9fe;
    color: #6d28d9;
    font-size: 12px;
    font-weight: 900;
    margin-bottom: 10px;
}

.product-ai-result-header h3 {
    margin: 0 0 6px;
    color: #111827;
    font-size: 24px;
    font-weight: 900;
}

.product-ai-result-header p,
.product-ai-result-header span {
    margin: 0;
    color: #64748b;
    font-size: 14px;
    font-weight: 700;
}

.product-ai-quota-card {
    min-width: 128px;
    padding: 12px 14px;
    border-radius: 16px;
    background: #111827;
    color: #fff;
    text-align: right;
    align-self: flex-start;
}

.product-ai-quota-card span,
.product-ai-quota-card em {
    display: block;
    color: rgba(255, 255, 255, 0.72);
    font-size: 12px;
    font-style: normal;
    font-weight: 700;
}

.product-ai-quota-card strong {
    display: block;
    margin: 4px 0;
    font-size: 24px;
    line-height: 1;
    font-weight: 900;
}

.product-ai-visual-grid {
    display: grid;
    grid-template-columns: 1.2fr repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 22px;
}

.product-ai-score-card,
.product-ai-metric-card {
    border: 1px solid #e5e7eb;
    background: #fff;
    border-radius: 18px;
    padding: 18px;
    min-height: 142px;
}

.product-ai-score-card {
    background: linear-gradient(135deg, #4c1d95 0%, #7c3aed 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.product-ai-score-card span,
.product-ai-metric-card span {
    display: block;
    font-size: 12px;
    font-weight: 900;
    color: #64748b;
    margin-bottom: 10px;
}

.product-ai-score-card span {
    color: rgba(255, 255, 255, 0.82);
}

.product-ai-score-ring {
    width: 82px;
    height: 82px;
    border-radius: 999px;
    background: conic-gradient(#facc15 calc(var(--score) * 1%), rgba(255, 255, 255, 0.22) 0);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin-bottom: 10px;
}

.product-ai-score-ring::before {
    content: '';
    position: absolute;
    inset: 8px;
    border-radius: 999px;
    background: #5b21b6;
}

.product-ai-score-ring strong {
    position: relative;
    z-index: 1;
    font-size: 28px;
    font-weight: 900;
    color: #fff;
}

.product-ai-score-card em,
.product-ai-metric-card em {
    display: block;
    margin-top: 8px;
    font-style: normal;
    color: #94a3b8;
    font-size: 12px;
    font-weight: 700;
}

.product-ai-score-card em {
    color: rgba(255, 255, 255, 0.82);
}

.product-ai-metric-card strong {
    display: block;
    color: #111827;
    font-size: 20px;
    line-height: 1.25;
    font-weight: 900;
}

.product-ai-metric-card.good strong {
    color: #059669;
}

.product-ai-metric-card.bad strong {
    color: #dc2626;
}

.product-ai-section-title {
    margin: 22px 0 10px;
    color: #111827;
    font-size: 15px;
    font-weight: 900;
}

.product-ai-benchmark-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 4px;
}

.product-ai-benchmark-card,
.product-ai-empty-benchmark {
    border: 1px solid #e5e7eb;
    background: #f8fafc;
    border-radius: 16px;
    padding: 16px;
}

.product-ai-benchmark-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
    margin-bottom: 12px;
}

.product-ai-benchmark-head strong {
    color: #111827;
    font-size: 15px;
    font-weight: 900;
}

.product-ai-benchmark-head span {
    padding: 4px 8px;
    border-radius: 999px;
    background: #ede9fe;
    color: #6d28d9;
    font-size: 12px;
    font-weight: 900;
}

.product-ai-benchmark-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.product-ai-benchmark-grid div {
    padding: 10px 8px;
    background: #fff;
    border-radius: 12px;
}

.product-ai-benchmark-grid span {
    display: block;
    color: #64748b;
    font-size: 11px;
    font-weight: 800;
    margin-bottom: 4px;
}

.product-ai-benchmark-grid strong {
    color: #111827;
    font-size: 13px;
    font-weight: 900;
}

.product-ai-empty-benchmark {
    grid-column: 1 / -1;
    color: #64748b;
    text-align: center;
    font-weight: 700;
}

.product-ai-result-body {
    color: #1f2937;
    font-size: 15px;
    line-height: 1.75;
    padding: 18px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
}

.product-ai-moa-wrap .AI-report-card,
.product-ai-moa-wrap .AI-rec-container {
    margin-top: 0;
}

.AI-report-card {
    padding: 18px;
    background: #fafafa;
    border: 1px solid #eee;
    border-radius: 16px;
}

.AI-report-title {
    font-size: 15px;
    font-weight: 900;
    color: var(--primary, #3d5a73);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.AI-spec-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin-bottom: 14px;
}

.AI-spec-table th,
.AI-spec-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #eee;
    text-align: left;
}

.AI-spec-table th {
    color: #666;
    width: 100px;
}

.AI-price-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.AI-price-item {
    padding: 12px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid #eee;
}

.AI-price-item .label {
    display: block;
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
    margin-bottom: 5px;
}

.AI-price-item .val {
    color: #111827;
    font-size: 15px;
    font-weight: 900;
}

.AI-price-item.AI-price-current .val {
    color: var(--primary, #3d5a73);
}

.AI-chart-area {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #eee;
}

.AI-chart-title {
    font-size: 13px;
    font-weight: 900;
    color: #111827;
    margin-bottom: 10px;
}

.AI-chart-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    font-size: 12px;
}

.AI-chart-label {
    flex: 0 0 120px;
    color: #333;
}

.AI-chart-label em {
    font-style: normal;
    color: #999;
}

.AI-chart-bar-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.AI-chart-bar {
    height: 18px;
    min-width: 4px;
    background: linear-gradient(90deg, rgba(61,90,115,0.4), var(--primary, #3d5a73));
    border-radius: 4px;
}

.AI-chart-val {
    flex-shrink: 0;
    font-weight: 800;
    color: #333;
    font-size: 12px;
}

.AI-rec-container {
    margin-top: 16px;
    padding: 18px;
    border: 1px solid #eee;
    border-radius: 16px;
    background: #fff;
}

.AI-rec-title {
    font-size: 15px;
    font-weight: 900;
    color: var(--primary, #3d5a73);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.AI-rec-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
}

.AI-rec-card {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
}

.AI-rec-img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    background: #f8fafc;
}

.AI-rec-info {
    padding: 9px;
}

.AI-rec-name {
    font-size: 12px;
    color: #111827;
    margin-bottom: 5px;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.AI-rec-price {
    font-size: 13px;
    font-weight: 900;
    color: #000;
}

.AI-rec-count {
    display: inline-block;
    margin-top: 5px;
    font-size: 10px;
    color: #3d5a73;
    background: rgba(61,90,115, 0.08);
    padding: 2px 6px;
    border-radius: 4px;
}

.product-ai-text-heading {
    margin: 18px 0 8px;
    color: #111827;
    font-size: 16px;
    font-weight: 900;
}

.product-ai-text-bullet {
    position: relative;
    margin: 8px 0;
    padding-left: 16px;
}

.product-ai-text-bullet::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 2px;
    width: 5px;
    height: 5px;
    border-radius: 999px;
    background: #7c3aed;
}

.product-ai-result-actions {
    margin-top: 22px;
    display: flex;
    justify-content: flex-end;
}

.product-ai-error {
    min-height: 280px;
    padding: 54px 28px;
    text-align: center;
}

.product-ai-error i {
    color: #ef4444;
    font-size: 42px;
}

.product-ai-error h3 {
    margin: 14px 0 8px;
    color: #111827;
}

.product-ai-error p {
    color: #64748b;
    margin-bottom: 20px;
}

@media(max-width: 768px) {
    .product-ai-modal-overlay {
        padding: 12px;
    }

    .product-ai-result {
        padding: 24px 16px;
    }

    .product-ai-result-header,
    .product-ai-visual-grid,
    .product-ai-benchmark-list {
        grid-template-columns: 1fr;
    }

    .AI-price-summary,
    .AI-rec-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .product-ai-result-header {
        display: block;
    }

    .product-ai-quota-card {
        margin-top: 14px;
        text-align: left;
    }
}

.result-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
}

.result-card-region {
    font-size: 13px;
    color: #888;
    margin: 0;
}

.result-card-time {
    font-size: 12px;
    color: #999;
    display: flex;
    align-items: center;
    gap: 4px;
}

#resultList {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px
}

@media(max-width:1400px) {
    #resultList {
        grid-template-columns: repeat(4, 1fr)
    }
}

@media(max-width:1100px) {
    #resultList {
        grid-template-columns: repeat(3, 1fr)
    }
}

@media(max-width:768px) {
    #resultList {
        grid-template-columns: repeat(2, 1fr)
    }
}

#randomRegionSection {
    display: block;
    background: #ffffff;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin-top: 24px
}

#randomRegionSection .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border)
}

#randomRegionSection .section-header h3 {
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0
}

#randomRegionCount {
    color: var(--text-light);
    font-size: 14px
}

#randomRegionSection>p {
    margin: 0 0 20px 0;
    font-size: 12px;
    color: #999;
    line-height: 1.5
}

#randomRegionList {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px
}

.search-box.disabled {
    opacity: 0.6;
    pointer-events: none
}

.search-info.warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffc107
}

.search-info.warning a {
    color: #856404;
    font-weight: 600
}

.search-info-badge .error {
    color: #dc3545;
    margin-left: 12px
}

.filter-row-grid {
    display: grid;
    grid-template-columns: 2fr 1.5fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.filter-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-gray);
    margin-bottom: 8px;
}

.filter-group label .required {
    color: #e03131;
}

.filter-group label .tooltip-trigger i {
    color: var(--primary);
    font-size: 14px;
    cursor: help;
}

.filter-group input[type="text"],
.filter-group input[type="number"],
.filter-group select {
    width: 100%;
}

.filter-hint {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-light);
}

.price-range-inputs {
    display: flex;
    gap: 8px;
    align-items: center;
}

.price-range-inputs span {
    color: #999;
}

.keyword-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.keyword-input-group input {
    flex: 1;
    max-width: 300px;
}

.keyword-input-group button {
    font-size: 13px;
    padding: 8px 16px;
}

.filter-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.filter-actions button {
    font-size: 14px;
}

#searchBtn {
    font-size: 16px;
    padding: 12px 32px;
    font-weight: 600;
}

.progress-section {
    display: none !important;
}

.progress-section.visible {
    display: block !important;
}

#progressSection.visible {
    display: block !important;
}

.progress-box {
    background: rgba(255, 255, 255, 0.95);
    padding: 32px;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.progress-section .loading-spinner {
    margin-bottom: 16px;
}

.progress-bar {
    background: #eee;
    border-radius: 8px;
    height: 12px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    background: linear-gradient(90deg, #3d5a73, #6b8aa3);
    height: 100%;
    width: 0%;
    transition: width 0.3s;
}

#progressText {
    font-size: 16px;
    color: #333;
    margin: 0;
}

.progress-help-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    max-width: 640px;
    margin: 12px auto 0;
    padding: 11px 14px;
    border: 1px solid rgba(61,90,115, 0.2);
    border-radius: 10px;
    background: #f3f5f7;
    color: #9a3412;
    font-size: 14px;
    line-height: 1.5;
    word-break: keep-all;
}

.progress-help-note i {
    flex: 0 0 auto;
    color: #3d5a73;
    font-size: 16px;
}

@media (max-width: 640px) {
    .progress-help-note {
        align-items: flex-start;
        justify-content: flex-start;
        text-align: left;
        font-size: 13px;
    }
}

.pricing-section {
    margin-top: 40px;
    padding: 40px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    border: 2px solid var(--primary);
}

.pricing-section>div:first-child {
    text-align: center;
    margin-bottom: 32px;
}

.pricing-section h3 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 12px;
    color: #333;
}

.pricing-section p {
    color: #666;
    font-size: 14px;
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    max-width: 1000px;
    margin: 0 auto;
}

.pricing-card {
    background: #fff;
    border-radius: 16px;
    padding: 32px;
    border: 1px solid var(--border);
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s, box-shadow 0.3s;
}

.pricing-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.pricing-card.recommended {
    border: 2px solid var(--primary);
    transform: scale(1.05);
    box-shadow: 0 10px 30px rgba(61,90,115, 0.2);
    z-index: 2;
}

.pricing-card.recommended:hover {
    transform: scale(1.05) translateY(-8px);
}

.plan-badge {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    background: #10b981;
    color: #fff;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    z-index: 3;
}

.pricing-card .plan-name {
    font-size: 20px;
    font-weight: 700;
    color: #333;
    margin-bottom: 16px;
    text-align: center;
}

.pricing-card .plan-price {
    font-size: 36px;
    font-weight: 800;
    color: #333;
    margin-bottom: 24px;
    text-align: center;
}

.pricing-card .plan-price .period {
    font-size: 14px;
    color: #999;
    font-weight: 400;
}

.pricing-card .plan-features {
    list-style: none;
    padding: 0;
    margin: 0 0 32px;
    text-align: left;
}

.pricing-card .plan-features li {
    padding: 8px 0;
    color: #555;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pricing-card .plan-features li i {
    color: var(--primary);
    font-size: 16px;
}

.pricing-card .btn-plan {
    width: 100%;
    padding: 12px;
    font-size: 15px;
    font-weight: 600;
}

@media (max-width: 768px) {
    .pricing-grid {
        grid-template-columns: 1fr;
    }
    .pricing-card.recommended {
        transform: scale(1);
    }
    .pricing-card.recommended:hover {
        transform: translateY(-8px);
    }
}

.product-card {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #e8eaed;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-width: 0;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

.product-card:hover {
    transform: translateY(-4px);
    border-color: #cfd5dc;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.11);
}

.product-card-main {
    display: block;
    flex: 1;
    min-width: 0;
    color: inherit;
    text-decoration: none;
}

.product-card .image-container {
    width: 100%;
    padding-top: 100%;
    position: relative;
    background: var(--bg-gray);
    overflow: hidden;
}

.product-card .image-container img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-card .content {
    padding: 12px 12px 10px;
}

.product-card h6 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.4;
    height: 2.8em;
    color: #333;
}

.product-card .region-info {
    font-size: 12px;
    color: #999;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.product-card .price-time {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.product-card .price {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary);
    margin: 0;
}

.product-card .time {
    font-size: 11px;
    color: #999;
    display: flex;
    align-items: center;
    gap: 4px;
}

.product-card-actions {
    padding: 10px 12px 12px;
    border-top: 1px solid #f0f1f3;
    background: #fff;
}

@media (max-width: 560px) {
    .result-card-content {
        padding: 12px;
    }

    .result-card-actions {
        padding: 0 12px 12px;
        gap: 6px;
    }

    .result-card-actions .direct-chat-btn,
    .product-card-actions .direct-chat-btn,
    .result-card-actions .product-ai-analysis-btn,
    .product-card-actions .product-ai-analysis-btn {
        padding-inline: 8px;
        font-size: 11px;
    }
}

.direct-chat-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex-shrink: 0;
    padding: 5px 9px;
    border: 1px solid var(--primary);
    border-radius: 999px;
    background: #fff;
    color: var(--primary);
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
}

.direct-chat-btn:hover {
    background: var(--primary);
    color: #fff;
}

.direct-chat-modal-box {
    max-width: 640px;
    max-height: min(90vh, 860px);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.direct-chat-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.direct-chat-modal-header h3 {
    margin: 0 0 6px;
    font-size: 22px;
    font-weight: 700;
}

.direct-chat-modal-header p {
    margin: 0;
    color: #666;
    font-size: 13px;
}

.direct-chat-product-box {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 14px;
    margin-bottom: 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff7f1;
}

.direct-chat-product-box strong {
    color: #333;
    font-size: 15px;
}

.direct-chat-product-box span {
    color: #777;
    font-size: 13px;
}

.direct-chat-login-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    margin-bottom: 14px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #f8fafc;
}

.direct-chat-login-box div {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.direct-chat-login-box strong {
    color: #222;
    font-size: 14px;
}

.direct-chat-login-box span {
    color: #666;
    font-size: 12px;
}

.direct-chat-login-box button:disabled {
    border-color: #10b981;
    background: #10b981;
    color: #fff;
    cursor: default;
}

.direct-chat-qr-box {
    margin-bottom: 14px;
    padding: 14px;
    border: 1px dashed var(--primary);
    border-radius: 10px;
    text-align: center;
    background: #fff7f1;
}

.direct-chat-qr-box img {
    display: block;
    margin: 0 auto;
    width: 180px;
    height: 180px;
    object-fit: contain;
    background: #fff;
    border-radius: 8px;
}

.direct-chat-qr-box p {
    margin: 8px 0 0;
    color: #666;
    font-size: 12px;
}

.direct-chat-qr-hint {
    margin: 6px 0 0;
    color: var(--primary);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.5;
}

.direct-chat-qr-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
}

.direct-chat-qr-actions .btn-primary,
.direct-chat-qr-actions .btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
}

.direct-chat-qr-actions .btn-primary {
    background: var(--primary);
    color: #fff;
    border: 1px solid var(--primary);
}

.direct-chat-qr-actions .btn-outline {
    background: #fff;
    color: var(--primary);
    border: 1px solid var(--primary);
}

.direct-chat-message-input {
    width: 100%;
    resize: vertical;
    min-height: 130px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.5;
}

.direct-chat-message-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(61,90,115, 0.12);
}

.direct-chat-quick-messages {
    min-width: 0;
    margin-bottom: 12px;
}

.direct-chat-quick-messages-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.direct-chat-quick-messages-header strong {
    color: #24272b;
    font-size: 13px;
    font-weight: 700;
}

.direct-chat-template-manage-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 30px;
    padding: 4px 7px;
    border: 0;
    background: transparent;
    color: #5b6068;
    font-size: 12px;
    font-weight: 650;
    cursor: pointer;
}

.direct-chat-template-manage-btn:hover {
    color: var(--primary);
}

.direct-chat-template-manage-btn[hidden],
.direct-chat-template-form-footer button[hidden] {
    display: none !important;
}

.direct-chat-quick-template-list {
    display: flex;
    align-items: center;
    gap: 7px;
    width: 100%;
    min-height: 36px;
    padding: 1px 1px 5px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
    scrollbar-color: #cdd1d6 transparent;
}

.direct-chat-quick-template-list::-webkit-scrollbar {
    height: 5px;
}

.direct-chat-quick-template-list::-webkit-scrollbar-thumb {
    border-radius: 4px;
    background: #cdd1d6;
}

.direct-chat-quick-template {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex: 0 0 auto;
    height: 32px;
    padding: 0 11px;
    border: 1px solid #d7dbe0;
    border-radius: 999px;
    background: #fff;
    color: #34383e;
    font-size: 12px;
    font-weight: 650;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.direct-chat-quick-template:hover {
    border-color: #969da6;
    background: #f6f7f8;
}

.direct-chat-quick-template.is-custom {
    border-color: #ffb17b;
    background: #fff8f3;
}

.direct-chat-quick-template.is-selected {
    border-color: #2f3338;
    background: #2f3338;
    color: #fff;
}

.direct-chat-quick-template i {
    color: var(--primary);
    font-size: 11px;
}

.direct-chat-quick-template.is-selected i {
    color: #fff;
}

.direct-chat-template-loading {
    color: #8a9098;
    font-size: 12px;
}

.direct-chat-template-insert-choice {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 7px;
    padding: 8px 10px;
    border: 1px solid #ffd0af;
    border-radius: 8px;
    background: #fff9f4;
}

.direct-chat-template-insert-choice[hidden] {
    display: none !important;
}

.direct-chat-template-insert-choice > span {
    color: #595e65;
    font-size: 11px;
    line-height: 1.4;
}

.direct-chat-template-insert-choice > div {
    display: flex;
    align-items: center;
    gap: 5px;
    flex: 0 0 auto;
}

.direct-chat-template-insert-choice button {
    min-height: 28px;
    padding: 4px 8px;
    border: 1px solid #e18342;
    border-radius: 6px;
    background: #fff;
    color: #9b4c17;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
}

.direct-chat-template-insert-choice button.is-muted {
    width: 28px;
    padding: 0;
    border-color: #d8dce1;
    color: #697079;
}

.direct-chat-message-composer {
    position: relative;
}

.direct-chat-message-composer .direct-chat-message-input {
    display: block;
    padding-bottom: 31px;
}

.direct-chat-message-count {
    position: absolute;
    right: 10px;
    bottom: 8px;
    padding: 2px 4px;
    background: rgba(255, 255, 255, 0.92);
    color: #8a9098;
    font-size: 11px;
    line-height: 1;
    pointer-events: none;
}

.direct-chat-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 16px;
}

.direct-chat-modal-actions .btn-primary:disabled {
    border-color: #d1d5db;
    background: #d1d5db;
    color: #747b85;
    cursor: not-allowed;
}

.direct-chat-template-manager-overlay {
    z-index: 10020;
    padding: 20px;
}

.direct-chat-template-manager-box {
    width: min(860px, calc(100vw - 40px));
    max-width: 860px;
    max-height: min(820px, calc(100dvh - 40px));
    padding: 0;
    overflow: hidden;
}

.direct-chat-template-manager-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 68px;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
    background: #fff;
}

.direct-chat-template-manager-header > div {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.direct-chat-template-manager-header h3 {
    margin: 0;
    color: #202327;
    font-size: 19px;
    font-weight: 800;
}

.direct-chat-template-manager-header span {
    display: inline-flex;
    align-items: center;
    height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    background: #f0f2f4;
    color: #626972;
    font-size: 11px;
    font-weight: 700;
}

.direct-chat-template-manager-header .modal-close-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 6px;
    font-size: 18px;
}

.direct-chat-template-manager-header .modal-close-btn:hover {
    background: #f0f2f4;
}

.direct-chat-template-manager-body {
    display: grid;
    grid-template-columns: minmax(280px, 0.85fr) minmax(420px, 1.15fr);
    grid-template-rows: auto minmax(180px, 1fr);
    max-height: calc(min(820px, 100dvh - 40px) - 68px);
    overflow: hidden;
    background: #fff;
}

.direct-chat-template-editor,
.direct-chat-template-custom-section,
.direct-chat-template-system-section {
    min-width: 0;
    background: #fff;
}

.direct-chat-template-editor {
    grid-row: 1 / 3;
    padding: 18px;
    border-right: 1px solid #e5e7eb;
    overflow-y: auto;
}

.direct-chat-template-custom-section,
.direct-chat-template-system-section {
    padding: 16px 18px;
    overflow-y: auto;
}

.direct-chat-template-custom-section {
    border-bottom: 1px solid #e5e7eb;
}

.direct-chat-template-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 24px;
    margin-bottom: 10px;
}

.direct-chat-template-section-heading strong {
    color: #30343a;
    font-size: 13px;
    font-weight: 800;
}

#directChatTemplateForm {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#directChatTemplateForm > label,
.direct-chat-template-message-label label {
    color: #5b6169;
    font-size: 11px;
    font-weight: 700;
}

#directChatTemplateTitle,
#directChatTemplateMessage {
    width: 100%;
    border: 1px solid #d6dae0;
    border-radius: 7px;
    background: #fff;
    color: #292d32;
    font: inherit;
}

#directChatTemplateTitle {
    height: 40px;
    padding: 0 11px;
    font-size: 13px;
}

#directChatTemplateMessage {
    min-height: 116px;
    padding: 10px 11px;
    resize: vertical;
    font-size: 13px;
    line-height: 1.5;
}

#directChatTemplateTitle:focus,
#directChatTemplateMessage:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(61,90,115, 0.1);
}

.direct-chat-template-message-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 2px;
}

.direct-chat-template-message-label span {
    color: #8a9098;
    font-size: 10px;
}

.direct-chat-template-form-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 4px;
}

.direct-chat-template-form-footer > div {
    display: flex;
    align-items: center;
    gap: 6px;
}

.direct-chat-template-form-footer .btn-primary,
.direct-chat-template-form-footer .btn-outline {
    min-height: 36px;
    padding: 7px 12px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 700;
}

.direct-chat-template-form-footer button:disabled {
    border-color: #d5d9de;
    background: #e3e6e9;
    color: #8b9198;
    cursor: not-allowed;
}

.direct-chat-template-pin-option {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 32px;
    color: #555b63;
    font-size: 12px;
    font-weight: 650;
    cursor: pointer;
}

.direct-chat-template-pin-option input {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}

.direct-chat-template-manager-status {
    min-height: 20px;
    margin-top: 10px;
    color: #6d737b;
    font-size: 11px;
    line-height: 1.45;
}

.direct-chat-template-manager-status.is-error {
    color: #c32929;
}

.direct-chat-template-manager-status.is-success {
    color: #12805c;
}

.direct-chat-template-manager-status.is-loading {
    color: #8a5700;
}

.direct-chat-custom-template-list,
.direct-chat-system-template-list {
    display: flex;
    flex-direction: column;
}

.direct-chat-template-row,
.direct-chat-system-template-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
    padding: 10px 0;
    border-bottom: 1px solid #eceef1;
}

.direct-chat-template-row:last-child,
.direct-chat-system-template-row:last-child {
    border-bottom: 0;
}

.direct-chat-template-row-copy,
.direct-chat-system-template-row > div {
    min-width: 0;
}

.direct-chat-template-row-copy strong,
.direct-chat-system-template-row strong {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 3px;
    color: #2a2e33;
    font-size: 12px;
    font-weight: 750;
}

.direct-chat-template-row-copy strong i {
    color: var(--primary);
    font-size: 11px;
}

.direct-chat-template-row-copy p,
.direct-chat-system-template-row span {
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    color: #6b7179;
    font-size: 11px;
    line-height: 1.4;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.direct-chat-template-row-copy small {
    display: block;
    margin-top: 4px;
    color: #9a9fa6;
    font-size: 10px;
}

.direct-chat-template-row-actions {
    display: grid;
    grid-template-columns: repeat(5, 30px);
    gap: 3px;
    flex: 0 0 auto;
}

.direct-chat-template-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 1px solid #dce0e5;
    border-radius: 6px;
    background: #fff;
    color: #555c65;
    font-size: 12px;
    cursor: pointer;
}

.direct-chat-template-icon-btn:hover:not(:disabled) {
    border-color: #aeb4bc;
    background: #f2f4f6;
    color: #20242a;
}

.direct-chat-template-icon-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.direct-chat-template-row-actions .direct-chat-template-icon-btn[data-action="delete"]:hover {
    border-color: #efb1b1;
    background: #fff3f3;
    color: #bd2525;
}

.direct-chat-system-template-row > .direct-chat-template-icon-btn {
    flex: 0 0 auto;
}

.direct-chat-template-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 72px;
    color: #8b9199;
    font-size: 12px;
    text-align: center;
}

.direct-chat-history-toggle {
    position: fixed;
    right: 24px;
    bottom: 96px;
    z-index: 999;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border: none;
    border-radius: 999px;
    background: var(--primary);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    cursor: pointer;
}

body.direct-chat-scroll-lock {
    position: fixed;
    left: 0;
    right: 0;
    width: 100%;
    overflow: hidden;
    overscroll-behavior: none;
}

#directChatModal.modal-overlay {
    overscroll-behavior: none;
    touch-action: none;
}

#directChatModal.modal-overlay .modal-box {
    touch-action: pan-y;
}

.direct-chat-history-toggle em {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: #fff;
    color: var(--primary);
    font-style: normal;
    font-size: 11px;
}

.direct-chat-history-toggle.active {
    background: #111827;
}

.direct-chat-history-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1190;
    display: none;
    background: rgba(0, 0, 0, 0.4);
    overscroll-behavior: none;
    touch-action: none;
}

.direct-chat-history-backdrop.show {
    display: block;
}

.direct-chat-history-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1200;
    width: min(1040px, calc(100vw - 32px));
    height: min(720px, calc(100vh - 48px));
    display: none;
    flex-direction: column;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
    overflow: hidden;
}

.direct-chat-history-panel.show {
    display: flex;
}

.dcw-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    height: 60px;
    padding: 0 20px;
    border-bottom: 1px solid #eee;
    background: #fff;
    flex-shrink: 0;
}

.dcw-brand {
    display: flex;
    align-items: center;
    gap: 9px;
}

.dcw-brand-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-size: 16px;
}

.dcw-brand strong {
    color: #212124;
    font-size: 16px;
    font-weight: 800;
}

.dcw-topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dcw-refresh-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    color: #4d5159;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.dcw-refresh-btn:hover {
    background: #f8f9fa;
}

.dcw-close-btn {
    border: none;
    background: none;
    color: #868b94;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
}

.dcw-bottom-actions {
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid #eee;
    background: #fff;
}

.dcw-bottom-close-btn {
    width: 100%;
    max-width: 420px;
    height: 44px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
    color: #212124;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}

.dcw-bottom-close-btn:hover {
    background: #f8f9fa;
}

.direct-chat-history-body {
    flex: 1;
    display: grid;
    grid-template-columns: 320px 1fr;
    min-height: 0;
}

.dcw-sidebar {
    display: flex;
    flex-direction: column;
    min-height: 0;
    border-right: 1px solid #eee;
    background: #fff;
}

.dcw-sidebar-head {
    padding: 16px 18px 12px;
    border-bottom: 1px solid #f4f4f4;
    flex-shrink: 0;
}

.dcw-sidebar-head strong {
    color: #212124;
    font-size: 15px;
    font-weight: 800;
}

.direct-chat-conversation-list {
    flex: 1;
    overflow-y: auto;
    background: #fff;
}

.direct-chat-conversation-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 16px;
    border: none;
    border-bottom: 1px solid #f7f7f7;
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.direct-chat-conversation-item:hover {
    background: #f8f9fa;
}

.direct-chat-conversation-item.active {
    background: #f2f3f6;
}

.dcw-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #f2f3f6;
    color: #adb1ba;
    font-size: 17px;
    font-weight: 700;
    flex-shrink: 0;
    overflow: hidden;
}

.dcw-avatar.sm {
    width: 32px;
    height: 32px;
    font-size: 13px;
}

.dcw-avatar.has-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dcw-item-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.dcw-item-top {
    display: flex;
    align-items: baseline;
    gap: 6px;
    min-width: 0;
}

.dcw-item-top strong {
    color: #212124;
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dcw-item-top small {
    color: #adb1ba;
    font-size: 12px;
    flex-shrink: 0;
}

.dcw-item-msg {
    color: #4d5159;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dcw-item-thumb {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    border: 1px solid #f0f0f0;
}

.dcw-item-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.direct-chat-conversation-detail {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    background: #fff;
}

.dcw-chat-head {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 12px 20px;
    border-bottom: 1px solid #eee;
    background: #fff;
    flex-shrink: 0;
}

.dcw-chat-head .dcw-avatar {
    width: 38px;
    height: 38px;
    font-size: 15px;
}

.dcw-chat-head-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.dcw-chat-head-info strong {
    color: #212124;
    font-size: 15px;
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dcw-chat-head-info span {
    color: #868b94;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dcw-chat-head-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    color: #4d5159;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    flex-shrink: 0;
}

.dcw-chat-head-link:hover {
    background: #f8f9fa;
}

.dcw-article-bar {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 20px;
    border-bottom: 1px solid #eee;
    background: #fff;
    text-decoration: none;
    flex-shrink: 0;
}

.dcw-article-bar:hover {
    background: #f8f9fa;
}

.dcw-article-thumb {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid #f0f0f0;
    flex-shrink: 0;
}

.dcw-article-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.dcw-article-info strong {
    color: #212124;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dcw-article-info em {
    color: #212124;
    font-size: 13px;
    font-weight: 800;
    font-style: normal;
}

.dcw-article-open {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    color: #4d5159;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.direct-chat-message-thread {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
    background: #fff;
}

.dcw-date-divider {
    display: flex;
    justify-content: center;
    margin: 4px 0 18px;
}

.dcw-date-divider span {
    padding: 5px 12px;
    border-radius: 999px;
    background: #f2f3f6;
    color: #868b94;
    font-size: 12px;
}

.dcw-msg-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    margin-bottom: 12px;
}

.dcw-msg-row.me {
    justify-content: flex-end;
}

.dcw-msg-row .dcw-avatar {
    align-self: flex-start;
}

.dcw-bubble {
    max-width: 62%;
    padding: 10px 14px;
    border-radius: 20px;
}

.dcw-bubble.them {
    background: #f2f3f6;
    color: #212124;
    border-top-left-radius: 4px;
}

.dcw-bubble.me {
    background: var(--primary);
    color: #fff;
    border-top-right-radius: 4px;
}

.dcw-bubble p {
    margin: 0;
    font-size: 14px;
    line-height: 1.55;
    word-break: break-word;
    white-space: pre-wrap;
}

.dcw-msg-time {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 1px;
    color: #adb1ba;
    font-size: 11px;
    flex-shrink: 0;
    line-height: 1.4;
}

.dcw-msg-row.them .dcw-msg-time {
    align-items: flex-start;
}

.dcw-sent {
    font-style: normal;
    color: #adb1ba;
    font-size: 11px;
}

.dcw-system-note {
    margin: 8px auto 0;
    max-width: 340px;
    padding: 14px 16px;
    border: 1px solid #eee;
    border-radius: 12px;
    background: #fafafa;
    color: #4d5159;
    font-size: 13px;
    line-height: 1.65;
    text-align: center;
}

.dcw-composer {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 16px 16px;
    padding: 10px 12px;
    border: 1px solid #d1d3d8;
    border-radius: 10px;
    background: #fff;
    flex-shrink: 0;
}

.dcw-composer:focus-within {
    border-color: #212124;
}

.dcw-composer input {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    font-size: 14px;
    color: #212124;
}

.dcw-composer input:focus {
    outline: none;
}

.dcw-composer input::placeholder {
    color: #adb1ba;
}

.dcw-composer.is-disabled {
    background: #f8f9fa;
}

.dcw-send-btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    background: var(--primary);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.dcw-send-btn:hover {
    filter: brightness(0.95);
}

.dcw-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    color: #868b94;
    text-align: center;
    padding: 24px;
}

.dcw-empty-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: #f2f3f6;
    color: #d1d3d8;
    font-size: 32px;
}

.dcw-empty p {
    margin: 0;
    font-size: 14px;
}

.dcw-empty small {
    color: #adb1ba;
    font-size: 12px;
}

@media (max-width: 768px) {
    .direct-chat-history-panel {
        top: 0;
        left: 0;
        transform: none;
        width: 100vw;
        height: 100vh;
        height: 100dvh;
        border-radius: 0;
    }

    .direct-chat-history-body {
        grid-template-columns: 1fr;
        grid-template-rows: minmax(0, 38%) minmax(0, 1fr);
    }

    .dcw-sidebar {
        border-right: none;
        border-bottom: 1px solid #eee;
    }

    .dcw-bubble {
        max-width: 76%;
    }
}

.direct-chat-link-section {
    margin: 44px 0 20px;
}

.direct-chat-link-card {
    padding: 24px;
    border: 1px solid rgba(61,90,115, 0.24);
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(255, 247, 237, 0.96) 0%, rgba(255, 255, 255, 0.96) 48%, rgba(255, 237, 213, 0.96) 100%);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

.direct-chat-link-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.direct-chat-link-header span {
    display: inline-flex;
    padding: 5px 10px;
    margin-bottom: 8px;
    border-radius: 999px;
    background: var(--primary);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
}

.direct-chat-link-header h3 {
    margin: 0;
    color: #9a3412;
    font-size: 22px;
    font-weight: 900;
}

.direct-chat-link-header p {
    margin: 8px 0 0;
    color: #7c2d12;
    font-size: 14px;
}

.direct-chat-link-header i {
    color: var(--primary);
    font-size: 34px;
}

.direct-chat-link-form {
    display: flex;
    gap: 10px;
}

.direct-chat-link-form input {
    flex: 1;
    min-width: 0;
    padding: 13px 15px;
    border: 1px solid rgba(61,90,115, 0.25);
    border-radius: 12px;
    font-size: 14px;
}

.direct-chat-link-form input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(61,90,115, 0.12);
}

.direct-chat-link-form button,
.direct-chat-link-form .direct-chat-link-login {
    flex-shrink: 0;
    padding: 0 18px;
    border: none;
    border-radius: 12px;
    background: var(--primary);
    color: #fff;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.direct-chat-link-preview {
    margin-top: 16px;
    padding: 16px;
    border: 1px solid rgba(61,90,115, 0.18);
    border-radius: 14px;
    background: #fff;
}

.direct-chat-link-product {
    display: flex;
    gap: 14px;
    align-items: center;
    margin-bottom: 14px;
}

.direct-chat-link-thumb {
    width: 82px;
    height: 82px;
    flex-shrink: 0;
    border-radius: 12px;
    background: #f3f4f6;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 12px;
}

.direct-chat-link-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.direct-chat-link-info h4 {
    margin: 0 0 6px;
    color: #222;
    font-size: 16px;
    font-weight: 800;
}

.direct-chat-link-info p {
    margin: 0 0 6px;
    color: #666;
    font-size: 13px;
}

.direct-chat-link-info a {
    color: var(--primary);
    font-size: 13px;
    font-weight: 700;
}

.direct-chat-link-preview textarea {
    width: 100%;
    min-height: 92px;
    resize: vertical;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
}

.direct-chat-link-login-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #f8fafc;
}

.direct-chat-link-login-box span {
    color: #666;
    font-size: 13px;
}

.direct-chat-link-login-box button:disabled {
    border-color: #10b981;
    background: #10b981;
    color: #fff;
    cursor: default;
}

.direct-chat-link-qr-box {
    margin-top: 12px;
}

.direct-chat-link-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 12px;
}

.direct-chat-link-loading,
.direct-chat-link-error {
    padding: 16px;
    color: #666;
    text-align: center;
    font-size: 14px;
}

.direct-chat-link-error {
    color: #dc2626;
}

.empty-message {
    text-align: center;
    padding: 40px;
    color: var(--text-light);
}

#subKeywordsList,
#excludeKeywordsList {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
    min-height: 32px;
}

@media (max-width: 480px) {
    #resultList {
        grid-template-columns: 1fr;
    }
}

#progressSection {
    backdrop-filter: blur(10px);
}

#resultSection .btn-primary {
    background: #3d5a73;
    color: #fff;
    border: none;
}

#resultSection .btn-outline {
    background: #fff;
    color: #333;
    border: 1px solid #ddd;
}

#resultSection .btn-outline:hover {
    background: #f5f5f5;
}

@media (max-width: 768px) {
    .filter-help-text {
        padding: 12px;
    }

    .filter-help-text ul {
        font-size: 12px;
        padding-left: 18px;
    }

    .tooltip-trigger:hover::after {
        max-width: 250px;
        font-size: 11px;
        padding: 6px 10px;
    }
}

.statistics-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.stat-card {
    text-align: center;
    padding: 20px 16px;
    background: rgba(61,90,115, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(61,90,115, 0.1);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: rgba(61,90,115, 0.3);
    background: rgba(61,90,115, 0.08);
}

.stat-card i {
    font-size: 28px;
    color: var(--primary);
    margin-bottom: 12px;
    display: block;
}

.stat-label {
    font-size: 13px;
    color: var(--text-gray);
    margin-bottom: 8px;
    font-weight: 500;
}

.stat-value {
    font-size: 26px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 4px;
    line-height: 1.2;
}

.stat-unit {
    font-size: 12px;
    color: var(--text-gray);
}

.detail-filter-panel {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    margin-bottom: 24px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.filter-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: rgba(61,90,115, 0.05);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    transition: background 0.2s ease;
}

.filter-panel-header:hover {
    background: rgba(61,90,115, 0.08);
}

.filter-panel-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
}

.filter-header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.sort-group-inline {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sort-group-inline label {
    font-size: 14px;
    font-weight: 500;
    color: #1a1a1a;
    margin: 0;
    white-space: nowrap;
}

.sort-group-inline .form-control-sm {
    padding: 6px 12px;
    font-size: 13px;
    min-width: 120px;
}

.filter-panel-header .btn-icon {
    background: transparent;
    border: none;
    padding: 4px 8px;
    cursor: pointer;
    color: var(--text-gray);
    transition: color 0.2s ease;
}

.filter-panel-header .btn-icon:hover {
    color: var(--primary);
}

.filter-panel-content {
    padding: 24px;
    display: block;
}

.detail-filter-panel.collapsed .filter-panel-content {
    display: none;
}

.filter-row-keywords {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.filter-group {
    margin-bottom: 24px;
}

.filter-group:last-of-type {
    margin-bottom: 0;
}

.filter-group-half {
    margin-bottom: 0;
}

.filter-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 12px;
}

.keyword-input-group {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.keyword-input-group input {
    flex: 1;
}

.keyword-input-group .btn-sm {
    padding: 8px 16px;
    font-size: 13px;
    white-space: nowrap;
}

.keywords-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 32px;
}

.keyword-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(61,90,115, 0.1);
    border: 1px solid rgba(61,90,115, 0.2);
    border-radius: 20px;
    font-size: 13px;
    color: var(--primary);
    font-weight: 500;
}

.keyword-tag-exclude {
    background: rgba(220, 53, 69, 0.1);
    border-color: rgba(220, 53, 69, 0.2);
    color: #dc3545;
}

.keyword-remove {
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    color: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    transition: background 0.2s ease;
}

.keyword-remove:hover {
    background: rgba(0, 0, 0, 0.1);
}

.keyword-remove i {
    font-size: 12px;
}

.price-range-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.price-range-group input {
    flex: 1;
}

.price-range-group span {
    color: var(--text-gray);
    font-size: 14px;
    font-weight: 500;
}

.filter-actions {
    margin-top: 24px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.filter-actions .btn-outline {
    padding: 10px 20px;
    font-size: 14px;
}

.filter-actions .btn-primary {
    padding: 10px 20px;
    font-size: 14px;
}

@media (max-width: 768px) {
    .statistics-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        padding: 16px;
    }
    
    .stat-card {
        padding: 16px 12px;
    }
    
    .stat-card i {
        font-size: 24px;
        margin-bottom: 8px;
    }
    
    .stat-value {
        font-size: 22px;
    }
    
    .stat-label {
        font-size: 12px;
    }
    
    .filter-panel-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .filter-header-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .sort-group-inline {
        flex: 1;
    }
    
    .sort-group-inline .form-control-sm {
        flex: 1;
        min-width: auto;
    }
    
    .filter-panel-content {
        padding: 20px;
    }
    
    .filter-row-keywords {
        grid-template-columns: 1fr;
        gap: 20px;
        margin-bottom: 20px;
    }
    
    .filter-group {
        margin-bottom: 20px;
    }
    
    .filter-group-half {
        margin-bottom: 20px;
    }
    
    .keyword-input-group {
        flex-direction: column;
    }
    
    .keyword-input-group .btn-sm {
        width: 100%;
    }
    
    .price-range-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .price-range-group span {
        display: none;
    }
    
    .filter-actions {
        flex-direction: column;
    }
    
    .filter-actions button {
        width: 100%;
    }
}

.search-completion-info {
    background: linear-gradient(135deg, #f0f9ff 0%, #ffffff 100%);
    border: 1px solid #d1e7dd;
    border-top: 3px solid #28a745;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.completion-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e9ecef;
}

.completion-icon {
    width: 48px;
    height: 48px;
    background: #28a745;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    flex-shrink: 0;
}

.completion-title h4 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #28a745;
}

.completion-description {
    margin-top: 16px;
}

.completion-text {
    font-size: 15px;
    line-height: 1.8;
    color: #333;
    margin: 0 0 12px 0;
}

.completion-text:last-child {
    margin-bottom: 0;
}

.completion-highlight {
    color: #28a745;
    font-weight: 600;
}


@media (max-width: 1200px) {
    .search-container {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    
    .content-container {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 24px !important;
        box-sizing: border-box !important;
    }
}

.direct-chat-btn.is-contacted {
    background: #f3f5f7;
    border-color: #fdba74;
    color: #c2410c;
}

.direct-chat-btn.is-contacted i {
    color: #ea580c;
}

.direct-chat-contact-warn {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 10px 0 0;
    padding: 10px 12px;
    background: #f3f5f7;
    border: 1px solid #fdba74;
    border-radius: 8px;
    color: #9a3412;
    font-size: 13px;
    line-height: 1.5;
}

.direct-chat-contact-warn i {
    color: #ea580c;
    flex-shrink: 0;
}

.live-preview-options {
    margin: 22px 0 4px;
    padding: 18px;
    border: 1px solid rgba(61,90,115, 0.2);
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(255, 247, 237, 0.96), rgba(255, 255, 255, 0.98));
}

.live-preview-options-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    color: #c2410c;
    font-size: 15px;
    font-weight: 700;
}

.live-preview-options-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.live-preview-option {
    display: flex !important;
    align-items: flex-start !important;
    gap: 11px !important;
    margin: 0 !important;
    padding: 13px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
    color: #1f2937 !important;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.live-preview-option:hover {
    border-color: #fb923c;
    box-shadow: 0 5px 16px rgba(249, 115, 22, 0.1);
    transform: translateY(-1px);
}

.live-preview-option input {
    width: 18px;
    height: 18px;
    margin: 2px 0 0;
    accent-color: #3d5a73;
    flex: 0 0 auto;
}

.live-preview-option input:focus-visible {
    outline: 3px solid rgba(61,90,115, 0.28);
    outline-offset: 2px;
}

.live-preview-option:has(input:disabled) {
    cursor: not-allowed;
    opacity: 0.55;
    background: #f8fafc;
}

.live-preview-option-copy {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.live-preview-option-copy strong {
    color: #1f2937;
    font-size: 14px;
    line-height: 1.4;
}

.live-preview-option-copy small {
    color: #6b7280;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.45;
}

.progress-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0 0 20px;
    color: #1f2937;
    font-size: 21px;
    font-weight: 750;
}

.progress-title i {
    color: #3d5a73;
}

.live-preview-panel[hidden],
.live-preview-new-badge[hidden] {
    display: none !important;
}

.live-preview-panel {
    margin-top: 20px;
    padding: 22px;
    border: 1px solid rgba(61,90,115, 0.22);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 5px 24px rgba(15, 23, 42, 0.08);
    scroll-margin-top: 24px;
}

.live-preview-panel.is-disabled {
    border-color: #e5e7eb;
}

.live-preview-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.live-preview-heading {
    min-width: 0;
}

.live-preview-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.live-preview-title-row h3 {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0;
    color: #111827;
    font-size: 19px;
    font-weight: 750;
}

.live-preview-title-row h3 i {
    color: #3d5a73;
}

#livePreviewUpdatedAt {
    color: #6b7280;
    font-size: 12px;
    white-space: nowrap;
}

.live-preview-heading p {
    margin: 6px 0 0;
    color: #6b7280;
    font-size: 13px;
}

.live-preview-toggle-btn {
    flex: 0 0 auto;
    padding: 8px 13px;
    border: 1px solid #d1d5db;
    border-radius: 9px;
    background: #fff;
    color: #4b5563;
    font-size: 12px;
    font-weight: 650;
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.live-preview-toggle-btn:hover,
.live-preview-toggle-btn:focus-visible {
    border-color: #3d5a73;
    background: #f3f5f7;
    color: #c2410c;
}

.live-preview-new-badge {
    display: block;
    margin: 18px auto 4px;
    padding: 10px 18px;
    border: 0;
    border-radius: 999px;
    background: #3d5a73;
    box-shadow: 0 7px 18px rgba(61,90,115, 0.24);
    color: #fff;
    font-size: 13px;
    font-weight: 750;
    cursor: pointer;
    animation: live-preview-badge-pulse 1.8s ease-in-out infinite;
}

.live-preview-new-badge:hover,
.live-preview-new-badge:focus-visible {
    background: #e85d04;
    transform: translateY(-1px);
}

.live-preview-status {
    min-height: 21px;
    margin: 14px 0;
    color: #6b7280;
    font-size: 13px;
    text-align: center;
}

.live-preview-list {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
}

.live-preview-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    border-radius: 13px;
    background: #fff;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.live-preview-card:hover {
    border-color: #fdba74;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.12);
    transform: translateY(-3px);
}

.live-preview-card.is-new {
    animation: live-preview-card-highlight 2.4s ease;
}

.live-preview-card.is-unavailable {
    opacity: 0.65;
}

.live-preview-card-main {
    display: block;
    flex: 1 1 auto;
    color: inherit;
    text-decoration: none;
}

a.live-preview-card-main:focus-visible {
    outline: 3px solid rgba(61,90,115, 0.32);
    outline-offset: -3px;
}

.live-preview-card-image {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 145px;
    overflow: hidden;
    background: #f3f4f6;
    color: #cbd5e1;
    font-size: 30px;
}

.live-preview-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.25s ease;
}

.live-preview-card:hover .live-preview-card-image img {
    transform: scale(1.035);
}

.live-preview-card-content {
    display: flex;
    flex-direction: column;
    min-height: 122px;
    padding: 13px;
}

.live-preview-card-content h4 {
    display: -webkit-box;
    min-height: 39px;
    margin: 0 0 8px;
    overflow: hidden;
    color: #1f2937;
    font-size: 14px;
    font-weight: 650;
    line-height: 1.4;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.live-preview-card-content > strong {
    color: #3d5a73;
    font-size: 16px;
    font-weight: 750;
}

.live-preview-price-row {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
}

.live-preview-price-row > strong {
    color: #3d5a73;
    font-size: 16px;
    font-weight: 750;
}

.live-preview-card-meta {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin: 9px 0 12px;
    color: #6b7280;
    font-size: 11px;
    line-height: 1.35;
}

.live-preview-card-meta span {
    min-width: 0;
}

.live-preview-card-meta span:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.live-preview-card-meta span:last-child {
    flex: 0 0 auto;
    white-space: nowrap;
}

.live-preview-open-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 10px;
    border-radius: 8px;
    background: #fff4e8;
    color: #c2410c;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}

.live-preview-card-actions {
    display: flex;
    align-items: stretch;
    gap: 7px;
    padding: 0 13px 13px;
}

.live-preview-card-actions > .live-preview-open-button,
.live-preview-card-actions > .direct-chat-btn {
    flex: 1 1 0;
    min-width: 0;
    min-height: 34px;
    border-radius: 8px;
    justify-content: center;
}

.live-preview-card-actions > .direct-chat-btn {
    padding: 8px 9px;
    font-size: 12px;
}

.live-preview-open-button:hover,
.live-preview-open-button:focus-visible {
    background: #3d5a73;
    color: #fff;
}

@keyframes live-preview-card-highlight {
    0%, 100% {
        border-color: #e5e7eb;
        box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
    }
    25%, 70% {
        border-color: #fb923c;
        box-shadow: 0 0 0 4px rgba(251, 146, 60, 0.16), 0 8px 22px rgba(249, 115, 22, 0.16);
    }
}

@keyframes live-preview-badge-pulse {
    0%, 100% {
        box-shadow: 0 7px 18px rgba(61,90,115, 0.24);
    }
    50% {
        box-shadow: 0 7px 24px rgba(61,90,115, 0.42);
    }
}

@media (max-width: 1400px) {
    .live-preview-list {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 1100px) {
    .live-preview-list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .live-preview-options-list {
        grid-template-columns: 1fr;
    }

    .live-preview-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .live-preview-panel {
        padding: 18px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .live-preview-card,
    .live-preview-card-image img,
    .live-preview-option,
    .live-preview-new-badge {
        animation: none !important;
        transition: none !important;
    }
}
