/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    line-height: 1.0;
}

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

/* 卡片样式 */
.feedback-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px;
    text-align: center;
}

.card-header h1 {
    font-size: 2rem;
    margin-bottom: 10px;
    font-weight: 600;
}

.card-header p {
    opacity: 0.9;
    font-size: 1rem;
}

/* 表单样式 */
.feedback-form {
    padding: 30px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
}

.required {
    color: #e74c3c;
}

/* 输入框样式 */
input[type="text"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #fafbfc;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

textarea {
    min-height: 180px;
    resize: vertical;
    font-family: inherit;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-bottom: none;
}

/* 文本框容器样式 */
.textarea-container {
    position: relative;
}

.textarea-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fafbfc;
    border: 2px solid #e1e8ed;
    border-top: none;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    padding: 8px 12px;
    transition: all 0.3s ease;
    margin-top: -10px;
}

.textarea-container:focus-within .textarea-toolbar {
    border-color: #667eea;
    background: white;
}

.toolbar-left {
    display: flex;
    gap: 8px;
    position: relative; /* 作为表情选择器的定位容器 */
}

.toolbar-btn {
    background: none;
    border: none;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
}

.toolbar-btn:hover {
    background: #e9ecef;
    transform: scale(1.05);
}

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

.emoji-btn:hover {
    background: #fff3cd;
}

.image-btn:hover {
    background: #d1ecf1;
}

.char-count {
    font-size: 0.85rem;
    color: #666;
}

/* 表情选择器样式 */
.emoji-picker {
    position: absolute;
    top: auto;            
    bottom: 44px;         
    left: 0;
    background: white;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    max-width: 320px;
    margin-top: 0;
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 2px;
    padding: 10px;
    max-height: 200px;
    overflow-y: auto;
}

.emoji-item {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    cursor: pointer;
    border-radius: 4px;
    font-size: 1.2rem;
    transition: all 0.2s ease;
}

.emoji-item:hover {
    background: #f8f9fa;
    transform: scale(1.2);
}

/* 上传区域样式 */
.upload-area {
    border: 2px dashed #d1d9e0;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fafbfc;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: #667eea;
    background: #f8f9ff;
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 10px;
}

.upload-prompt p {
    margin: 5px 0;
    color: #666;
}

.upload-hint {
    font-size: 0.85rem;
    color: #999;
}

/* 图片预览样式 */
.image-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.image-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background: #f5f5f5;
    aspect-ratio: 1;
}

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

.image-remove {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(231, 76, 60, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.image-remove:hover {
    background: #e74c3c;
    transform: scale(1.1);
}

.upload-info {
    margin-top: 10px;
    font-size: 0.85rem;
    color: #666;
}

/* 上传计数放到label内的行内样式 */
.upload-info-inline {
    margin-left: 8px;
    color: #666;
    font-size: 0.85rem;
    font-weight: normal;
}

/* 按需求暂时隐藏上传区域 */
#uploadArea {
    display: none !important;
}

/* 验证码样式 */
.captcha-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

#captchaQuestion {
    background: #f8f9fa;
    padding: 12px 16px;
    border-radius: 8px;
    font-weight: 600;
    color: #333;
    min-width: 120px;
    text-align: center;
}

#captcha {
    flex: 1;
    max-width: 120px;
}

.refresh-btn {
    /*background: #6c757d;*/
    color: white;
    border: none;
    border-radius: 8px;
    /* padding: 12px;*/
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.refresh-btn:hover {
    /*background: #5a6268;*/
    transform: rotate(180deg);
}

/* 提交按钮样式 */
.submit-btn {
    width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 16px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

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

/* 消息提示样式 */
.message {
    margin-top: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    font-weight: 500;
    text-align: center;
    animation: fadeIn 0.3s ease;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

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

.form-hint {
    font-size: 0.85rem;
    color: #666;
    margin-top: 5px;
}

/* 成功提示弹窗样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: modalFadeIn 0.3s ease;
}

.modal-content {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    max-width: 400px;
    width: 90%;
    animation: modalSlideUp 0.3s ease;
}

.modal-header {
    text-align: center;
    padding: 30px 30px 20px;
    border-bottom: 1px solid #f0f0f0;
}

.success-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 15px;
}

.error-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 15px;
}

.modal-header h3 {
    font-size: 1.5rem;
    color: #333;
    margin: 0;
    font-weight: 600;
}

.modal-body {
    padding: 20px 30px;
    text-align: center;
}

.modal-body p {
    color: #666;
    line-height: 1.6;
    margin: 0;
    font-size: 1rem;
}

.modal-footer {
    padding: 20px 30px 30px;
    text-align: center;
}

.modal-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 30px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 100px;
}

.modal-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.error-btn {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
}

.error-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(231, 76, 60, 0.3);
}

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

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .card-header {
        padding: 20px;
    }

    .card-header h1 {
        font-size: 1.5rem;
    }

    .feedback-form {
        padding: 20px;
    }

    .upload-area {
        padding: 20px;
    }

    .upload-icon {
        font-size: 2rem;
    }

    .image-preview {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 10px;
    }

    .captcha-group {
        flex-direction: column;
        align-items: stretch;
    }

    #captcha {
        max-width: none;
    }
}

@media (max-width: 480px) {
    .card-header h1 {
        font-size: 1.3rem;
    }

    .feedback-form {
        padding: 15px;
    }

    .image-preview {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }

    .emoji-grid {
        grid-template-columns: repeat(6, 1fr);
    }

    .modal-content {
        margin: 20px;
        width: calc(100% - 40px);
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 20px;
    }

    .toolbar-btn {
        min-width: 32px;
        height: 32px;
        font-size: 1rem;
    }
}

/* 上传信息内联样式 */
.upload-info-inline {
    margin-left: 8px;
    color: #666;
    font-size: 0.85rem;
}

/* 隐藏上传区域 */
#uploadArea {
    display: none !important;
}

/* 修正表情选择器位置 - 在按钮上方显示 */
.emoji-picker {
    top: auto !important;
    bottom: 100% !important;
    margin-bottom: 8px !important;
    margin-top: 0 !important;
}
