/* 老年人安全用药助手 - 样式表 */
/* 大字体、高对比度、简洁设计 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #e3f2fd 0%, #f5f5f5 100%);
    color: #333;
    font-size: 24px; /* 超大号字体 */
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 头部 */
.header {
    text-align: center;
    background: #1976d2;
    color: white;
    padding: 30px 20px;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.app-title {
    font-size: 48px;
    font-weight: bold;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.app-subtitle {
    font-size: 28px;
    opacity: 0.9;
}

/* 搜索区域 */
.search-section {
    background: white;
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.search-box {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.search-input {
    flex: 1;
    font-size: 28px;
    padding: 20px;
    border: 3px solid #ddd;
    border-radius: 10px;
    outline: none;
    transition: border-color 0.3s;
}

.search-input:focus {
    border-color: #1976d2;
}

.search-input::placeholder {
    color: #999;
    font-size: 24px;
}

/* 语音控制 */
.voice-controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.voice-settings-panel {
    background: #f5f5f5;
    padding: 20px;
    border-radius: 10px;
    margin-top: 20px;
    border: 2px solid #ddd;
}

.setting-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
}

.setting-label {
    font-weight: bold;
    color: #333;
}

.setting-select {
    font-size: 24px;
    padding: 10px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: white;
}

/* 按钮样式 */
.btn {
    font-size: 28px;
    padding: 20px 40px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    outline: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.btn:active {
    transform: scale(0.95);
}

.btn-large {
    min-width: 200px;
}

.btn-primary {
    background: #1976d2;
    color: white;
}

.btn-primary:hover {
    background: #1565c0;
}

.btn-secondary {
    background: #757575;
    color: white;
}

.btn-secondary:hover {
    background: #616161;
}

.btn-voice {
    background: #ff9800;
    color: white;
    font-size: 32px;
    padding: 25px 50px;
}

.btn-voice:hover {
    background: #f57c00;
}

.btn-voice.active {
    background: #f44336;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.btn-close {
    background: #f44336;
    color: white;
    font-size: 24px;
    padding: 15px 25px;
}

/* 分类区域 */
.category-section {
    background: white;
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.section-title {
    font-size: 36px;
    font-weight: bold;
    margin-bottom: 20px;
    color: #1976d2;
    text-align: center;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.category-btn {
    background: linear-gradient(135deg, #2196f3, #1976d2);
    color: white;
    font-size: 28px;
    padding: 30px 20px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.category-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

/* 药品列表 */
.medicine-list-section {
    flex: 1;
    background: white;
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.medicine-list {
    display: grid;
    gap: 15px;
}

.medicine-card {
    background: #f5f5f5;
    padding: 25px;
    border-radius: 12px;
    border: 3px solid #ddd;
    cursor: pointer;
    transition: all 0.3s;
}

.medicine-card:hover {
    border-color: #1976d2;
    transform: translateY(-2px);
}

.medicine-name {
    font-size: 32px;
    font-weight: bold;
    color: #1976d2;
    margin-bottom: 10px;
}

.medicine-category {
    font-size: 24px;
    color: #666;
    margin-bottom: 5px;
}

.medicine-indications {
    font-size: 24px;
    color: #333;
    line-height: 1.5;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
    font-size: 28px;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 1000;
    overflow-y: auto;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: white;
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    margin: auto;
}

.modal-header {
    background: #1976d2;
    color: white;
    padding: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 36px;
    font-weight: bold;
    margin: 0;
}

.modal-body {
    padding: 30px;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-footer {
    padding: 30px;
    background: #f5f5f5;
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

/* 详情字段 */
.detail-section {
    margin-bottom: 25px;
}

.detail-label {
    font-size: 28px;
    font-weight: bold;
    color: #1976d2;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.detail-content {
    font-size: 26px;
    line-height: 1.6;
    color: #333;
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    border-left: 5px solid #1976d2;
}

.warning-section {
    background: #ffebee;
    border-left: 5px solid #f44336;
    padding: 20px;
    border-radius: 8px;
    margin-top: 15px;
}

.warning-label {
    color: #f44336;
    font-weight: bold;
}

/* 加载动画 */
.loading {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 2000;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 6px solid #f3f3f3;
    border-top: 6px solid #1976d2;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

/* 提示消息 */
.toast {
    position: fixed;
    top: 50px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 20px 40px;
    border-radius: 10px;
    font-size: 26px;
    z-index: 3000;
    display: none;
}

.toast.show {
    display: block;
    animation: fadeInOut 3s ease-in-out;
}

@keyframes fadeInOut {
    0% { opacity: 0; }
    20% { opacity: 1; }
    80% { opacity: 1; }
    100% { opacity: 0; }
}

/* 底部 */
.footer {
    text-align: center;
    color: #666;
    font-size: 24px;
    margin-top: auto;
    padding: 20px;
}

.footer p {
    margin-bottom: 10px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .app-title {
        font-size: 40px;
    }
    
    .app-subtitle {
        font-size: 24px;
    }
    
    .search-box {
        flex-direction: column;
    }
    
    .category-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        margin: 10px;
    }
    
    .modal-footer {
        flex-direction: column;
    }
}

/* 微信浏览器优化 */
@media (max-width: 480px) {
    body {
        font-size: 22px;
    }
    
    .btn {
        font-size: 26px;
        padding: 18px 30px;
    }
    
    .medicine-name {
        font-size: 28px;
    }
}