:root {
    --primary-color: #4CAF50;
    --secondary-color: #2196F3;
    --accent-color: #FF9800;
    --danger-color: #f44336;
    --text-dark: #333;
    --text-light: #666;
    --bg-light: #f5f5f5;
    --bg-white: #ffffff;
    --border-color: #ddd;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --shadow-hover: 0 4px 20px rgba(0,0,0,0.15);
}

.hmxsrq {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB',
                 'Microsoft YaHei', sans-serif;
    color: var(--text-dark);
    background: var(--bg-light);
    line-height: 1.6;
    margin: 0;
    padding: 0;
    border-radius: 12px;
}

.app-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem;
}

.tabs-container {
    background: var(--bg-white);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 1.5rem;
}

.tabs {
    display: flex;
    padding: 0;
    margin: 0;
    gap: 0;
    border-bottom: 1px solid #e8e8e8;
}

.tab-button {
    flex: 1;
    background: transparent;
    border: none;
    padding: 1.2rem 2rem;
    font-size: 1.05rem;
    font-weight: 400;
    color: #999;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    border-bottom: 2px solid transparent;
    letter-spacing: 0.5px;
}

.tab-button::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #ff6b6b, #ee5a6f);
    transition: width 0.3s ease;
}

.tab-button:hover {
    color: #666;
    background: rgba(255, 107, 107, 0.05);
}

.tab-button.active {
    color: #ff6b6b;
    font-weight: 500;
}

.tab-button.active::after {
    width: 50px;
}

.mainhm-content {
    margin: 0;
    padding: 0;
}

.page {
    display: none;
    animation: fadeIn 0.5s;
}

.page.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero {
    text-align: center;
}

.intro-card {
    background: var(--bg-white);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 2rem;
    text-align: left;
    border-left: 4px solid #ff6b6b;
}

.intro-text {
    flex: 1;
}

.intro-image {
    flex-basis: 200px;
    flex-shrink: 0;
}

.intro-image img {
    max-width: 100%;
    border-radius: 12px;
    border: 4px solid #fff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.intro-image img:hover {
    transform: scale(1.05) rotate(2deg);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.intro-card h3 {
    color: #ff6b6b;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.intro-card ul {
    margin: 1rem 0;
    padding-left: 2rem;
}

.intro-card li {
    margin: 0.5rem 0;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.feature-card {
    background: var(--bg-white);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(255, 107, 107, 0.15);
    border-color: rgba(255, 107, 107, 0.3);
}

.feature-card .icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    filter: grayscale(0.3);
    transition: filter 0.3s;
}

.feature-card:hover .icon {
    filter: grayscale(0);
}

.feature-card h3 {
    color: #ff6b6b;
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.test-container {
    background: var(--bg-white);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.test-container h2 {
    color: #ff6b6b;
    margin-bottom: 1rem;
    font-size: 1.8rem;
}

.test-description {
    color: var(--text-light);
    margin-bottom: 2rem;
}

.test-progress {
    margin-bottom: 2rem;
}

.test-progress p {
    text-align: center;
    color: var(--text-dark);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.progress-bar {
    width: 100%;
    height: 10px;
    background: var(--bg-light);
    border-radius: 5px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff6b6b, #ee5a6f);
    transition: width 0.3s ease;
    border-radius: 5px;
}

.test-navigation {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
}

.questions-container {
    margin-bottom: 2rem;
}

.question-item {
    background: var(--bg-light);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.question-item h4 {
    color: var(--text-dark);
    margin-bottom: 1rem;
}

.options {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.option-label {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: var(--bg-white);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.option-label:hover {
    border-color: #ff6b6b;
    background: rgba(255, 107, 107, 0.05);
}

.option-label:hover span::before {
    border-color: #ff6b6b;
}

.option-label input[type="radio"] {
    display: none;
}

.option-label span {
    position: relative;
    padding-left: 2rem;
    cursor: pointer;
}

.option-label span::before {
    content: '';
    position: absolute;
    left: 1px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    background: var(--bg-white);
    transition: all 0.3s;
}

.option-label span::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 50%;
    transform: translateY(-50%) scale(0);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ff6b6b;
    transition: transform 0.3s ease;
}

.option-label input[type="radio"]:checked + span::before {
    border-color: #ff6b6b;
}

.option-label input[type="radio"]:checked + span::after {
    transform: translateY(-50%) scale(1);
}

.option-label input[type="radio"]:checked + span {
    font-weight: 600;
    color: #ff6b6b;
}

.btn {
    padding: 0.8rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, #ff6b6b, #ee5a6f);
    color: white;
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #ee5a6f, #ff6b6b);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

.btn-secondary {
    background: var(--bg-light);
    color: var(--text-dark);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    background: #e0e0e0;
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn:disabled,
.btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
    background: #ccc;
    color: #888;
    border-color: #ccc;
}

.btn:disabled:hover,
.btn[disabled]:hover {
    transform: none;
    box-shadow: none;
    background: #ccc;
}

.result-container {
    background: var(--bg-light);
    padding: 2rem;
    border-radius: 12px;
    margin-top: 2rem;
}

.result-stage {
    text-align: center;
    margin-bottom: 2rem;
}

.result-stage h3 {
    font-size: 2rem;
    color: #ff6b6b;
    margin-bottom: 1rem;
}

.result-stage .badge {
    display: inline-block;
    padding: 0.5rem 1.5rem;
    background: linear-gradient(135deg, #ff6b6b, #ee5a6f);
    color: white;
    border-radius: 20px;
    font-weight: 600;
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
}

.result-description,
.result-suggestions {
    background: var(--bg-white);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.result-description h4,
.result-suggestions h4 {
    color: #ff6b6b;
    margin-bottom: 1rem;
}

.result-suggestions ul {
    padding-left: 2rem;
}

.result-suggestions li {
    margin: 0.5rem 0;
}

.retake-container {
    text-align: center;
    margin-top: 1.5rem;
}

#ego-chart {
    max-width: 400px;
    margin: 2rem auto;
}

#ego-analysis {
    margin-top: 2rem;
}

.ego-analysis-item {
    background: var(--bg-white);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.ego-analysis-item h4 {
    color: #ff6b6b;
    margin-bottom: 0.5rem;
}

.ego-score {
    font-size: 2rem;
    font-weight: 600;
    color: var(--accent-color);
    margin: 0.5rem 0;
}

.emergency-container {
    background: var(--bg-white);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.emergency-container h2 {
    color: #ff6b6b;
    margin-bottom: 1rem;
    font-size: 1.8rem;
}

.emergency-intro {
    color: var(--text-light);
    margin-bottom: 2rem;
    text-align: center;
}

.emotion-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.emotion-btn {
    padding: 1.5rem;
    font-size: 1.2rem;
    background: var(--bg-light);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
}

.emotion-btn:hover {
    border-color: var(--primary-color);
    background: #f0f8f0;
    transform: translateY(-3px);
}

.emergency-guide {
    background: var(--bg-light);
    padding: 2rem;
    border-radius: 12px;
    margin-top: 2rem;
}

.emergency-guide h3 {
    color: #ff6b6b;
    margin-bottom: 1rem;
}

.technique {
    background: var(--bg-white);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.technique h4 {
    color: var(--secondary-color);
    margin-bottom: 0.8rem;
}

.technique ol,
.technique ul {
    padding-left: 2rem;
}

.technique li {
    margin: 0.5rem 0;
}

.footer {
    background: transparent;
    padding: 1rem 0;
    text-align: center;
    margin-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.footer p {
    color: var(--text-light);
    font-size: 0.9rem;
    margin: 0.3rem 0;
}

@media (max-width: 768px) {
    .app-container {
        padding: 7px;
    }
    .intro-card {
    padding: 15px;
    }
    .feature-card {
    padding: 1rem;
    }
    .test-container {
    padding: 15px;
    }
    .theory-box {
    padding: 1rem;
    }
    .result-container {
    padding: 10px;
    }
    #ego-chart {
    max-width: 300px;
     }
    .exploration-container {
    padding: 11px;
    }
    .message-content {
    padding: 8px;
    }
    .conversation-area {
    padding: 10px;
    }
    .emergency-container {
    padding: 13px;
    }
    .emergency-guide {
    padding: 12px;
    }
    .tabs {
        display: flex;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .tabs::-webkit-scrollbar {
        display: none;
    }

    .tab-button {
        flex: 0 0 auto;
        font-size: 0.95rem;
        padding: 0.8rem 1rem;
    }

    .tab-button.active::after {
        width: 40px;
    }

    .tabs-container {
        margin-bottom: 1rem;
        border-radius: 8px;
    }

    .feature-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .emotion-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-light);
}

.empty-state .icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.exploration-container {
    background: var(--bg-white);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.exploration-container h2 {
    color: #ff6b6b;
    margin-bottom: 1rem;
    font-size: 1.8rem;
}

.exploration-intro {
    color: var(--text-light);
    margin-bottom: 2rem;
    text-align: center;
}

.topic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.topic-card {
    background: var(--bg-white);
    border: 2px solid var(--border-color);
    border-left: 4px solid #ff6b6b;
    border-radius: 12px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.topic-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(255, 107, 107, 0.15);
    border-color: rgba(255, 107, 107, 0.3);
}

.topic-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.topic-card h3 {
    color: #333;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.topic-card p {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.topic-meta {
    font-size: 0.85rem;
    color: #ff6b6b;
    font-weight: 500;
}

.exploration-dialog {
    background: var(--bg-white);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 2rem;
}

.dialog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 2px solid var(--border-color);
}

.dialog-header h3 {
    color: #ff6b6b;
    margin: 0;
    font-size: 1.3rem;
}

.btn-close {
    background: transparent;
    border: none;
    font-size: 2rem;
    color: var(--text-light);
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s;
}

.btn-close:hover {
    background: rgba(255, 107, 107, 0.1);
    color: #ff6b6b;
}

.dialog-content {
    padding: 1.5rem;
}

.conversation-area {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--bg-light);
    border-radius: 8px;
}

.message {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    animation: fadeIn 0.5s;
}

.message-avatar {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff6b6b, #ee5a6f);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.doctor-message .message-avatar {
    background: linear-gradient(135deg, #4A90E2, #5fa3e8);
}

.message-content {
    flex: 1;
    background: var(--bg-white);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.doctor-message .message-content {
    border-left: 3px solid #4A90E2;
}

.user-message {
    flex-direction: row-reverse;
}

.user-message .message-content {
    border-left: 3px solid #ff6b6b;
}

.message-question {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
}

.message-prompt {
    color: var(--text-light);
    font-style: italic;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.message-hints {
    background: rgba(74, 144, 226, 0.05);
    padding: 0.8rem;
    border-radius: 8px;
    margin-top: 0.8rem;
}

.message-hints p {
    margin: 0.5rem 0;
    font-size: 0.9rem;
    color: #666;
}

.message-text {
    color: #333;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.message-time {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 0.5rem;
    text-align: right;
}

.system-message {
    justify-content: center;
}

.system-message .message-content {
    background: rgba(76, 175, 80, 0.1);
    border-left: 3px solid #4CAF50;
    text-align: center;
    color: #2e7d32;
    font-size: 0.95rem;
}

.input-area {
    margin-top: 1.5rem;
}

.user-textarea {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    min-height: 100px;
    transition: border-color 0.3s;
}

.user-textarea:focus {
    outline: none;
    border-color: #ff6b6b;
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.1);
}

.dialog-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.dialog-actions .btn {
    flex: 1;
}

.exploration-history {
    background: var(--bg-white);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.exploration-history h3 {
    color: #ff6b6b;
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.history-item {
    background: var(--bg-light);
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid #ff6b6b;
    transition: all 0.3s;
}

.history-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
}

.history-topic {
    font-weight: 600;
    color: #ff6b6b;
    font-size: 1rem;
}

.history-delete {
    background: transparent;
    border: 1px solid #ddd;
    padding: 0.3rem 0.8rem;
    border-radius: 4px;
    font-size: 0.85rem;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.3s;
}

.history-delete:hover {
    background: #ff6b6b;
    color: white;
    border-color: #ff6b6b;
}

.history-question {
    font-weight: 500;
    color: #333;
    margin-bottom: 0.5rem;
}

.history-reflection {
    color: var(--text-dark);
    line-height: 1.6;
    margin-bottom: 0.5rem;
    background: var(--bg-white);
    padding: 1rem;
    border-radius: 6px;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.history-time {
    font-size: 0.85rem;
    color: var(--text-light);
    text-align: right;
}

.empty-history {
    text-align: center;
    color: var(--text-light);
    padding: 2rem;
    font-style: italic;
}

@media (max-width: 768px) {
    .intro-card {
        display: block;
        overflow: auto;
    }

    .intro-image {
        float: right;
        margin-left: 1rem;
        margin-bottom: 0.5rem;
    }

    .message-avatar {
        align-self: flex-start;
    }

    .user-message .message-avatar {
        align-self: flex-end;
    }

    .dialog-actions {
        flex-direction: column;
    }

    .dialog-actions .btn {
        width: 100%;
    }
}

.category-group {
    margin-bottom: 2rem;
}

.category-group h4 {
    color: var(--secondary-color);
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--secondary-color);
    margin-bottom: 1rem;
}

.technique h5 {
    color: var(--text-dark);
    font-weight: 600;
    margin-bottom: 0.8rem;
}

.reminder-box {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
}

.theory-box {
    background: rgba(74, 144, 226, 0.05);
    border-left: 4px solid #4A90E2;
    padding: 1.5rem;
    margin: 2rem 0;
    border-radius: 8px;
}

.theory-box h4 {
    color: #4A90E2;
    margin-bottom: 1rem;
}

.theory-box p {
    color: var(--text-dark);
    margin-bottom: 1rem;
}

.theory-box ul {
    padding-left: 2rem;
    margin-bottom: 1rem;
}

.theory-box li {
    margin-bottom: 0.5rem;
}

@media screen and (max-width:480px) {
  .exploration-container {
  padding:9px;
}
.dialog-content {
  padding:9px;
}
.conversation-area {
  padding:9px;
}
}