/* ========================================
   产品卖点查询APP - 样式表
   移动端优先设计
======================================== */

:root {
    /* 主题色彩 - 医药专业风格 */
    --primary-color: #0066CC;
    --primary-dark: #004C99;
    --primary-light: #E6F0FA;
    --secondary-color: #00B8A9;
    --accent-color: #FF6B6B;

    /* 中性色 */
    --text-primary: #1A1A2E;
    --text-secondary: #4A4A6A;
    --text-muted: #8E8EA0;
    --bg-main: #F5F7FA;
    --bg-card: #FFFFFF;
    --border-color: #E8ECF0;

    /* 渐变 */
    --gradient-primary: linear-gradient(135deg, #0066CC 0%, #00B8A9 100%);
    --gradient-header: linear-gradient(180deg, #0066CC 0%, #004C99 100%);

    /* 阴影 */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);

    /* 圆角 */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;

    /* 间距 */
    --spacing-xs: 8px;
    --spacing-sm: 12px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
}

/* 重置和基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
}

/* APP容器 */
.app-container {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg-main);
}

/* ========================================
   头部样式
======================================== */
.app-header {
    position: relative;
    padding: var(--spacing-xl) var(--spacing-lg);
    padding-bottom: var(--spacing-xl);
    color: white;
    text-align: center;
    overflow: hidden;
}

.header-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: -30px;
    background: var(--gradient-header);
    border-radius: 0 0 30px 30px;
    z-index: 0;
}

.header-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
}

.header-content {
    position: relative;
    z-index: 1;
}

.logo-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto var(--spacing-md);
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.logo-icon svg {
    width: 36px;
    height: 36px;
    color: white;
}

.app-header h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: var(--spacing-xs);
    letter-spacing: 1px;
}

.subtitle {
    font-size: 14px;
    opacity: 0.85;
    font-weight: 400;
}

/* ========================================
   主要内容区
======================================== */
.main-content {
    flex: 1;
    padding: var(--spacing-lg);
    padding-top: var(--spacing-md);
    margin-top: -20px;
    position: relative;
    z-index: 2;
}

/* 查询卡片 */
.query-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: var(--spacing-lg);
}

.form-group {
    margin-bottom: var(--spacing-md);
}

.form-group label {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xs);
}

.label-icon {
    font-size: 16px;
}

.select-wrapper {
    position: relative;
}

.select-wrapper select {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    padding-right: 40px;
    font-size: 15px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    color: var(--text-primary);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    transition: all 0.3s ease;
    font-family: inherit;
}

.select-wrapper select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(0, 102, 204, 0.1);
}

.select-wrapper select:disabled {
    background: var(--bg-main);
    color: var(--text-muted);
    cursor: not-allowed;
}

.select-arrow {
    position: absolute;
    right: var(--spacing-md);
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 10px;
    pointer-events: none;
}

/* 查询按钮 */
.query-btn {
    width: 100%;
    padding: var(--spacing-md);
    margin-top: var(--spacing-sm);
    font-size: 16px;
    font-weight: 600;
    color: white;
    background: var(--gradient-primary);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 102, 204, 0.3);
    font-family: inherit;
}

.query-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 102, 204, 0.4);
}

.query-btn:active:not(:disabled) {
    transform: translateY(0);
}

.query-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    box-shadow: none;
}

.btn-icon {
    font-size: 18px;
}

/* ========================================
   结果展示区
======================================== */
.result-section {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-md);
    animation: slideUp 0.4s ease-out;
}

.result-section.hidden {
    display: none;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    border-bottom: 2px solid var(--primary-light);
}

.result-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.result-badge {
    font-size: 12px;
    font-weight: 500;
    color: white;
    background: var(--secondary-color);
    padding: 4px 12px;
    border-radius: 20px;
}

.product-info {
    background: var(--primary-light);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-sm);
    margin-bottom: var(--spacing-md);
    font-size: 14px;
    color: var(--primary-dark);
    border-left: 4px solid var(--primary-color);
}

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

/* 卖点列表 */
.selling-points {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.selling-points li {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-sm);
    padding: var(--spacing-md);
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: var(--radius-md);
    font-size: 15px;
    line-height: 1.5;
    animation: fadeInLeft 0.3s ease-out;
    animation-fill-mode: both;
    border: 1px solid var(--border-color);
}

.selling-points li:nth-child(1) {
    animation-delay: 0.1s;
}

.selling-points li:nth-child(2) {
    animation-delay: 0.2s;
}

.selling-points li:nth-child(3) {
    animation-delay: 0.3s;
}

.selling-points li:nth-child(4) {
    animation-delay: 0.4s;
}

.selling-points li:nth-child(5) {
    animation-delay: 0.5s;
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.point-number {
    width: 24px;
    height: 24px;
    min-width: 24px;
    background: var(--gradient-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
}

.point-text {
    flex: 1;
    color: var(--text-primary);
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: var(--spacing-xl) var(--spacing-lg);
    color: var(--text-muted);
}

.empty-state.hidden {
    display: none;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: var(--spacing-md);
    opacity: 0.5;
}

.empty-state p {
    font-size: 14px;
    line-height: 1.8;
}

/* ========================================
   品类标签
======================================== */
.category-tag {
    margin-top: var(--spacing-sm);
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--primary-dark);
    border: 1px solid var(--primary-color);
}

.tag-icon {
    font-size: 14px;
}

.tag-text {
    font-weight: 500;
}

/* ========================================
   品类洞察区域
======================================== */
.category-section {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-md);
    margin-top: var(--spacing-lg);
    animation: slideUp 0.4s ease-out;
    border: 2px solid var(--secondary-color);
}

.category-section.hidden {
    display: none;
}

.category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    border-bottom: 2px solid rgba(0, 184, 169, 0.2);
}

.category-header h3 {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.category-badge {
    font-size: 11px;
    font-weight: 500;
    color: white;
    background: var(--secondary-color);
    padding: 4px 10px;
    border-radius: 12px;
}

.category-insights {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.insight-item {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-sm);
    padding: var(--spacing-md);
    background: linear-gradient(135deg, #f8fffe 0%, #f1f8f7 100%);
    border-radius: var(--radius-md);
    font-size: 14px;
    line-height: 1.6;
    border-left: 3px solid var(--secondary-color);
    animation: fadeInLeft 0.3s ease-out;
    animation-fill-mode: both;
}

.insight-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.insight-text {
    flex: 1;
    color: var(--text-primary);
}

/* 加载状态 */
.loading-state {
    text-align: center;
    padding: var(--spacing-xl);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto var(--spacing-md);
    border: 4px solid var(--border-color);
    border-top-color: var(--secondary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-state p {
    color: var(--text-muted);
    font-size: 14px;
}

/* 错误状态 */
.error-state {
    text-align: center;
    padding: var(--spacing-lg);
}

.error-icon {
    font-size: 32px;
    margin-bottom: var(--spacing-sm);
    opacity: 0.6;
}

.error-state p {
    color: var(--text-muted);
    font-size: 14px;
}

/* ========================================
   底部
======================================== */
.app-footer {
    text-align: center;
    padding: var(--spacing-lg);
    color: var(--text-muted);
    font-size: 12px;
}

/* ========================================
   响应式调整
======================================== */
@media (min-width: 481px) {
    .app-container {
        margin: 20px auto;
        border-radius: var(--radius-lg);
        box-shadow: var(--shadow-lg);
        min-height: calc(100vh - 40px);
    }

    .header-bg {
        border-radius: var(--radius-lg) var(--radius-lg) 30px 30px;
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    :root {
        --text-primary: #F0F0F5;
        --text-secondary: #B0B0C0;
        --text-muted: #707080;
        --bg-main: #0D0D15;
        --bg-card: #1A1A28;
        --border-color: #2A2A3A;
        --primary-light: rgba(0, 102, 204, 0.15);
    }

    .select-wrapper select {
        background: var(--bg-card);
        color: var(--text-primary);
    }

    .selling-points li {
        background: linear-gradient(135deg, #1e1e2e 0%, #252535 100%);
    }
}