/* ========== 健康小妙招容器 ========== */
.health-tips-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    min-height: 600px;
    background: linear-gradient(135deg, #f0fff4 0%, #e6fffa 50%, #f0fdf4 100%);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

/* 全屏模式 */
.health-tips-container.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999;
    border-radius: 0;
    margin: 0;
}

/* ========== 顶部工具栏 ========== */
.health-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: linear-gradient(135deg, #38a169 0%, #2f855a 50%, #276749 100%);
    border-bottom: none;
    color: white;
    flex-wrap: wrap;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(56, 161, 105, 0.3);
    flex-shrink: 0;
}

.toolbar-group {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
    min-height: 28px;
}

.toolbar-group:last-child {
    margin-right: 8px;
}

.toolbar-btn {
    padding: 6px 10px;
    background: #ffffff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    color: #38a169;
    transition: all 0.3s;
    white-space: nowrap;
}

.toolbar-btn:hover:not(:disabled) {
    background: #fff;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

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

.toolbar-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.toolbar-btn.active {
    background: #276749;
    color: #c6f6d5;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

body.dark .toolbar-btn.active {
    background: #38a169;
    color: white;
}

/* ========== 主内容区 ========== */
.health-main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
    background: linear-gradient(135deg, #f0fff4 0%, #e6fffa 100%);
}

/* ========== 左侧历史面板 ========== */
.health-history-panel {
    width: 200px;
    background: white;
    border-right: 1px solid #c6f6d5;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: linear-gradient(to bottom, #f0fff4 0%, #e6fffa 100%);
    border-bottom: 1px solid #c6f6d5;
}

.history-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #276749;
}

.history-clear-btn {
    background: #fef2f2;
    border: none;
    color: #ef4444;
    font-size: 11px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 3px;
    transition: all 0.2s;
}

.history-clear-btn:hover {
    background: #fee2e2;
}

.history-search {
    padding: 8px;
    border-bottom: 1px solid #c6f6d5;
    flex-shrink: 0;
}

.history-search input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #c6f6d5;
    border-radius: 4px;
    font-size: 12px;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
}

.history-search input:focus {
    border-color: #38a169;
    box-shadow: 0 0 0 2px rgba(56, 161, 105, 0.1);
}

.history-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    background: #ffffff;
}

/* 历史记录空状态 */
.history-empty {
    text-align: center;
    padding: 20px;
    color: #9ae6b4;
    font-size: 12px;
}

body.dark .history-empty {
    color: #68d391;
}

.history-item {
    display: flex;
    flex-direction: column;
    padding: 10px 12px;
    margin: 4px 0;
    background: #f0fff4;
    border: 1px solid #c6f6d5;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    animation: fadeIn 0.2s ease;
}

.history-item:hover {
    background: #e6fffa;
    border-color: #9ae6b4;
    transform: translateX(2px);
}

.history-item.active {
    background: #c6f6d5;
    border-color: #38a169;
    box-shadow: 0 1px 3px rgba(56, 161, 105, 0.2);
}

.history-item-delete {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 18px;
    height: 18px;
    background: #fef2f2;
    color: #ef4444;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    opacity: 0;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}

.history-item:hover .history-item-delete {
    opacity: 1;
}

.history-item-delete:hover {
    background: #ef4444;
    color: white;
}

.history-item-name {
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 4px;
    color: #276749;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-item-time {
    color: #68d391;
    font-size: 11px;
}

/* ========== 中间输入面板 ========== */
.input-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: white;
    overflow: hidden;
    min-width: 320px;
    border-right: 1px solid #c6f6d5;
}

.input-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: linear-gradient(to bottom, #f0fff4 0%, #e6fffa 100%);
    border-bottom: 1px solid #c6f6d5;
    flex-shrink: 0;
}

.input-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #276749;
}

.input-tip {
    font-size: 11px;
    color: #68d391;
    background: rgba(104, 211, 145, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
}

.input-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

/* 快捷标签 */
.quick-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-bottom: 16px;
    padding: 12px;
    background: #f0fff4;
    border-radius: 6px;
    border: 1px solid #c6f6d5;
}

.tag-label {
    font-size: 12px;
    color: #276749;
    font-weight: 500;
}

.quick-tag {
    padding: 4px 10px;
    background: white;
    border: 1px solid #9ae6b4;
    border-radius: 12px;
    font-size: 12px;
    color: #38a169;
    cursor: pointer;
    transition: all 0.2s;
}

.quick-tag:hover {
    background: #38a169;
    color: white;
    border-color: #38a169;
}

/* 输入组 */
.input-group {
    margin-bottom: 16px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #276749;
}

.input-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #c6f6d5;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.6;
    font-family: inherit;
    resize: vertical;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
    min-height: 120px;
}

.input-group textarea:focus {
    border-color: #38a169;
    box-shadow: 0 0 0 2px rgba(56, 161, 105, 0.1);
}

.input-group textarea::placeholder {
    color: #9ae6b4;
}

/* 查询模式选择 */
.mode-selector {
    margin-bottom: 16px;
}

.mode-selector > label {
    display: block;
    margin-bottom: 10px;
    font-size: 13px;
    font-weight: 500;
    color: #276749;
}

.mode-options {
    display: flex;
    gap: 12px;
}

.mode-option {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 12px;
    background: #f0fff4;
    border: 2px solid #c6f6d5;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.mode-option:hover {
    border-color: #9ae6b4;
}

.mode-option input[type="radio"] {
    display: none;
}

.mode-option input[type="radio"]:checked + .mode-label {
    color: #276749;
}

.mode-option:has(input[type="radio"]:checked) {
    background: #c6f6d5;
    border-color: #38a169;
}

.mode-label {
    font-size: 14px;
    font-weight: 600;
    color: #48bb78;
    margin-bottom: 4px;
}

.mode-desc {
    font-size: 11px;
    color: #68d391;
}

/* 提交按钮 */
.submit-area {
    margin-top: 16px;
}

.submit-btn {
    width: 100%;
    padding: 12px 20px;
    background: linear-gradient(135deg, #38a169 0%, #2f855a 100%);
    border: none;
    border-radius: 6px;
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.submit-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #2f855a 0%, #276749 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(56, 161, 105, 0.3);
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

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

/* 快捷键提示 */
.shortcut-hint {
    text-align: center;
    font-size: 11px;
    color: #9ae6b4;
    margin-top: 8px;
}

body.dark .shortcut-hint {
    color: #68d391;
}

/* 字数统计 */
#charCounter {
    text-align: right;
    font-size: 11px;
    color: #9ae6b4;
    margin-top: 4px;
}

body.dark #charCounter {
    color: #68d391;
}

/* ========== 右侧结果面板 ========== */
.result-panel {
    width: 45%;
    display: flex;
    flex-direction: column;
    background: white;
    overflow: hidden;
    min-width: 300px;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: linear-gradient(to bottom, #f0fff4 0%, #e6fffa 100%);
    border-bottom: 1px solid #c6f6d5;
    flex-shrink: 0;
}

.result-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #276749;
}

.result-tip {
    font-size: 11px;
    color: #68d391;
    background: rgba(104, 211, 145, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
}

.result-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

/* 结果占位符 */
.result-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #9ae6b4;
    text-align: center;
}

.placeholder-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.8;
}

.placeholder-text {
    font-size: 14px;
    color: #68d391;
    margin-bottom: 20px;
}

.placeholder-tips {
    padding: 16px;
    background: #f0fff4;
    border-radius: 8px;
    font-size: 12px;
    color: #48bb78;
    line-height: 1.6;
    text-align: left;
}

.placeholder-tips p {
    margin: 0 0 8px 0;
    font-weight: 600;
    color: #38a169;
}

.placeholder-tips ul {
    margin: 0;
    padding-left: 20px;
}

.placeholder-tips li {
    margin-bottom: 4px;
}

/* 结果内容样式 */
.tips-result {
    line-height: 1.8;
    color: #2d3748;
}

.tips-result h4 {
    color: #276749;
    margin: 16px 0 8px 0;
    padding-bottom: 6px;
    border-bottom: 1px solid #c6f6d5;
}

.tips-result p {
    margin: 8px 0;
}

.tips-result ul, .tips-result ol {
    padding-left: 20px;
    margin: 8px 0;
}

.tips-result li {
    margin-bottom: 6px;
}

.tips-result strong {
    color: #38a169;
}

/* 加载动画 */
.loading-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #c6f6d5;
    border-top: 3px solid #38a169;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-text {
    margin-top: 12px;
    color: #68d391;
    font-size: 14px;
}

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

/* ========== 模态框 ========== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 100000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(2px);
}

.modal.show {
    display: flex;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-content {
    background: white;
    border-radius: 8px;
    max-width: 680px;
    width: 100%;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    animation: modalSlideIn 0.2s ease-out;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #f0fff4;
    border-bottom: 1px solid #c6f6d5;
    color: #276749;
    flex-shrink: 0;
}

.modal-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
}

.modal-close {
    background: #f5f5f5;
    border: none;
    color: #757575;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: #e8e8e8;
    color: #424242;
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

/* 示例网格 */
.example-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.example-item {
    padding: 16px;
    background: #f0fff4;
    border: 1px solid #c6f6d5;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.example-item:hover {
    border-color: #38a169;
    box-shadow: 0 2px 8px rgba(56, 161, 105, 0.12);
}

.example-icon {
    font-size: 24px;
    margin-bottom: 8px;
}

.example-title {
    font-size: 14px;
    font-weight: 600;
    color: #276749;
    margin-bottom: 4px;
}

.example-desc {
    font-size: 12px;
    color: #68d391;
}

/* ========== Toast通知 ========== */
.toast {
    position: fixed;
    top: 80px;
    right: 20px;
    min-width: 200px;
    padding: 14px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 100001;
    font-size: 14px;
    font-weight: 500;
    animation: toastSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
}

@keyframes toastSlideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.toast.success {
    background: #38a169;
    color: white;
}

.toast.error {
    background: #f44336;
    color: white;
}

.toast.info {
    background: #2196f3;
    color: white;
}

/* ========== 暗黑模式 ========== */
body.dark .health-tips-container {
    background: linear-gradient(135deg, #1a202c 0%, #171923 100%);
}

body.dark .health-toolbar {
    background: linear-gradient(135deg, #276749 0%, #22543d 100%);
}

body.dark .toolbar-btn {
    background: #2d3748;
    color: #68d391;
}

body.dark .toolbar-btn:hover:not(:disabled) {
    background: #4a5568;
}

body.dark .health-main-content {
    background: linear-gradient(135deg, #1a202c 0%, #171923 100%);
}

body.dark .health-history-panel,
body.dark .input-panel,
body.dark .result-panel {
    background: #1a202c;
    border-color: #2d3748;
}

body.dark .history-header,
body.dark .input-header,
body.dark .result-header {
    background: linear-gradient(to bottom, #2d3748 0%, #1a202c 100%);
    border-color: #2d3748;
}

body.dark .history-header h3,
body.dark .input-header h3,
body.dark .result-header h3 {
    color: #68d391;
}

body.dark .history-search input {
    background: #2d3748;
    border-color: #4a5568;
    color: #e2e8f0;
}

body.dark .history-search input::placeholder {
    color: #68d391;
}

body.dark .history-item {
    background: #2d3748;
    border-color: #4a5568;
}

body.dark .history-item:hover {
    background: #3d4a5c;
}

body.dark .history-item.active {
    background: #276749;
    border-color: #38a169;
}

body.dark .history-list {
    background: #1a202c;
}

body.dark .history-search {
    border-bottom-color: #2d3748;
}

body.dark .history-item-name {
    color: #68d391;
}

body.dark .history-item-time {
    color: #4a5568;
}

body.dark .quick-tags {
    background: #2d3748;
    border-color: #4a5568;
}

body.dark .tag-label {
    color: #68d391;
}

body.dark .quick-tag {
    background: #1a202c;
    border-color: #4a5568;
    color: #68d391;
}

body.dark .quick-tag:hover {
    background: #38a169;
    color: white;
}

body.dark .input-group label {
    color: #68d391;
}

body.dark .input-group textarea {
    background: #2d3748;
    border-color: #4a5568;
    color: #e2e8f0;
}

body.dark .input-group textarea::placeholder {
    color: #4a5568;
}

body.dark .mode-selector > label {
    color: #68d391;
}

body.dark .mode-option {
    background: #2d3748;
    border-color: #4a5568;
}

body.dark .mode-option:has(input[type="radio"]:checked) {
    background: #276749;
    border-color: #38a169;
}

body.dark .mode-label {
    color: #68d391;
}

body.dark .mode-desc {
    color: #9ae6b4;
}

body.dark .input-tip,
body.dark .result-tip {
    color: #9ae6b4;
    background: rgba(154, 230, 180, 0.1);
}

body.dark .result-content {
    color: #e2e8f0;
}

body.dark .result-placeholder {
    color: #4a5568;
}

body.dark .placeholder-text {
    color: #68d391;
}

body.dark .placeholder-tips {
    background: #2d3748;
    color: #9ae6b4;
}

body.dark .placeholder-tips p {
    color: #68d391;
}

body.dark .tips-result {
    color: #e2e8f0;
}

body.dark .tips-result h4 {
    color: #68d391;
    border-bottom-color: #4a5568;
}

body.dark .tips-result strong {
    color: #9ae6b4;
}

body.dark .modal-content {
    background: #1a202c;
}

body.dark .modal-header {
    background: #2d3748;
    border-color: #4a5568;
    color: #68d391;
}

body.dark .modal-body {
    background: #1a202c;
}

body.dark .example-item {
    background: #2d3748;
    border-color: #4a5568;
}

body.dark .example-item:hover {
    border-color: #38a169;
}

body.dark .example-title {
    color: #68d391;
}

body.dark .example-desc {
    color: #9ae6b4;
}

body.dark .loading-spinner {
    border-color: #4a5568;
    border-top-color: #38a169;
}

body.dark .loading-text {
    color: #68d391;
}

body.dark .history-item-delete {
    background: #4a5568;
    color: #fc8181;
}

body.dark .history-item-delete:hover {
    background: #ef4444;
    color: white;
}

body.dark .history-clear-btn {
    background: #4a1d1d;
    color: #fc8181;
}

body.dark .history-clear-btn:hover {
    background: #7f1d1d;
}

body.dark .modal-close {
    background: #4a5568;
    color: #9ae6b4;
}

body.dark .modal-close:hover {
    background: #2d3748;
    color: #68d391;
}

/* ========== 搜索高亮 ========== */
.search-highlight {
    background: #fef08a;
    color: #854d0e;
    padding: 0 2px;
    border-radius: 2px;
}

body.dark .search-highlight {
    background: #854d0e;
    color: #fef08a;
}

/* ========== 快捷键弹窗 ========== */
.modal-sm {
    max-width: 360px;
}

.shortcuts-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.shortcut-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: #f0fff4;
    border-radius: 6px;
}

.shortcut-item kbd {
    display: inline-block;
    padding: 4px 8px;
    background: white;
    border: 1px solid #c6f6d5;
    border-radius: 4px;
    font-family: monospace;
    font-size: 12px;
    color: #276749;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.shortcut-item span {
    color: #68d391;
    font-size: 13px;
}

body.dark .shortcut-item {
    background: #2d3748;
}

body.dark .shortcut-item kbd {
    background: #1a202c;
    border-color: #4a5568;
    color: #68d391;
}

body.dark .shortcut-item span {
    color: #9ae6b4;
}

/* ========== 响应式设计 ========== */
@media (max-width: 1200px) {
    .health-history-panel {
        width: 180px;
    }
    .result-panel {
        width: 40%;
    }
}

@media (max-width: 768px) {
    .health-toolbar {
        padding: 8px;
    }
    .toolbar-btn {
        padding: 5px 10px;
        font-size: 12px;
    }
    .health-main-content {
        flex-direction: column;
    }
    .health-history-panel,
    .input-panel,
    .result-panel {
        width: 100% !important;
        border: none;
    }
    .health-history-panel {
        max-height: 150px;
        border-bottom: 1px solid #c6f6d5;
    }
    .result-panel {
        min-height: 250px;
        border-top: 1px solid #c6f6d5;
    }
    .mode-options {
        flex-direction: column;
    }
}

/* ========== 滚动条美化 ========== */
.history-list::-webkit-scrollbar,
.input-content::-webkit-scrollbar,
.result-content::-webkit-scrollbar,
.modal-body::-webkit-scrollbar {
    width: 6px;
}

.history-list::-webkit-scrollbar-track,
.input-content::-webkit-scrollbar-track,
.result-content::-webkit-scrollbar-track,
.modal-body::-webkit-scrollbar-track {
    background: #f0fff4;
    border-radius: 3px;
}

.history-list::-webkit-scrollbar-thumb,
.input-content::-webkit-scrollbar-thumb,
.result-content::-webkit-scrollbar-thumb,
.modal-body::-webkit-scrollbar-thumb {
    background: #9ae6b4;
    border-radius: 3px;
}

.history-list::-webkit-scrollbar-thumb:hover,
.input-content::-webkit-scrollbar-thumb:hover,
.result-content::-webkit-scrollbar-thumb:hover,
.modal-body::-webkit-scrollbar-thumb:hover {
    background: #68d391;
}

body.dark .history-list::-webkit-scrollbar-track,
body.dark .input-content::-webkit-scrollbar-track,
body.dark .result-content::-webkit-scrollbar-track,
body.dark .modal-body::-webkit-scrollbar-track {
    background: #2d3748;
}

body.dark .history-list::-webkit-scrollbar-thumb,
body.dark .input-content::-webkit-scrollbar-thumb,
body.dark .result-content::-webkit-scrollbar-thumb,
body.dark .modal-body::-webkit-scrollbar-thumb {
    background: #4a5568;
}

body.dark .history-list::-webkit-scrollbar-thumb:hover,
body.dark .input-content::-webkit-scrollbar-thumb:hover,
body.dark .result-content::-webkit-scrollbar-thumb:hover,
body.dark .modal-body::-webkit-scrollbar-thumb:hover {
    background: #68d391;
}
