/**
 * 样式文件
 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

/* 头部样式 */
.header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.header h1 {
    color: #333;
    font-size: 28px;
    margin-bottom: 10px;
}

.source {
    color: #666;
    font-size: 16px;
}

.source strong {
    color: #667eea;
    font-size: 18px;
}

.error {
    color: #dc3545;
    background: #fff3f3;
    padding: 10px 15px;
    border-radius: 8px;
    border-left: 4px solid #dc3545;
}

/* 表单样式 */
.form-group {
    margin-bottom: 25px;
}

label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 600;
    font-size: 15px;
}

.required {
    color: #dc3545;
}

textarea, input[type="text"], input[type="tel"] {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

textarea:focus, input[type="text"]:focus, input[type="tel"]:focus {
    outline: none;
    border-color: #667eea;
}

textarea {
    resize: vertical;
    min-height: 120px;
}

.char-count {
    text-align: right;
    font-size: 12px;
    color: #999;
    margin-top: 5px;
}

.hint {
    font-size: 12px;
    color: #999;
    margin-top: 5px;
}

/* 满意度评分样式 */
.rating-container {
    padding: 15px 0;
}

.hearts-rating {
    display: flex;
    gap: 8px;
    justify-content: flex-start;
    margin-bottom: 10px;
}

.heart {
    font-size: 48px;
    cursor: pointer;
    transition: transform 0.2s ease, filter 0.2s ease;
    user-select: none;
    filter: grayscale(100%) opacity(0.3);
}

.heart:hover {
    transform: scale(1.2);
}

.heart.active {
    color: #ff6b9d;
    filter: none;
    animation: heartBeat 0.3s ease;
}

@keyframes heartBeat {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.3);
    }
    100% {
        transform: scale(1);
    }
}

.rating-description {
    font-size: 18px;
    color: #dc3545;
    margin-top: 8px;
    min-height: 20px;
    line-height: 1.5;
    font-weight: 600;
}

/* 上传区域样式 */
.upload-area {
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.upload-area:hover, .upload-area.dragover {
    border-color: #667eea;
    background: #f8f9ff;
}

.upload-area input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.upload-hint .icon {
    font-size: 48px;
    display: block;
    margin-bottom: 10px;
}

.upload-hint p {
    color: #666;
    margin: 5px 0;
}

.small {
    font-size: 12px;
    color: #999;
}

/* 图片预览 */
.preview-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    margin-top: 15px;
}

.preview-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #e0e0e0;
}

.preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-item .remove-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(220, 53, 69, 0.9);
    color: white;
    border: none;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 提交按钮 */
.submit-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.submit-btn:active {
    transform: translateY(0);
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-loading {
    display: inline-block;
}

/* 页脚 */
.footer {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
    color: #999;
    font-size: 14px;
}

/* Toast 提示 */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 15px;
    z-index: 9999;
    transition: transform 0.3s ease;
    max-width: 90%;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

.toast.success {
    background: rgba(40, 167, 69, 0.9);
}

.toast.error {
    background: rgba(220, 53, 69, 0.9);
}

/* 登录页面 */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.login-container {
    background: white;
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.login-container h1 {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
    font-size: 24px;
}

.login-form .form-group {
    margin-bottom: 25px;
}

.alert {
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-error {
    background: #fff3f3;
    color: #dc3545;
    border-left: 4px solid #dc3545;
}

/* 后台管理样式 */
.admin-header {
    max-width: 1400px;
    margin: 0 auto 20px;
    padding: 20px;
    background: white;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.admin-header h1 {
    font-size: 24px;
    color: #333;
}

.admin-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn-logout {
    padding: 8px 16px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

.btn-logout:hover {
    background: #c82333;
}

.admin-container {
    max-width: 1400px;
    margin: 0 auto;
}

/* 统计区域 */
.stats-section {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.stats-section h2 {
    font-size: 18px;
    color: #333;
    margin-bottom: 15px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
}

.stat-card.total {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.stat-number {
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 13px;
    opacity: 0.9;
}

/* 筛选区域 */
.filter-section {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.filter-form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-form select,
.filter-form input[type="text"] {
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
}

.filter-form select {
    min-width: 150px;
}

.filter-form input[type="text"] {
    flex: 1;
    min-width: 200px;
}

.btn-search, .btn-reset {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    display: inline-block;
}

.btn-search {
    background: #667eea;
    color: white;
}

.btn-search:hover {
    background: #5568d3;
}

.btn-reset {
    background: #6c757d;
    color: white;
}

.btn-reset:hover {
    background: #5a6268;
}

/* 数据列表 */
.data-section {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.data-section h2 {
    font-size: 18px;
    color: #333;
    margin-bottom: 15px;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.submissions-list {
    display: grid;
    gap: 15px;
}

.submission-card {
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 15px;
    transition: box-shadow 0.2s ease;
}

.submission-card:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.submission-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 10px;
}

.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: white;
}

/* 为每个门店生成不同的颜色 */
.badge-1 { background: #dc3545; }
.badge-2 { background: #fd7e14; }
.badge-3 { background: #ffc107; color: #333; }
.badge-4 { background: #28a745; }
.badge-5 { background: #17a2b8; }
.badge-6 { background: #007bff; }
.badge-7 { background: #6f42c1; }
.badge-8 { background: #e83e8c; }
.badge-9 { background: #20c997; }
.badge-10 { background: #6610f2; }
.badge-11 { background: #fd7e14; }
.badge-12 { background: #20c997; }
.badge-13 { background: #007bff; }
.badge-14 { background: #6f42c1; }
.badge-15 { background: #e83e8c; }
.badge-16 { background: #17a2b8; }
.badge-17 { background: #343a40; }

.time {
    color: #999;
    font-size: 13px;
}

.submission-content {
    margin-bottom: 12px;
}

.submission-content .text {
    color: #333;
    line-height: 1.6;
    word-break: break-word;
}

.submission-images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.submission-images a {
    display: block;
    aspect-ratio: 1;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #e0e0e0;
}

.submission-images img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s ease;
}

.submission-images a:hover img {
    transform: scale(1.1);
}

.submission-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
}

.phone {
    color: #666;
    font-size: 14px;
}

.btn-delete {
    padding: 6px 12px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
}

.btn-delete:hover {
    background: #c82333;
}

/* 统计卡片可点击样式 */
.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
    user-select: none;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.stat-card.active {
    transform: scale(1.05);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.8), 0 6px 20px rgba(0, 0, 0, 0.2);
}

.stat-card.total {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

/* 置顶标记 */
.pin-badge {
    display: inline-block;
    padding: 2px 8px;
    background: #ff6b6b;
    color: white;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    margin-right: 8px;
}

/* 置顶的卡片样式 */
.submission-card.pinned {
    border-left: 4px solid #ff6b6b;
    background: #fff5f5;
}

/* 满意度显示 */
.satisfaction-display {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.satisfaction-display .label {
    font-size: 13px;
    color: #666;
}

.hearts-inline {
    display: inline-flex;
    gap: 2px;
}

.heart-inline {
    font-size: 18px;
    filter: grayscale(100%) opacity(0.25);
}

.heart-inline.filled {
    filter: none;
}

/* 评语区域 */
.comment-section {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed #e0e0e0;
}

.comment-text {
    font-size: 13px;
    color: #555;
    background: #f8f9fa;
    padding: 8px 12px;
    border-radius: 6px;
    margin-bottom: 8px;
    line-height: 1.5;
    word-break: break-word;
}

.comment-label {
    font-weight: 600;
    color: #333;
}

.btn-comment {
    padding: 6px 12px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.2s ease;
}

.btn-comment:hover {
    background: #5568d3;
}

.comment-input-area {
    margin-top: 8px;
}

.comment-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    resize: vertical;
    min-height: 60px;
    transition: border-color 0.2s ease;
}

.comment-textarea:focus {
    outline: none;
    border-color: #667eea;
}

.comment-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.btn-save-comment {
    padding: 6px 16px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.2s ease;
}

.btn-save-comment:hover {
    background: #218838;
}

.btn-cancel-comment {
    padding: 6px 16px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.2s ease;
}

.btn-cancel-comment:hover {
    background: #5a6268;
}

/* 操作按钮组 */
.action-buttons {
    display: flex;
    gap: 8px;
}

.btn-pin {
    padding: 6px 12px;
    background: #ff6b6b;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.2s ease;
}

.btn-pin:hover {
    background: #ee5a5a;
}

/* 响应式设计 */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .container {
        padding: 20px;
    }
    
    .header h1 {
        font-size: 24px;
    }
    
    .admin-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .filter-form {
        flex-direction: column;
    }
    
    .filter-form select,
    .filter-form input[type="text"] {
        width: 100%;
    }
    
    .submission-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    to {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
}
