/* 形象美学分析系统 CSS 样式 */

/* 基础样式和重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* 主色调 */
    --primary-dark: #0c3b6b;
    --primary: #1a5fa4;
    --primary-light: #54c7fc;
    
    /* 背景色 */
    --bg-dark: #121c2e;
    --bg-light: #ffffff;
    --bg-gradient: linear-gradient(135deg, var(--bg-dark), #1a2942);
    
    /* 文本颜色 */
    --text-light: #f0f0f0;
    --text-dark: #0c3b6b;
    --text-muted: #8894a7;
    
    /* 状态颜色 */
    --success: #4caf50;
    --error: #f44336;
    --warning: #ff9800;
    --info: #2196f3;
    
    /* 尺寸和间距 */
    --border-radius: 10px;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 15px rgba(0, 0, 0, 0.15);
    --transition: all 0.3s ease;
}

body {
    font-family: 'Roboto', 'Helvetica Neue', '思源黑体', sans-serif;
    background-color: #f5f7fa;
    color: var(--text-dark);
    line-height: 1.6;
    padding-bottom: 60px; /* 适应页脚高度 */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: var(--border-radius);
    border: none;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.btn i {
    margin-right: 8px;
}

.btn-primary {
    background-color: var(--primary);
    color: var(--text-light);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    box-shadow: var(--shadow-hover);
}

.btn-secondary {
    background-color: #e0e7ef;
    color: var(--primary-dark);
}

.btn-secondary:hover {
    background-color: #d0dae4;
    box-shadow: var(--shadow-hover);
}

.btn-cancel {
    background-color: transparent;
    color: var(--text-muted);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    font-size: 16px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-cancel:hover {
    background-color: rgba(0, 0, 0, 0.05);
    color: var(--error);
}

.btn:disabled {
    background-color: #c0c0c0;
    cursor: not-allowed;
    box-shadow: none;
}

/* 头部导航样式 */
header {
    background-color: var(--primary);
    color: var(--text-light);
    padding: 15px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    font-size: 24px;
    font-weight: 600;
    display: flex;
    align-items: center;
}

header h1 i {
    margin-right: 12px;
    font-size: 28px;
}

nav ul {
    list-style: none;
    display: flex;
}

nav li {
    margin-left: 10px;
}

nav a {
    color: var(--text-light);
    text-decoration: none;
    padding: 10px 15px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    transition: var(--transition);
}

nav a i {
    margin-right: 8px;
}

nav li.active a, nav a:hover {
    background-color: rgba(255, 255, 255, 0.15);
}

/* 主内容区样式 */
main {
    padding: 30px 0;
    min-height: calc(100vh - 135px); /* 视口高度减去头部和页脚的高度 */
    display: flex;
    flex-direction: column;
}

main .container {
    flex: 1;
    display: flex;
    flex-direction: column;
}

section {
    display: none;
    animation: fadeIn 0.5s ease;
    flex: 1;
}

section.section-active {
    display: flex;
    flex-direction: column;
}

section > .card {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.upload-container, 
.report-card, 
.history-list {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* 确保历史记录列表可以拉伸填充空间 */
.history-list {
    min-height: 50vh;
    margin-bottom: 20px;
}

/* 确保卡片内容填充可用空间 */
.card {
    background-color: var(--bg-light);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 25px;
    margin-bottom: 30px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.card h2 {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--primary-dark);
    display: flex;
    align-items: center;
}

.card h2 i {
    margin-right: 12px;
    color: var(--primary);
}

.card h3 {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 15px;
    color: var(--primary-dark);
    display: flex;
    align-items: center;
}

.card h3 i {
    margin-right: 10px;
    color: var(--primary);
}

/* 照片上传模块样式 */
.upload-container {
    display: flex;
    flex-direction: column;
}

.photo-type-selector {
    display: flex;
    margin-bottom: 20px;
    gap: 10px;
}

.type-btn {
    flex: 1;
    padding: 10px;
    border: 2px solid #e0e7ef;
    background-color: #f5f7fa;
    color: var(--text-dark);
    border-radius: var(--border-radius);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.type-btn.active, .type-btn:hover {
    border-color: var(--primary);
    background-color: rgba(26, 95, 164, 0.1);
}

.id-input-container {
    margin-bottom: 20px;
}

.id-input-container label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.id-input-container input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e7ef;
    border-radius: var(--border-radius);
    font-size: 15px;
    transition: var(--transition);
}

.id-input-container input:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(26, 95, 164, 0.1);
}

.upload-area {
    border: 2px dashed var(--primary-light);
    border-radius: var(--border-radius);
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 20px;
    background-color: rgba(84, 199, 252, 0.05);
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

.upload-area:hover {
    border-color: var(--primary);
    background-color: rgba(84, 199, 252, 0.1);
}

.upload-area i {
    font-size: 48px;
    color: var(--primary);
    margin-bottom: 15px;
}

.upload-area p {
    color: var(--text-muted);
    font-size: 16px;
}

.preview-container {
    margin-bottom: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.preview-container h3 {
    margin-bottom: 10px;
}

.preview-image-container {
    position: relative;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    flex: 1;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-image-container img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.preview-image-container .btn-cancel {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: rgba(255, 255, 255, 0.8);
}

.upload-progress {
    margin-bottom: 20px;
}

.progress-bar {
    height: 8px;
    background-color: #e0e7ef;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-light), var(--primary));
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 14px;
    color: var(--text-muted);
    text-align: center;
}

/* 分析报告模块样式 */
.report-card {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.analysis-loading {
    position: relative;
    height: auto;
    min-height: 400px;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: rgba(84, 199, 252, 0.05);
    border-radius: var(--border-radius);
    overflow: hidden;
    padding: 40px 20px;
}

.analysis-loading .background-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0.3;
    filter: blur(3px) grayscale(50%);
    z-index: 1;
}

.scanner-line {
    position: absolute;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, transparent, var(--primary-light), transparent);
    animation: scanning 3s linear infinite;
    box-shadow: 0 0 10px var(--primary-light);
    z-index: 3;
}

@keyframes scanning {
    0% { top: 5%; }
    50% { top: 95%; }
    100% { top: 5%; }
}

.analysis-loading p {
    margin-top: 30px;
    margin-bottom: 30px;
    color: var(--text-dark);
    font-size: 16px;
    font-weight: 500;
    background-color: rgba(255, 255, 255, 0.7);
    padding: 10px 20px;
    border-radius: 20px;
    position: relative;
    z-index: 2;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.05);
}

/* 添加光影效果 */
.analysis-loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, rgba(84, 199, 252, 0.1), transparent);
    z-index: 2;
}

.report-header {
    display: flex;
    margin-bottom: 30px;
    gap: 20px;
}

.report-image {
    width: 200px;
    height: 200px;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.report-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.report-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.info-item {
    margin-bottom: 15px;
}

.info-item .label {
    font-weight: 500;
    color: var(--text-muted);
    margin-right: 10px;
}

.info-item .value {
    font-weight: 600;
    color: var(--text-dark);
}

.report-content {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.report-sections {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
    margin-bottom: 30px;
    flex: 1;
}

.report-section {
    background-color: #f8f9fb;
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
}

.skin-tone-container {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex: 1;
    gap: 15px;
}

.face-rating {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    flex: 1;
}

.features-analysis {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex: 1;
    gap: 12px;
}

.gender-info, .skin-tone {
    display: flex;
    align-items: center;
}

.skin-color-box {
    width: 30px;
    height: 30px;
    border-radius: 5px;
    margin-left: 10px;
    border: 1px solid #ddd;
    background-color: #f5deb3; /* 默认肤色 */
}

.rating-display {
    font-size: 50px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 15px;
}

.rating-stars {
    display: flex;
    gap: 5px;
}

.rating-star {
    width: 25px;
    height: 25px;
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}

.rating-star.empty {
    background: #e0e7ef;
}

.proportion-chart, 
.face-whitespace {
    height: auto;
    min-height: 200px;
    flex: 1;
    background-color: #fff;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e0e7ef;
}

.feature-item {
    display: flex;
    align-items: center;
}

.feature-name {
    width: 80px;
    font-weight: 500;
}

.feature-bar-container {
    flex: 1;
    height: 8px;
    background-color: #e0e7ef;
    border-radius: 4px;
    margin: 0 15px;
    overflow: hidden;
}

.feature-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-light), var(--primary));
    transition: width 1s ease;
}

.feature-score {
    width: 30px;
    font-weight: 600;
    text-align: right;
}

.report-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
}

/* 历史记录模块样式 */
.filter-container {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-group {
    flex: 1;
    min-width: 200px;
}

.filter-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.filter-group input {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid #e0e7ef;
    border-radius: var(--border-radius);
    font-size: 15px;
    transition: var(--transition);
}

.filter-group input:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(26, 95, 164, 0.1);
}

.history-list {
    min-height: 50vh;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.history-item {
    display: flex;
    align-items: center;
    padding: 15px;
    border-radius: var(--border-radius);
    border: 1px solid #e0e7ef;
    margin-bottom: 15px;
    cursor: pointer;
    transition: var(--transition);
}

.history-item:hover {
    background-color: rgba(84, 199, 252, 0.05);
    border-color: var(--primary-light);
    box-shadow: var(--shadow);
}

.history-thumb {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    margin-right: 15px;
}

.history-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.history-info {
    flex: 1;
}

.history-id {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 5px;
}

.history-date, .history-type {
    font-size: 14px;
    color: var(--text-muted);
}

.empty-history {
    height: auto;
    min-height: 200px;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.empty-history i {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.4;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-btn {
    background-color: #f5f7fa;
    border: 1px solid #e0e7ef;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.page-btn:hover {
    background-color: var(--primary-light);
    color: white;
    border-color: var(--primary-light);
}

.page-numbers {
    margin: 0 15px;
    font-weight: 500;
}

/* 通知样式 */
.notification {
    position: fixed;
    bottom: -100px;
    right: 20px;
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 15px;
    display: flex;
    align-items: center;
    max-width: 400px;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.notification.show {
    transform: translateY(-120px);
}

.notification-icon {
    margin-right: 15px;
    font-size: 24px;
    color: var(--success);
}

.notification-content {
    flex: 1;
}

.notification-message {
    font-weight: 500;
}

.notification-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 5px;
    margin-left: 10px;
    transition: var(--transition);
}

.notification-close:hover {
    color: var(--error);
}

/* 页脚样式 */
footer {
    background-color: var(--primary-dark);
    color: var(--text-light);
    padding: 20px 0;
    text-align: center;
    margin-top: 30px;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 50;
}

/* 响应式设计 */
@media (max-width: 992px) {
    .report-sections {
        grid-template-columns: 1fr;
    }
    
    .report-header {
        flex-direction: column;
        align-items: center;
    }
    
    .report-info {
        align-items: center;
    }
}

@media (max-width: 768px) {
    header .container {
        flex-direction: column;
    }
    
    header h1 {
        margin-bottom: 15px;
    }
    
    .filter-container {
        flex-direction: column;
    }
    
    .filter-group {
        width: 100%;
    }
}

@media (max-width: 576px) {
    .card {
        padding: 15px;
    }
    
    nav ul {
        justify-content: center;
        width: 100%;
    }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
} 