/* 优惠券模块 - 主框架样式 */

/* ========== 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 {
    display: none;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.yhquan-page.active {
    display: flex;
}

/* ========== 搜索区域 ========== */
.yhquan-search-container {
    flex-shrink: 0;
    padding: 12px 20px;
    background: linear-gradient(180deg, #ffffff 0%, #fcfcfc 100%);
    border-bottom: 1px solid rgba(209, 213, 219, 0.5);
}

.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: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 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; }
}

/* ========== 桌面端样式 (min-width: 769px) ========== */
@media screen and (min-width: 769px) {
    .yhquan-search-container {
        padding: 14px 24px;
    }

    .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 {
        grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
        gap: 16px;
    }
}

/* ========== 手机端样式 (max-width: 768px) ========== */
@media screen and (max-width: 768px) {
    .yhquan-search-container {
        padding: 10px 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;
    }
}
