/* 优惠券模块 - 主框架样式 */

/* ========== CSS变量定义 ========== */
:root {
    --yhquan-primary: #3d6dff;
    --yhquan-primary-light: #e8f0ff;
    --yhquan-bg: #fcfcfc;
    --yhquan-card-bg: #ffffff;
    --yhquan-transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========== 页面容器 ========== */
.yhquan-page {
    position: relative;
    display: none;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.yhquan-page.active {
    display: flex;
}

.yhquan-quick-links {
    position: absolute;
    top: 10px;
    left: 12px;
    z-index: 110;
    display: flex;
    align-items: center;
    gap: 5px;
    max-width: min(760px, calc(100% - 72px));
    padding: 0;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    scrollbar-width: none;
}

.yhquan-quick-links::-webkit-scrollbar {
    display: none;
}

.yhquan-quick-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 22px;
    padding: 0 7px;
    color: #667085;
    border: 1px solid rgba(209, 213, 219, 0.72);
    border-radius: 5px;
    background: rgba(252, 252, 252, 0.72);
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    transition: color 0.16s ease, border-color 0.16s ease, background-color 0.16s ease;
}

.yhquan-quick-links a i {
    color: #8a94a6;
    font-size: 10px;
    transition: color 0.16s ease;
}

.yhquan-quick-links a:hover {
    color: var(--yhquan-primary);
    border-color: rgba(61, 109, 255, 0.35);
    background: var(--yhquan-primary-light);
}

.yhquan-quick-links a:hover i {
    color: #f97316;
}

/* ========== 搜索区域 ========== */
.yhquan-search-container {
    flex-shrink: 0;
    padding: 52px 20px 36px;
    background: linear-gradient(180deg, #ffffff 0%, #fcfcfc 100%);
    border-bottom: 1px solid rgba(209, 213, 219, 0.5);
}

.yhquan-brand-hero {
    text-align: center;
    margin: 0 auto 18px;
    user-select: none;
}

.yhquan-brand-title {
    display: inline-flex;
    align-items: baseline;
    justify-content: center;
    gap: 2px;
    color: #111827;
    font-size: 40px;
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: 0.08em;
    text-shadow: 0 8px 24px rgba(245, 130, 32, 0.16);
}

.yhquan-brand-main {
    background: linear-gradient(135deg, #7c2d12 0%, #f97316 48%, #facc15 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.yhquan-brand-no {
    margin: 0 3px;
    color: #ea580c;
    font-size: 0.82em;
    font-weight: 700;
}

.yhquan-brand-sub {
    margin-top: 10px;
    color: #9ca3af;
    font-size: 13px;
    line-height: 1;
    letter-spacing: 0;
}

.yhquan-search-box {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 600px;
    margin: 0 auto;
}

.yhquan-search-input-wrapper {
    position: relative;
    flex: 1;
    min-width: 0;
}

.yhquan-search-input {
    width: 100%;
    height: 36px;
    padding: 0 40px 0 14px;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    font-size: 13px;
    color: #374151;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: var(--yhquan-transition);
    box-sizing: border-box;
    outline: none;
}

.yhquan-search-input::placeholder {
    color: #9ca3af;
}

.yhquan-search-input:hover {
    border-color: #9ca3af;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.yhquan-search-input:focus {
    border-color: var(--yhquan-primary);
    box-shadow: 0 4px 16px rgba(61, 109, 255, 0.15);
}

/* 清除按钮 */
.yhquan-search-clear {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: #9ca3af;
    cursor: pointer;
    border-radius: 4px;
    transition: var(--yhquan-transition);
    padding: 0;
    outline: none;
}

.yhquan-search-clear:hover {
    background: #f3f4f6;
    color: #6b7280;
}

.yhquan-search-clear i {
    font-size: 14px;
}

/* 搜索按钮 */
.yhquan-search-btn {
    flex-shrink: 0;
    height: 36px;
    padding: 0 20px;
    background: var(--yhquan-primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(61, 109, 255, 0.3);
    transition: var(--yhquan-transition);
    display: flex;
    align-items: center;
    gap: 6px;
}

.yhquan-search-btn:hover {
    background: #2d5ce6;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(61, 109, 255, 0.4);
}

.yhquan-search-btn:active {
    transform: translateY(0);
}

.yhquan-search-btn:disabled {
    background: #9ca3af;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

.yhquan-search-btn i {
    font-size: 13px;
}

/* ========== 内容区域 ========== */
.yhquan-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #f9fafb;
}

.yhquan-cards-container {
    max-width: 1520px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
}

/* ========== 空状态 ========== */
.yhquan-empty {
    text-align: center;
    padding: 60px 20px;
    color: #9ca3af;
    grid-column: 1 / -1;
}

.yhquan-empty i {
    font-size: 48px;
    margin-bottom: 16px;
    color: #d1d5db;
}

.yhquan-empty-text {
    font-size: 14px;
}

/* ========== 登录提示 ========== */
.yhquan-login-required {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 200px);
    text-align: center;
    color: #9ca3af;
    grid-column: 1 / -1;
}

.yhquan-login-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.yhquan-login-icon i {
    font-size: 36px;
    color: #f59e0b;
}

.yhquan-login-text {
    font-size: 18px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.yhquan-login-hint {
    font-size: 13px;
    color: #9ca3af;
}

/* ========== 加载状态 ========== */
.yhquan-loading-full {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 200px);
    grid-column: 1 / -1;
    width: 100%;
}

.yhquan-loading-spinner-large {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(61, 109, 255, 0.15);
    border-top-color: var(--yhquan-primary);
    border-radius: 50%;
    animation: yhquan-spin 1s linear infinite;
    margin-bottom: 16px;
}

.yhquan-loading-text-large {
    font-size: 14px;
    color: #6b7280;
    font-weight: 500;
}

@keyframes yhquan-spin {
    to { transform: rotate(360deg); }
}

/* ========== 使用说明浮窗 ========== */
.yhquan-desc-tooltip {
    position: fixed;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.6;
    max-width: 320px;
    z-index: 9999;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    pointer-events: none;
    white-space: pre-wrap;
    word-break: break-all;
    animation: yhquan-tooltip-fade-in 0.15s ease-out;
}

@keyframes yhquan-tooltip-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Floating action buttons */
.yhquan-share-fab,
.yhquan-cj-fab,
.yhquan-login-fab,
.yhquan-tools-fab {
    position: absolute;
    right: 10px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #3d6dff;
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    font-size: 16px;
    padding: 0;
    outline: none;
}

.yhquan-cj-fab {
    bottom: 142px;
}

.yhquan-share-fab {
    bottom: 98px;
}

.yhquan-login-fab {
    bottom: 10px;
}

.yhquan-tools-fab {
    bottom: 54px;
}

@media (hover: hover) {
    .yhquan-share-fab:hover,
    .yhquan-cj-fab:hover,
    .yhquan-login-fab:hover,
    .yhquan-tools-fab:hover {
        background: #2b5be0;
    }
}

.yhquan-share-fab:active,
.yhquan-cj-fab:active,
.yhquan-login-fab:active,
.yhquan-tools-fab:active {
    background: #1e4abf;
}

/* ========== 桌面端样式 (min-width: 769px) ========== */
@media screen and (min-width: 769px) {
    .yhquan-search-container {
        padding: 58px 24px 36px;
    }

    .yhquan-brand-title {
        font-size: 42px;
        letter-spacing: 0.1em;
    }

    .yhquan-search-box {
        max-width: 700px;
    }

    .yhquan-search-input {
        height: 38px;
    }

    .yhquan-search-btn {
        height: 38px;
        padding: 0 24px;
    }

    .yhquan-content {
        padding: 20px;
    }

    .yhquan-cards-container {
        max-width: 1520px;
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 16px;
    }
}

/* ========== 手机端样式 (max-width: 768px) ========== */
@media screen and (max-width: 768px) {
    .yhquan-search-container {
        padding: 38px 12px 36px;
    }

    .yhquan-quick-links {
        display: none;
    }

    .yhquan-brand-hero {
        margin-bottom: 14px;
    }

    .yhquan-brand-title {
        font-size: 31px;
        letter-spacing: 0.06em;
    }

    .yhquan-brand-sub {
        margin-top: 8px;
        font-size: 12px;
    }

    .yhquan-search-box {
        flex-wrap: nowrap;
        gap: 6px;
    }

    .yhquan-search-input-wrapper {
        flex: 1;
        min-width: 0;
    }

    .yhquan-search-input {
        height: 34px;
        padding: 0 30px 0 10px;
        font-size: 13px;
    }

    .yhquan-search-clear {
        right: 8px;
        width: 22px;
        height: 22px;
    }

    .yhquan-search-clear i {
        font-size: 13px;
    }

    .yhquan-search-btn {
        height: 34px;
        padding: 0 12px;
        font-size: 12px;
        flex-shrink: 0;
    }

    .yhquan-content {
        padding: 12px;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .yhquan-content::-webkit-scrollbar {
        display: none;
    }

    .yhquan-cards-container {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}
