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

html, body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f7fa;
    color: #1f2937;
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 20px;
}

.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 20px;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.header-content {
    max-width: 720px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.back-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

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

.logo {
    font-size: 18px;
    font-weight: bold;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 14px;
}

.user-name {
    font-size: 14px;
}

.login-btn {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    color: white;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.login-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.main-content {
    padding: 80px 20px 100px;
    max-width: 720px;
    margin: 0 auto;
}

.card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: all 0.2s ease;
}

.card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 4px;
}

.card-desc {
    font-size: 14px;
    color: #6b7280;
}

.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    opacity: 0.9;
    transform: scale(1.02);
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-outline {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-outline:hover {
    background: #f5f5ff;
}

.btn-link {
    background: none;
    color: #667eea;
    text-decoration: underline;
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.2s ease;
    outline: none;
}

.form-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-input.valid {
    border-color: #10b981;
}

.form-input.invalid {
    border-color: #ef4444;
}

.form-select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 15px;
    background: white;
    cursor: pointer;
    outline: none;
}

.form-select:focus {
    border-color: #667eea;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.form-group {
    margin-bottom: 16px;
}

.banner {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 24px;
    color: white;
    margin-bottom: 20px;
}

.banner-title {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 8px;
}

.banner-desc {
    font-size: 14px;
    opacity: 0.9;
}

.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid #e5e7eb;
    padding: 12px 20px;
    z-index: 1000;
}

.footer-content {
    max-width: 720px;
    margin: 0 auto;
    display: flex;
    justify-content: space-around;
}

.footer-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    color: #6b7280;
    transition: color 0.2s ease;
    min-width: 80px;
}

.footer-item.active {
    color: #667eea;
}

.footer-item:hover {
    color: #667eea;
}

.footer-icon {
    font-size: 20px;
}

.footer-label {
    font-size: 12px;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 20px;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 400px;
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    position: relative;
}

.modal-overlay.show .modal {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f3f4f6;
    border: none;
    color: #6b7280;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: #e5e7eb;
}

.modal-header {
    padding: 24px;
    text-align: center;
}

.modal-title {
    font-size: 18px;
    font-weight: bold;
    color: #1f2937;
    margin-bottom: 8px;
}

.modal-desc {
    font-size: 14px;
    color: #6b7280;
}

.modal-body {
    padding: 0 24px 24px;
}

.toast {
    position: fixed;
    bottom: 120px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #1f2937;
    color: white;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 10001;
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    max-width: 90%;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.toast-error {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.toast-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.upload-area {
    border: 2px dashed #d1d5db;
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fafafa;
}

.upload-area:hover {
    border-color: #667eea;
    background: #f5f5ff;
}

.upload-area.dragover {
    border-color: #667eea;
    background: #eef2ff;
    border-style: solid;
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 12px;
    color: #9ca3af;
}

.upload-text {
    font-size: 16px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.upload-hint {
    font-size: 14px;
    color: #9ca3af;
}

.image-input {
    display: none;
}

.preview-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 16px;
}

.preview-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
}

.preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-item .delete-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #ef4444;
    border: none;
    color: white;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    margin: 16px 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 14px;
    color: #6b7280;
    text-align: center;
}

.identity-options {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.identity-option {
    flex: 1;
    padding: 16px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.identity-option:hover {
    border-color: #667eea;
    background: #f5f5ff;
}

.identity-option.selected {
    border-color: #667eea;
    background: linear-gradient(135deg, #f5f5ff 0%, #ede9fe 100%);
}

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

.identity-label {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}

.intro-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    z-index: 10002;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    color: white;
}

.intro-modal .intro-icon {
    font-size: 72px;
    margin-bottom: 24px;
}

.intro-modal .intro-title {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 12px;
}

.intro-modal .intro-desc {
    font-size: 16px;
    opacity: 0.9;
    margin-bottom: 32px;
}

.intro-modal .close-btn {
    width: 100%;
    padding: 14px;
    background: white;
    color: #667eea;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}

.celebration-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 9998;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    animation: confetti-fall 3s linear forwards;
    top: -10px;
}

@keyframes confetti-fall {
    0% {
        transform: translateY(-10px) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

.zoom-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10002;
    cursor: zoom-out;
}

.zoom-overlay img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 8px;
}

.question-item {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e5e7eb;
}

.question-item:last-child {
    border-bottom: none;
}

.question-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #1f2937;
}

.question-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.option-item {
    padding: 14px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 12px;
}

.option-item:hover {
    border-color: #667eea;
    background: #f5f5ff;
}

.option-item.selected {
    border-color: #667eea;
    background: linear-gradient(135deg, #f5f5ff 0%, #ede9fe 100%);
}

.option-label {
    flex: 1;
    font-size: 15px;
    color: #374151;
}

.option-check {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #d1d5db;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.option-item.selected .option-check {
    background: #667eea;
    border-color: #667eea;
}

.option-check::after {
    content: '✓';
    color: white;
    font-size: 12px;
    opacity: 0;
}

.option-item.selected .option-check::after {
    opacity: 1;
}

.chat-container {
    display: flex;
    flex-direction: column;
    height: 400px;
    background: #f9fafb;
    border-radius: 12px;
    overflow: hidden;
}

.chat-messages {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-message {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 16px;
    animation: message-appear 0.3s ease;
}

@keyframes message-appear {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-message.user {
    align-self: flex-end;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 16px 16px 4px 16px;
}

.chat-message.bot {
    align-self: flex-start;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 16px 16px 16px 4px;
}

.chat-input-area {
    padding: 12px;
    background: white;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 12px;
}

.chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 24px;
    font-size: 15px;
    outline: none;
}

.chat-input:focus {
    border-color: #667eea;
}

.chat-send-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-send-btn:hover {
    opacity: 0.9;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: white;
    border-radius: 12px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.history-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.history-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.history-info {
    flex: 1;
}

.history-title {
    font-size: 15px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 4px;
}

.history-date {
    font-size: 13px;
    color: #9ca3af;
}

.history-score {
    font-size: 18px;
    font-weight: bold;
    color: #667eea;
}

.achievement-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: white;
    border-radius: 10px;
    margin-bottom: 8px;
}

.achievement-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.achievement-info {
    flex: 1;
}

.achievement-name {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
}

.achievement-desc {
    font-size: 12px;
    color: #9ca3af;
}

.report-score {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.score-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
}

.score-value {
    font-size: 28px;
    font-weight: bold;
}

.score-label {
    font-size: 12px;
    opacity: 0.9;
}

.score-details {
    flex: 1;
}

.score-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 8px;
}

.score-desc {
    font-size: 14px;
    color: #6b7280;
}

.report-section {
    margin-bottom: 24px;
}

.report-section-title {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 12px;
    color: #1f2937;
}

.report-content {
    font-size: 15px;
    color: #4b5563;
    line-height: 1.6;
}

.trait-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.trait-tag {
    padding: 6px 12px;
    background: #eef2ff;
    color: #667eea;
    border-radius: 16px;
    font-size: 13px;
}

.recommendation-list {
    list-style: none;
    padding: 0;
}

.recommendation-list li {
    padding: 12px 0;
    padding-left: 24px;
    position: relative;
    border-bottom: 1px solid #f3f4f6;
    font-size: 14px;
    color: #374151;
}

.recommendation-list li:last-child {
    border-bottom: none;
}

.recommendation-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #dcfce7;
    color: #16a34a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.complete-success {
    text-align: center;
    padding: 40px 20px;
}

.complete-icon {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    animation: success-bounce 0.5s ease;
}

@keyframes success-bounce {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.complete-icon svg {
    width: 50px;
    height: 50px;
    fill: white;
}

.complete-title {
    font-size: 24px;
    font-weight: bold;
    color: #1f2937;
    margin-bottom: 8px;
}

.complete-desc {
    font-size: 15px;
    color: #6b7280;
    margin-bottom: 24px;
}

.complete-score {
    display: inline-block;
    padding: 8px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 20px;
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 24px;
}

.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    background: white;
    border: 2px solid #667eea;
    border-radius: 20px;
    color: #667eea;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    margin: 0 auto 16px;
    transition: all 0.2s ease;
}

.share-btn:hover {
    background: #f5f5ff;
}

@media (max-width: 480px) {
    .btn {
        min-height: 44px;
        padding: 14px 20px;
    }
    
    .form-input, .form-select {
        padding: 14px 16px;
    }
    
    .card {
        padding: 16px;
    }
    
    .upload-area {
        padding: 30px 16px;
    }
}
