/**
 * 每日养生组件样式
 * 
 * 功能说明：
 * 1. 支持简化版、完整版、卡片版三种模式
 * 2. 响应式设计，适配移动端
 * 3. 现代化UI设计，突出每日变化
 * 4. 天气信息可视化展示
 * 
 * @author HerbalScript Team
 * @version 1.0
 */

/* 基础样式重置 */
.daily-widget * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 组件基础样式 */
.daily-widget {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #2d3748;
    line-height: 1.6;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    background: white;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* 简化版样式 */
.daily-widget.simple {
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

.daily-widget.simple .main-card {
    padding: 0;
    width: 100%;
    min-height: 100%;
    display: flex;
    flex-direction: column;
}

/* 卡片头部 */
.daily-widget.simple .card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
}

.daily-widget.simple .date-weather {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.daily-widget.simple .date-section {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.daily-widget.simple .current-date {
    font-size: 1.3em;
    font-weight: 600;
}

.daily-widget.simple .update-time {
    font-size: 0.85em;
    opacity: 0.8;
}

.daily-widget.simple .weather-info {
    display: flex;
    justify-content: center;
    align-items: center;
}

.daily-widget.simple .weather-section {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.2);
    padding: 10px 15px;
    border-radius: 25px;
    backdrop-filter: blur(10px);
}

.daily-widget.simple .weather-place {
    font-size: 0.9em;
    opacity: 0.9;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 2px 6px;
    border-radius: 12px;
    position: relative;
}

.daily-widget.simple .weather-place:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.daily-widget.simple .weather-place::after {
    content: "点击设置位置";
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.7em;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1000;
}

.daily-widget.simple .weather-place:hover::after {
    opacity: 1;
}

.daily-widget.simple .weather-icon {
    font-size: 1.5em;
}

.daily-widget.simple .temperature {
    font-size: 1.2em;
    font-weight: 600;
}

.daily-widget.simple .weather-desc {
    font-size: 0.9em;
    opacity: 0.9;
}

/* 养生重点区域 */
.daily-widget.simple .focus-section {
    padding: 7px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    flex: 1;
}

.daily-widget.simple .focus-section h4 {
    margin-bottom: 10px;
    font-size: 1em;
    opacity: 0.9;
}

.daily-widget.simple .term-link {
    color: #fff;
    text-decoration: underline;
    text-decoration-color: rgba(255, 255, 255, 0.6);
    transition: all 0.3s ease;
}

.daily-widget.simple .term-link:hover {
    text-decoration-color: #fff;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

/* 标题区域样式 */
.daily-widget.simple .title-section {
    margin-bottom: 15px;
}

.daily-widget.simple .title-section h3 {
    margin: 0 0 5px 0;
    font-size: 1.2em;
    font-weight: 600;
    color: #fff;
}

.daily-widget.simple .daily-date {
    font-size: 0.9em;
    opacity: 0.9;
}

.daily-widget.simple .title-section .term-link {
    color: #fff;
    text-decoration: underline;
    text-decoration-color: rgba(255, 255, 255, 0.6);
    transition: all 0.3s ease;
    font-size: 0.9em;
    margin-left: 5px;
}

.daily-widget.simple .title-section .term-link:hover {
    text-decoration-color: #fff;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

.daily-widget.simple .subtitle {
    margin: 0;
    font-size: 0.85em;
    opacity: 0.8;
    color: #fff;
}

.daily-widget.simple .focus-section h3 {
    margin: 0 0 5px 0;
    font-size: 1.2em;
    font-weight: 600;
    color: #fff;
}

.daily-widget.simple .focus-section .daily-date {
    font-size: 0.9em;
    opacity: 0.9;
}

.daily-widget.simple .focus-section .term-link {
    color: #fff;
    text-decoration: underline;
    text-decoration-color: rgba(255, 255, 255, 0.6);
    transition: all 0.3s ease;
    font-size: 0.9em;
    margin-left: 5px;
}

.daily-widget.simple .focus-section .term-link:hover {
    text-decoration-color: #fff;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

.daily-widget.simple .focus-section .subtitle {
    margin: 0 0 15px 0;
    font-size: 0.85em;
    opacity: 0.8;
    color: #fff;
}

.daily-widget.simple .focus-section h4 {
    margin: 0 0 8px 0;
    font-size: 1em;
    font-weight: 600;
    color: #fff;
}

.daily-widget.simple .focus-content {
    font-size: 1.1em;
    line-height: 1.5;
    margin: 0;
}

.daily-widget.simple .daily-focus p {
    font-size: 0.95em;
    line-height: 1.4;
}

/* 快速建议区域 */
.daily-widget.simple .tips-section {
    padding: 20px;
    background: #f8fafc;
    flex: 1;
}

.daily-widget.simple .tip-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background: white;
    border-radius: 10px;
    border-left: 4px solid #667eea;
    margin-bottom: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.daily-widget.simple .tip-item:hover {
    background: #f1f5f9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.daily-widget.simple .tip-icon {
    font-size: 1.3em;
    flex-shrink: 0;
}

.daily-widget.simple .tip-text {
    font-size: 1em;
    color: #2d3748;
    font-weight: 500;
}

/* 天气适应建议 */
.daily-widget.simple .weather-adaptation {
    padding: 5px;
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    flex: 1;
}

.daily-widget.simple .weather-adaptation h4 {
    margin-bottom: 10px;
    font-size: 1em;
    color: #2d3748;
    font-weight: 600;
}

.daily-widget.simple .weather-adaptation p {
    font-size: 0.95em;
    color: #4a5568;
    line-height: 1.5;
}

.daily-widget.simple .widget-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 10px;
    border-top: 1px solid #f1f5f9;
    font-size: 0.85em;
}

.daily-widget.simple .current-term {
    color: #718096;
}

.daily-widget.simple .refresh-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    background: #4299e1;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8em;
    transition: all 0.3s ease;
}

.daily-widget.simple .refresh-btn:hover {
    background: #3182ce;
    transform: translateY(-1px);
}

/* 完整版样式 */
.daily-widget.full {
    padding: 0;
}

.daily-widget.full .widget-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    position: relative;
    overflow: hidden;
}

.daily-widget.full .widget-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="white" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="white" opacity="0.1"/><circle cx="50" cy="10" r="0.5" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.daily-widget.full .header-main {
    position: relative;
    z-index: 1;
}

.daily-widget.full .header-main h2 {
    margin-bottom: 15px;
    font-size: 1.8em;
    font-weight: 700;
}

.daily-widget.full .date-weather {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.daily-widget.full .date {
    font-size: 1.1em;
    font-weight: 600;
}

.daily-widget.full .weather-detail {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 15px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 25px;
    backdrop-filter: blur(10px);
}

.daily-widget.full .weather-icon {
    font-size: 1.3em;
}

.daily-widget.full .temperature {
    font-weight: 700;
    font-size: 1.2em;
}

.daily-widget.full .weather-desc {
    font-size: 0.9em;
}

.daily-widget.full .humidity {
    font-size: 0.8em;
    opacity: 0.8;
}

.daily-widget.full .current-term-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    padding: 8px 15px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    font-size: 0.9em;
    font-weight: 600;
}

.daily-widget.full .daily-focus-section {
    padding: 25px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.daily-widget.full .daily-focus-section h3 {
    margin-bottom: 10px;
    font-size: 1.3em;
    font-weight: 600;
}

.daily-widget.full .daily-focus-section p {
    font-size: 1em;
    line-height: 1.5;
}

.daily-widget.full .advice-sections {
    padding: 25px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
}

.daily-widget.full .advice-section {
    background: #f8fafc;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #e2e8f0;
}

.daily-widget.full .advice-section h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    font-size: 1.2em;
    font-weight: 600;
    color: #2d3748;
}

.daily-widget.full .section-icon {
    font-size: 1.3em;
}

.daily-widget.full .diet-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.daily-widget.full .diet-group {
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid;
}

.daily-widget.full .diet-group.recommended {
    background: #f0fff4;
    border-left-color: #48bb78;
}

.daily-widget.full .diet-group.good {
    background: #fef5e7;
    border-left-color: #ed8936;
}

.daily-widget.full .diet-group.avoid {
    background: #fed7d7;
    border-left-color: #f56565;
}

.daily-widget.full .diet-group h4 {
    margin-bottom: 8px;
    font-size: 0.9em;
    font-weight: 600;
}

.daily-widget.full .food-list {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.daily-widget.full .food-item {
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 12px;
    font-size: 0.8em;
    color: #4a5568;
}

.daily-widget.full .daily-menu {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e2e8f0;
}

.daily-widget.full .daily-menu h4 {
    margin-bottom: 10px;
    font-size: 1em;
    font-weight: 600;
    color: #2d3748;
}

.daily-widget.full .menu-items {
    display: grid;
    gap: 8px;
}

.daily-widget.full .menu-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: white;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.daily-widget.full .meal-name {
    font-weight: 600;
    color: #2d3748;
}

.daily-widget.full .meal-food {
    color: #718096;
    font-size: 0.9em;
}

.daily-widget.full .exercise-content {
    display: grid;
    gap: 15px;
}

.daily-widget.full .exercise-group h4,
.daily-widget.full .exercise-time h4,
.daily-widget.full .exercise-tips h4 {
    margin-bottom: 8px;
    font-size: 0.9em;
    font-weight: 600;
    color: #2d3748;
}

.daily-widget.full .exercise-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.daily-widget.full .exercise-item {
    padding: 6px 12px;
    background: #4299e1;
    color: white;
    border-radius: 15px;
    font-size: 0.85em;
}

.daily-widget.full .exercise-time p {
    color: #4a5568;
    font-size: 0.9em;
}

.daily-widget.full .exercise-tips ul {
    list-style: none;
    padding-left: 0;
}

.daily-widget.full .exercise-tips li {
    padding: 5px 0;
    color: #4a5568;
    font-size: 0.9em;
    position: relative;
    padding-left: 15px;
}

.daily-widget.full .exercise-tips li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: #4299e1;
}

.daily-widget.full .acupoints-content {
    display: grid;
    gap: 15px;
}

.daily-widget.full .acupoint-items {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.daily-widget.full .acupoint-item {
    padding: 6px 12px;
    background: #9f7aea;
    color: white;
    border-radius: 15px;
    font-size: 0.85em;
}

.daily-widget.full .massage-methods ul {
    list-style: none;
    padding-left: 0;
}

.daily-widget.full .massage-methods li {
    padding: 5px 0;
    color: #4a5568;
    font-size: 0.9em;
    position: relative;
    padding-left: 15px;
}

.daily-widget.full .massage-methods li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: #9f7aea;
}

.daily-widget.full .lifestyle-content {
    display: grid;
    gap: 15px;
}

.daily-widget.full .lifestyle-group h4,
.daily-widget.full .mood-group h4 {
    margin-bottom: 8px;
    font-size: 0.9em;
    font-weight: 600;
    color: #2d3748;
}

.daily-widget.full .lifestyle-group ul,
.daily-widget.full .mood-group ul {
    list-style: none;
    padding-left: 0;
}

.daily-widget.full .lifestyle-group li,
.daily-widget.full .mood-group li {
    padding: 5px 0;
    color: #4a5568;
    font-size: 0.9em;
    position: relative;
    padding-left: 15px;
}

.daily-widget.full .lifestyle-group li::before,
.daily-widget.full .mood-group li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: #ed8936;
}

.daily-widget.full .weather-adaptation-section {
    padding: 25px;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.daily-widget.full .weather-adaptation-section h3 {
    margin-bottom: 10px;
    font-size: 1.2em;
    font-weight: 600;
}

.daily-widget.full .weather-adaptation-section p {
    margin-bottom: 15px;
    font-size: 1em;
    line-height: 1.5;
}

.daily-widget.full .weather-details {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    backdrop-filter: blur(10px);
}

.daily-widget.full .weather-details span {
    font-size: 0.9em;
    opacity: 0.9;
}

.daily-widget.full .widget-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    font-size: 0.85em;
}

.daily-widget.full .last-updated {
    color: #718096;
}

.daily-widget.full .refresh-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #4299e1;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.3s ease;
}

.daily-widget.full .refresh-btn:hover {
    background: #3182ce;
    transform: translateY(-2px);
}

/* 卡片版样式 */
.daily-widget.card {
    max-width: 350px;
    padding: 0;
    border-radius: 16px;
    overflow: hidden;
}

.daily-widget.card .card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.daily-widget.card .card-date {
    font-size: 1.1em;
    font-weight: 600;
}

.daily-widget.card .card-weather {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

.daily-widget.card .weather-icon {
    font-size: 1.2em;
}

.daily-widget.card .temperature {
    font-weight: 600;
    font-size: 1em;
}

.daily-widget.card .card-content {
    padding: 20px;
}

.daily-widget.card .card-focus {
    margin-bottom: 20px;
    padding: 15px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border-radius: 8px;
    color: white;
}

.daily-widget.card .card-focus h4 {
    margin-bottom: 8px;
    font-size: 0.9em;
    opacity: 0.9;
}

.daily-widget.card .card-focus p {
    font-size: 0.9em;
    line-height: 1.4;
}

.daily-widget.card .card-tips {
    display: grid;
    gap: 10px;
}

.daily-widget.card .tip-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: #f7fafc;
    border-radius: 8px;
    border-left: 4px solid #4299e1;
    transition: all 0.3s ease;
}

.daily-widget.card .tip-card:hover {
    background: #edf2f7;
    transform: translateX(5px);
}

.daily-widget.card .tip-icon {
    font-size: 1.2em;
}

.daily-widget.card .tip-text {
    color: #4a5568;
    font-size: 0.9em;
    flex: 1;
}

.daily-widget.card .card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    font-size: 0.8em;
}

.daily-widget.card .term-info {
    color: #718096;
}

.daily-widget.card .refresh-btn {
    display: flex;
    align-items: center;
    padding: 6px;
    background: #4299e1;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 32px;
    height: 32px;
    justify-content: center;
}

.daily-widget.card .refresh-btn:hover {
    background: #3182ce;
    transform: rotate(180deg);
}

/* 错误状态样式 */
.daily-widget.error {
    padding: 30px;
    text-align: center;
    background: #fed7d7;
    border: 1px solid #f56565;
}

.daily-widget.error .error-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.daily-widget.error .error-icon {
    font-size: 2em;
}

.daily-widget.error p {
    color: #c53030;
    font-size: 1em;
}

.daily-widget.error button {
    padding: 8px 16px;
    background: #f56565;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.3s ease;
}

.daily-widget.error button:hover {
    background: #e53e3e;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .daily-widget.simple .widget-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .daily-widget.simple .weather-info {
        align-self: flex-end;
    }
    
    .daily-widget.simple .quick-tips {
        grid-template-columns: 1fr;
    }
    
    .daily-widget.full .advice-sections {
        grid-template-columns: 1fr;
        padding: 15px;
    }
    
    .daily-widget.full .diet-content {
        grid-template-columns: 1fr;
    }
    
    .daily-widget.full .weather-details {
        flex-direction: column;
        gap: 8px;
    }
    
    .daily-widget.full .widget-header {
        padding: 20px;
    }
    
    .daily-widget.full .current-term-badge {
        position: static;
        margin-top: 10px;
        align-self: flex-start;
    }
    
    .daily-widget.card {
        max-width: 100%;
    }
}

/* 动画效果 */
.daily-widget {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.daily-widget .tip-item:hover,
.daily-widget .tip-card:hover {
    animation: pulse 0.3s ease-in-out;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
    100% {
        transform: scale(1);
    }
}

/* 加载状态 */
.daily-widget.loading {
    position: relative;
    min-height: 200px;
}

.daily-widget.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #4299e1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
} 