/* 基本样式 */
body {
    font-family: 'PingFang SC', 'Helvetica Neue', Arial, sans-serif;
    background-color: #f6f6f6;
    margin: 0;
    padding: 0;
    color: #333;
}

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

/* 标题样式 */
.title {
    text-align: center;
    margin-bottom: 30px;
}

.title h1 {
    font-size: 28px;
    margin-bottom: 5px;
    color: #333;
}

.subtitle {
    font-size: 16px;
    color: #666;
}

/* 天平样式 */
.scale-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 30px;
}

.scale {
    position: relative;
    height: 200px;
    width: 300px;
    margin-bottom: 20px;
}

/* 添加杆子和底座的连接装饰 */
.scale::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 39px;
    width: 16px;
    height: 4px;
    background-color: #7d5cf5;
    border-radius: 2px;
    transform: translateX(-50%);
}

.scale-beam {
    position: absolute;
    top: 30px;
    width: 100%;
    height: 10px;
    background-color: #7d5cf5;
    border-radius: 5px;
    display: flex;
    justify-content: space-between;
    transform-origin: center;
    transition: transform 0.5s ease;
}

.scale-left, .scale-right {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background-color: #f5f5f5;
    border: 3px solid #7d5cf5;
    position: absolute;
    top: -30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    padding: 2px;
}

.scale-left {
    left: -30px;
    color: #4a4af4;
}

.scale-right {
    right: -30px;
    color: #f44a6c;
}

.scale-center {
    position: absolute;
    width: 20px;
    height: 20px;
    background-color: #7d5cf5;
    border-radius: 50%;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
}

/* 添加判官小猫 */
.judge-cat {
    position: absolute;
    width: 70px;
    height: 70px;
    top: -15px;
    left: calc(50% - 3px);
    transform: translateX(-50%);
    z-index: 10;
    animation: float 3s ease-in-out infinite;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.2));
}

/* 猫咪浮动动画 */
@keyframes float {
    0%, 100% {
        transform: translateX(-50%) translateY(0px);
    }
    50% {
        transform: translateX(-50%) translateY(-5px);
    }
}

.scale-stand {
    position: absolute;
    top: 40px;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 120px;
    background-color: #7d5cf5;
}

.scale-base {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 20px;
    background-color: #7d5cf5;
    border-radius: 10px;
}

/* 状态文本 */
.status-text {
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 10px;
}

.status-boy {
    color: #4a4af4;
}

.status-girl {
    color: #f44a6c;
}

.status-neutral {
    color: #333;
}

/* AI评论样式 */
.ai-comment-container {
    background-color: #f0f0f0;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
    max-width: 90%;
}

.ai-comment {
    display: flex;
    align-items: flex-start;
}

.ai-icon {
    font-size: 24px;
    margin-right: 10px;
}

.ai-text {
    font-size: 16px;
    line-height: 1.5;
}

/* 输入区域样式 */
.input-container {
    margin-bottom: 30px;
    border: 1px solid #ddd;
    border-radius: 12px;
    background-color: #fff;
    padding: 15px;
}

.role-switch {
    display: flex;
    justify-content: space-around;
    margin-bottom: 15px;
}

.role {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 20px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
}

.role-icon {
    font-size: 24px;
    margin-bottom: 5px;
}

.active-boy {
    background-color: rgba(74, 74, 244, 0.1);
    color: #4a4af4;
}

.active-girl {
    background-color: rgba(244, 74, 108, 0.1);
    color: #f44a6c;
}

.input-area {
    padding: 10px;
}

textarea {
    width: 100%;
    min-height: 100px;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 10px;
    margin-bottom: 15px;
    resize: vertical;
    font-size: 16px;
}

.buttons-row {
    display: flex;
    justify-content: space-between;
}

.submit-btn, .agree-btn, .reset-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 10px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s;
}

.submit-btn {
    background-color: #7d5cf5;
    flex: 1;
    margin-right: 10px;
}

.submit-btn:hover {
    background-color: #6b4ed6;
}

.submit-btn:disabled {
    background-color: #c3b7f7;
    cursor: not-allowed;
}

.agree-btn {
    background-color: #4cc25c;
    flex: 1;
}

.agree-btn:hover {
    background-color: #3ca24a;
}

/* 历史记录样式 */
.history-container {
    margin-bottom: 30px;
    border: 1px solid #ddd;
    border-radius: 12px;
    overflow: hidden;
    background-color: #fff;
}

.history-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.history-list {
    max-height: 300px;
    overflow-y: auto;
}

.history-item {
    padding: 12px;
    margin-bottom: 10px;
    border-radius: 10px;
    position: relative;
}

.boy-item {
    background-color: rgba(74, 74, 244, 0.1);
}

.girl-item {
    background-color: rgba(244, 74, 108, 0.1);
}

.history-role {
    display: flex;
    align-items: center;
    font-weight: bold;
    margin-bottom: 5px;
}

.history-role-icon {
    margin-right: 5px;
    font-size: 18px;
}

.history-content {
    margin-bottom: 5px;
    line-height: 1.5;
}

.history-time {
    font-size: 12px;
    color: #999;
    text-align: right;
}

/* 操作按钮区域 */
.action-buttons {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.reset-btn {
    background-color: #f77260;
    padding: 10px 30px;
}

.reset-btn:hover {
    background-color: #e5594a;
}

/* 签名模态框样式 */
.signature-pad-container {
    border: 1px solid #ddd;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 15px;
}

.signature-tools {
    display: flex;
    justify-content: flex-end;
}

/* 结果画布容器 */
.result-canvas-container {
    width: 100%;
    max-width: 100%;
    text-align: center;
    padding: 0;
    margin: 0;
    overflow: hidden;
}

.result-image {
    width: 100%;
    height: auto;
    max-width: 100%;
    object-fit: contain;
}

/* 调整结果模态框大小 */
#result-modal .modal-dialog {
    max-width: 95%;
    width: auto;
    margin: 10px auto;
}

#result-modal .modal-body {
    padding: 0;
}

/* 确保在移动设备上图像显示最大化 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .scale {
        width: 250px;
    }
    
    /* 调整移动端天平连接件的位置 */
    .scale::after {
        bottom: 39px;
    }
    
    /* 确保小猫在移动端的位置正确 */
    .judge-cat {
        width: 60px;
        height: 60px;
        top: -12px;
        left: calc(50% - 3px);
    }
    
    .buttons-row {
        flex-direction: column;
    }
    
    .submit-btn, .agree-btn {
        margin: 5px 0;
    }
    
    #result-modal .modal-dialog {
        max-width: 98%;
        margin: 5px auto;
    }
    
    .result-image {
        width: 100%;
        height: auto;
    }
    
    /* 取消模态框内容周围的内边距，让图像最大化 */
    #result-modal .modal-content {
        padding: 0;
    }
    
    #result-modal .modal-header {
        padding: 10px;
    }
    
    #result-modal .modal-footer {
        padding: 10px;
    }
}

/* 版权信息 */
.copyright-text {
    text-align: left;
    font-size: 12px;
    color: #999;
    margin-top: 30px;
    margin-bottom: 20px;
    line-height: 1.5;
}

/* 小红书联系信息 */
.feedback-text {
    text-align: left;
    font-size: 12px;
    color: #999;
    margin-top: 30px;
    margin-bottom: 10px;
    font-weight: normal;
}

/* 底部链接样式 */
.footer-links {
    margin-top: 10px;
    font-size: 14px;
    text-align: left;
}

.footer-links a {
    color: #7d5cf5;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: #6b4ed6;
    text-decoration: underline;
}

@media (max-width: 768px) {
    .footer-links {
        font-size: 12px;
    }
}

/* 加载动画 */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    margin-right: 10px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 天平分数样式 */
.scale-score {
    font-size: 12px;
    display: block;
    text-align: center;
    margin-top: 2px;
    font-weight: bold;
}

.scale-left .scale-score {
    color: #4a4af4;
}

.scale-right .scale-score {
    color: #f44a6c;
}

/* 调整男女方文字大小 */
.scale-left span:first-child, 
.scale-right span:first-child {
    font-size: 14px;
}

/* AI评价在历史记录中的样式 */
.ai-item {
    background-color: rgba(106, 13, 173, 0.1);
    border-left: 4px solid #6a0dad;
}

.history-reason, .history-suggestion {
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 8px;
    padding: 5px 10px;
    border-radius: 8px;
}

.history-reason {
    background-color: rgba(125, 92, 245, 0.1);
    color: #555;
    margin-top: 8px;
}

.history-suggestion {
    background-color: rgba(76, 194, 92, 0.1);
    color: #555;
    margin-top: 2px;
}

.history-score {
    font-size: 14px;
    margin-top: 5px;
    font-weight: bold;
    padding: 3px 8px;
    border-radius: 10px;
    display: inline-block;
    margin-left: 30px;
}

.score-boy {
    background-color: rgba(74, 74, 244, 0.2);
    color: #4a4af4;
}

.score-girl {
    background-color: rgba(244, 74, 108, 0.2);
    color: #f44a6c;
}

.score-neutral {
    background-color: rgba(102, 102, 102, 0.2);
    color: #666;
}

/* 保存提示样式 */
.save-hints {
    background-color: rgba(125, 92, 245, 0.1);
    border-radius: 10px;
    padding: 10px 15px;
    margin-top: 15px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
    font-family: 'PingFang SC', 'Helvetica Neue', Arial, sans-serif;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.save-hints p {
    margin: 5px 0;
    font-size: 14px;
    color: #555;
    text-align: left;
    line-height: 1.4;
}

@media (max-width: 768px) {
    .save-hints {
        width: 92%;
        padding: 8px 12px;
        font-size: 13px;
    }
}