/**
 * 表单反馈系统样式文件
 * 包含前台表单和后台管理的样式
 */

/* ==================== 基础样式 ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    line-height: 1.6;
}

/* ==================== 前台表单样式 ==================== */
.container {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.form-wrapper {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 500px;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-wrapper h1 {
    text-align: center;
    color: #333;
    margin-bottom: 10px;
    font-size: 28px;
}

.subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
    font-size: 14px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
    font-size: 14px;
}

.required {
    color: #e74c3c;
    margin-right: 4px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: #f9f9f9;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #aaa;
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

/* 下拉选择框样式 */
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: #f9f9f9;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
}

.form-group select:focus {
    outline: none;
    border-color: #667eea;
    background-color: white;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.form-group select option {
    padding: 10px;
}

.submit-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.submit-btn:active {
    transform: translateY(0);
}

.submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* 消息提示样式 */
.message {
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    text-align: center;
    font-weight: 500;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* ==================== 后台管理样式 ==================== */
.admin-container {
    min-height: 100vh;
    background: #f5f7fa;
}

.admin-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.admin-header h1 {
    font-size: 24px;
}

.nav-links {
    display: flex;
    gap: 15px;
}

.nav-link {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* 统计卡片 */
.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    padding: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-icon {
    font-size: 40px;
}

.stat-info .stat-number {
    font-size: 32px;
    font-weight: 700;
    color: #333;
}

.stat-info .stat-label {
    color: #666;
    font-size: 14px;
}

.stat-card.total {
    border-left: 4px solid #667eea;
}

.stat-card.unread {
    border-left: 4px solid #e74c3c;
}

.stat-card.read {
    border-left: 4px solid #27ae60;
}

/* 反馈区域 */
.feedback-section {
    padding: 0 30px 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.feedback-section h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 20px;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.empty-icon {
    font-size: 60px;
    margin-bottom: 15px;
}

.empty-state p {
    color: #666;
    font-size: 16px;
}

/* 表格样式 */
.feedback-table-wrapper {
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.feedback-table {
    width: 100%;
    border-collapse: collapse;
}

.feedback-table th,
.feedback-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.feedback-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.feedback-table tbody tr:hover {
    background: #f8f9fa;
}

.unread-row {
    background: #fff9e6 !important;
}

.unread-row:hover {
    background: #fff5cc !important;
}

/* 状态标签 */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.status-unread {
    background: #ffe0e0;
    color: #e74c3c;
}

.status-read {
    background: #d4edda;
    color: #27ae60;
}

/* 类型标签 */
.type-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 500;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

/* 内容单元格 */
.content-cell {
    max-width: 300px;
}

.content-preview {
    cursor: pointer;
    color: #555;
    word-break: break-word;
}

.content-preview:hover {
    color: #667eea;
}

.content-full {
    color: #333;
    word-break: break-word;
    background: #f5f5f5;
    padding: 10px;
    border-radius: 8px;
    margin-top: 5px;
}

/* 操作按钮 */
.action-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn {
    display: inline-block;
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-sm {
    padding: 6px 12px;
}

.btn-success {
    background: #27ae60;
    color: white;
}

.btn-success:hover {
    background: #219a52;
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
}

/* 页脚 */
.admin-footer {
    text-align: center;
    padding: 20px;
    color: #999;
    font-size: 13px;
    border-top: 1px solid #eee;
    margin-top: 30px;
    background: white;
}

/* ==================== 设置页面样式 ==================== */
.settings-container {
    padding: 30px;
    max-width: 900px;
    margin: 0 auto;
}

.settings-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    padding: 30px;
    margin-bottom: 20px;
}

.settings-card h2 {
    color: #333;
    font-size: 20px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.settings-desc {
    color: #666;
    font-size: 14px;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.optional-tag {
    font-size: 12px;
    background: #e9ecef;
    color: #6c757d;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: normal;
}

.settings-form .form-group {
    margin-bottom: 20px;
}

.settings-form .form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
    font-size: 14px;
}

.settings-form .form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: #f9f9f9;
}

.settings-form .form-group input:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.help-text {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #888;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 500;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.form-row {
    display: flex;
    gap: 20px;
}

.form-group.half {
    flex: 1;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: #6c757d;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

.info-card {
    background: #f8f9fa;
    border-left: 4px solid #667eea;
}

.info-content {
    color: #555;
    font-size: 14px;
}

.info-content h4 {
    color: #333;
    margin: 15px 0 10px;
    font-size: 14px;
}

.info-content h4:first-child {
    margin-top: 0;
}

.info-content ul {
    margin-left: 20px;
    margin-bottom: 15px;
}

.info-content li {
    margin-bottom: 8px;
    line-height: 1.8;
}

/* ==================== 响应式设计 ==================== */
@media (max-width: 768px) {
    .form-wrapper {
        padding: 30px 20px;
    }
    
    .admin-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .stats-cards {
        padding: 20px;
        gap: 15px;
    }
    
    .feedback-section {
        padding: 0 15px 15px;
    }
    
    .feedback-table-wrapper {
        overflow-x: auto;
    }
    
    .feedback-table {
        min-width: 800px;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .settings-container {
        padding: 15px;
    }
    
    .settings-card {
        padding: 20px;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .variables-grid {
        grid-template-columns: 1fr;
    }
}

/* ==================== 自动回复弹窗样式 ==================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: white;
    border-radius: 20px;
    max-width: 450px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px 30px;
    text-align: center;
}

.modal-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 10px;
}

.modal-header h2 {
    margin: 0;
    font-size: 22px;
}

.modal-body {
    padding: 30px;
    text-align: center;
}

.auto-reply-image {
    margin-bottom: 20px;
}

.auto-reply-image img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.auto-reply-text {
    color: #555;
    font-size: 15px;
    line-height: 1.8;
    margin: 0;
}

.modal-footer {
    padding: 0 30px 25px;
    text-align: center;
}

.modal-footer .btn {
    min-width: 150px;
    padding: 12px 30px;
    font-size: 15px;
}

/* 文件上传样式 */
.file-input {
    width: 100%;
    padding: 10px;
    border: 2px dashed #e0e0e0;
    border-radius: 10px;
    background: #f9f9f9;
    cursor: pointer;
    transition: all 0.3s ease;
}

.file-input:hover {
    border-color: #667eea;
    background: #f0f0ff;
}

.current-image-preview {
    margin-bottom: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    text-align: center;
}

/* 设置表单文本域 */
.settings-form .form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: #f9f9f9;
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
}

.settings-form .form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

/* 邮件模板代码编辑器 */
.code-editor {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.5;
    background: #1e1e1e;
    color: #d4d4d4;
    border: 2px solid #333;
    resize: vertical;
}

.code-editor:focus {
    border-color: #667eea;
    background: #252526;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.2);
}

/* 模板变量说明 */
.template-variables-info {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 15px 20px;
    margin-bottom: 20px;
}

.template-variables-info h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: #333;
}

.variables-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
}

.variable-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.variable-item code {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.variable-item span {
    color: #666;
    font-size: 13px;
}

/* 邮件模板选择器 */
.template-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.template-item {
    cursor: pointer;
    border: 3px solid transparent;
    border-radius: 12px;
    transition: all 0.3s ease;
    overflow: hidden;
    background: #fff;
}

.template-item:hover {
    border-color: #667eea;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.25);
}

.template-item.selected {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3);
}

.template-preview {
    height: 140px;
    padding: 15px;
    border-radius: 8px 8px 0 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.preview-header {
    height: 30px;
    background: rgba(255,255,255,0.2);
    border-radius: 6px;
}

.preview-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px;
    background: rgba(255,255,255,0.95);
    border-radius: 8px;
}

.preview-tag {
    width: 60px;
    height: 12px;
    background: rgba(102, 126, 234, 0.6);
    border-radius: 6px;
    margin: 0 auto 4px;
}

.preview-row {
    height: 10px;
    background: rgba(102, 126, 234, 0.15);
    border-radius: 4px;
}

.preview-content {
    height: 18px;
    background: rgba(245, 158, 11, 0.3);
    border-radius: 4px;
    margin-top: auto;
}

.template-info {
    padding: 12px;
    text-align: center;
}

.template-name {
    display: block;
    font-weight: 600;
    color: #333;
    font-size: 14px;
    margin-bottom: 4px;
}

.template-desc {
    font-size: 12px;
    color: #888;
}

@media (max-width: 768px) {
    .template-gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}
