/**
 * 学生证页面样式 - 基于证件照页面极简线条风格
 */

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    background: #fafafa;
    min-height: 100vh;
    margin: 0; padding: 0;
    overflow-x: hidden; overflow-y: auto;
    color: #444;
}

body::-webkit-scrollbar, .page-container::-webkit-scrollbar, .control-panel::-webkit-scrollbar { width: 4px; }
body::-webkit-scrollbar-track, .page-container::-webkit-scrollbar-track, .control-panel::-webkit-scrollbar-track { background: transparent; }
body::-webkit-scrollbar-thumb, .page-container::-webkit-scrollbar-thumb, .control-panel::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.12); border-radius: 4px; }
body::-webkit-scrollbar-thumb:hover, .page-container::-webkit-scrollbar-thumb:hover, .control-panel::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.18); }
body::-webkit-scrollbar-button, .page-container::-webkit-scrollbar-button, .control-panel::-webkit-scrollbar-button { display: none; height: 0; width: 0; }

.page-container { width: 100vw; height: 100vh; margin: 0; padding: 2px; display: flex; flex-direction: column; overflow: hidden; background: #fafafa; }
.editor-container { flex: 1; display: flex; gap: 0; min-height: 0; }

.control-panel { width: 350px; background: #ffffff; border-radius: 0; padding: 20px; border: none; border-right: 1px solid rgba(0,0,0,0.06); overflow-y: auto; flex-shrink: 0; }
.panel-title { font-size: 18px; font-weight: 600; margin-bottom: 0; padding-bottom: 12px; border-bottom: 1px solid rgba(0,0,0,0.06); color: #333; display: flex; align-items: center; gap: 8px; }
.panel-title svg { flex-shrink: 0; opacity: 0.85; }
.panel-desc { font-size: 13px; color: rgba(0,0,0,0.5); margin-bottom: 0; padding: 12px 0; line-height: 1.5; border-bottom: 1px solid rgba(0,0,0,0.06); }

.form-group { margin-bottom: 0; padding: 16px 0; border-bottom: 1px solid rgba(0,0,0,0.06); }
.form-group:last-child { border-bottom: none; }
.form-label { display: block; margin-bottom: 8px; font-weight: 600; color: rgba(0,0,0,0.8); font-size: 13px; }

.upload-label-wrapper { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.upload-label-wrapper label { margin: 0; font-weight: 600; color: rgba(0,0,0,0.8); }
.upload-hint-inline { font-size: 12px; color: rgba(0,0,0,0.35); }

.upload-area-compact { width: 80px; height: 80px; border: 2px dashed rgba(0,0,0,0.12); border-radius: 12px; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all 0.2s; background: rgba(0,0,0,0.02); }
.upload-area-compact:hover { border-color: #3444fe; background: rgba(52, 68, 254, 0.1); }
.upload-area-compact.drag-over { border-color: #3444fe; background: rgba(52, 68, 254, 0.15); }
.upload-plus-icon { font-size: 32px; color: rgba(0,0,0,0.35); pointer-events: none; }
.uploaded-images { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 15px; align-items: center; }
.uploaded-image { position: relative; width: 80px; height: 80px; border-radius: 8px; overflow: hidden; border: 1px solid rgba(0,0,0,0.1); }
.uploaded-image img { width: 100%; height: 100%; object-fit: cover; }
.remove-image { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; background: rgba(0,0,0,0.7); color: white; border: none; cursor: pointer; font-size: 16px; line-height: 1; transition: all 0.2s; }
.remove-image:hover { background: #ff4444; transform: scale(1.1); }

/* 性别选择 */
.gender-options { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 8px; }
.gender-option { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px; border: 1px solid rgba(0,0,0,0.1); border-radius: 8px; cursor: pointer; transition: all 0.2s; background: rgba(0,0,0,0.02); }
.gender-option:hover { border-color: #3444fe; background: rgba(52,68,254,0.06); }
.gender-option.selected { border-color: #3444fe; background: linear-gradient(135deg, #3444fe 0%, #2a36cb 100%); color: white; }
.gender-option.selected .gender-icon svg { stroke: white; }
.gender-icon { display: flex; align-items: center; }
.gender-label { font-size: 14px; font-weight: 600; }

/* 学院选择 */
.college-options { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 8px; }
.college-option { padding: 8px 10px; border: 1px solid rgba(0,0,0,0.1); border-radius: 8px; cursor: pointer; transition: all 0.2s; background: rgba(0,0,0,0.02); font-size: 13px; text-align: center; font-weight: 500; color: rgba(0,0,0,0.65); }
.college-option:hover { border-color: #3444fe; background: rgba(52,68,254,0.06); }
.college-option.selected { border-color: #3444fe; background: linear-gradient(135deg, #3444fe 0%, #2a36cb 100%); color: white; }

/* 风格选择 */
.style-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 8px; }
.style-option { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 6px; border: 1px solid rgba(0,0,0,0.1); border-radius: 8px; cursor: pointer; transition: all 0.2s; background: rgba(0,0,0,0.02); }
.style-option:hover { border-color: #3444fe; background: rgba(52,68,254,0.06); }
.style-option.selected { border-color: #3444fe; background: linear-gradient(135deg, #3444fe 0%, #2a36cb 100%); color: white; }
.style-option.selected .style-desc { color: rgba(255,255,255,0.7); }
.style-name { font-size: 13px; font-weight: 600; }
.style-desc { font-size: 11px; color: rgba(0,0,0,0.4); }

/* 分辨率选择 */
.size-options { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 8px; }
.size-option { border: 1px solid rgba(0,0,0,0.1); border-radius: 8px; padding: 8px 12px; text-align: center; cursor: pointer; transition: all 0.2s ease; background: rgba(0,0,0,0.03); display: flex; flex-direction: row; align-items: center; justify-content: center; gap: 8px; color: rgba(0,0,0,0.65); }
.size-option:hover { border-color: #3444fe; background: rgba(52,68,254,0.1); }
.size-option.selected { border-color: #3444fe; background: linear-gradient(135deg, #3444fe 0%, #2a36cb 100%); color: white; }
.size-icon { font-size: 18px; display: inline-block; pointer-events: none; }
.size-label { font-size: 14px; font-weight: 600; display: inline-block; pointer-events: none; }

/* 生成按钮 */
.generate-btn { width: 100%; background: linear-gradient(135deg, #3444fe 0%, #2a36cb 100%); color: white; border: none; padding: 16px 24px; border-radius: 10px; font-size: 16px; font-weight: 600; cursor: pointer; transition: all 0.2s ease; position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; gap: 8px; }
.generate-btn:hover { opacity: 0.9; transform: translateY(-1px); }
.generate-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.generate-btn .btn-text { flex: 1; }
.generate-btn .btn-power { background: rgba(0,0,0,0.12); padding: 4px 12px; border-radius: 20px; font-size: 13px; font-weight: 500; white-space: nowrap; }

/* 预览面板 */
.preview-panel { flex: 1; background: #ffffff; border-radius: 0; padding: 0; border: none; min-width: 0; display: flex; flex-direction: column; height: calc(100vh - 40px); overflow: hidden; }
.preview-header { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; margin-bottom: 0; border-bottom: 1px solid rgba(0,0,0,0.06); flex-shrink: 0; }
.preview-header h3 { font-size: 16px; font-weight: 600; color: #333; }
.preview-actions { display: flex; gap: 10px; }
.action-btn { padding: 8px 16px; border: none; border-radius: 6px; background: rgba(0,0,0,0.08); color: rgba(0,0,0,0.65); font-size: 13px; font-weight: 500; cursor: pointer; transition: all 0.2s; }
.action-btn:hover { border-color: #3444fe; background: rgba(52,68,254,0.1); }
.preview-content { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; border-radius: 0; background: #fafafa; overflow: hidden; }
.preview-content img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; border-radius: 0; }
.preview-placeholder { text-align: center; color: rgba(0,0,0,0.35); }
.placeholder-icon { font-size: 48px; display: block; margin-bottom: 15px; color: #ccc; }
.placeholder-icon svg { width: 48px; height: 48px; }
.placeholder-hint { font-size: 12px; color: rgba(0,0,0,0.18); margin-top: 8px; }

/* 进度条 */
.generation-progress-inline { display: flex; align-items: center; gap: 10px; flex: 1; max-width: 300px; margin: 0 20px; }
.progress-bar-inline { flex: 1; height: 6px; background: rgba(0,0,0,0.08); border-radius: 3px; overflow: hidden; }
.progress-fill-inline { height: 100%; background: linear-gradient(90deg, #3444fe 0%, #2a36cb 100%); width: 0%; transition: width 0.3s ease; }
.progress-text-inline { color: #3444fe; font-size: 13px; font-weight: 500; white-space: nowrap; }

/* 历史面板 */
.history-panel { width: 300px; background: #ffffff; border-radius: 0; padding: 50px 20px 20px; /* 🔥 top 50px: 避开父页面固定 nav-right */ border: none; border-left: 1px solid rgba(0,0,0,0.06); overflow-y: hidden !important; flex-shrink: 0; display: flex; flex-direction: column; height: calc(100vh - 40px); position: relative; z-index: 100; }
.history-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; padding-bottom: 10px; border-bottom: 1px solid rgba(0,0,0,0.08); }
.history-header h3 { font-size: 16px; font-weight: 600; color: #333; margin: 0; }
.clear-history-btn { background: none; border: none; font-size: 18px; cursor: pointer; padding: 5px; transition: all 0.2s ease; color: rgba(0,0,0,0.45); }
/* 全局隐藏「生成历史/处理历史」标题区（含标题文字 + 清空按钮） */
.history-header { display: none !important; }
.clear-history-btn:hover { color: #ff6b6b; transform: scale(1.1); }

.history-list { flex: 1; overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; scrollbar-color: rgba(0,0,0,0.12) transparent; position: relative; z-index: 100; }
.history-list::-webkit-scrollbar { width: 4px; }
.history-list::-webkit-scrollbar-track { background: transparent; border-radius: 4px; }
.history-list::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.12); border-radius: 4px; }
.history-list::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.18); }
.history-list::-webkit-scrollbar-button { display: none; height: 0; width: 0; }

.history-item { background: rgba(0,0,0,0.03); border-radius: 8px; padding: 12px; margin-bottom: 10px; border: 1px solid transparent; transition: all 0.2s ease; cursor: pointer; }
.history-item:hover { background: rgba(52,68,254,0.1); border-color: rgba(52,68,254,0.3); }
.history-item-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.history-time { font-size: 11px; color: rgba(0,0,0,0.35); }
.history-status { font-size: 11px; padding: 2px 8px; border-radius: 4px; font-weight: 500; }
.history-status.success { background: rgba(16,185,129,0.2); color: #10b981; }
.history-status.processing { background: rgba(52,68,254,0.15); color: #3444fe; }
.history-status.queued { background: rgba(52,68,254,0.15); color: #3444fe; }
.history-status.failed { background: rgba(239,68,68,0.2); color: #ef4444; cursor: help; }
.history-delete-btn { background: transparent; border: none; padding: 2px 6px; border-radius: 4px; cursor: pointer; font-size: 12px; opacity: 0.5; transition: all 0.2s ease; margin-left: auto; }
.history-delete-btn:hover { opacity: 1; background: rgba(239,68,68,0.2); }

.history-prompt { font-size: 12px; color: rgba(0,0,0,0.65); margin-bottom: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-params { font-size: 11px; color: rgba(0,0,0,0.45); margin-bottom: 8px; }
.history-image-wrapper { position: relative; margin-top: 8px; overflow: hidden; }
.history-image { width: 100%; height: auto; border-radius: 6px; object-fit: contain; content-visibility: auto; }
.history-send-btn { position: absolute; top: 6px; left: 6px; width: 28px; height: 28px; border-radius: 50%; border: none; background: rgba(0,0,0,0.8); backdrop-filter: blur(4px); cursor: pointer; font-size: 14px; display: flex; align-items: center; justify-content: center; transition: all 0.2s ease; z-index: 10; opacity: 0.7; }
.history-send-btn:hover { opacity: 1; transform: scale(1.1); background: #3444fe; color: white; }
.history-actions { display: flex; gap: 6px; margin-top: 8px; position: relative; z-index: 100; }
.history-action-btn { flex: 1; padding: 6px; border: none; border-radius: 6px; background: rgba(0,0,0,0.08); color: rgba(0,0,0,0.65); cursor: pointer; font-size: 11px; transition: all 0.3s ease; pointer-events: auto !important; position: relative; z-index: 10; }
.history-action-btn:hover { background: rgba(52,68,254,0.2); color: #3444fe; }

/* 响应式设计 */
@media (max-width: 900px) {
    body { overflow-x: hidden !important; }
    .page-container { width: 100%; height: auto; min-height: 100vh; padding: 2px; overflow-x: hidden; overflow-y: auto; }
    .editor-container { flex-direction: column; gap: 2px; height: auto; }
    .control-panel { width: 100%; order: 1; flex-shrink: 0; max-height: none; overflow-y: visible; }
    .preview-panel { width: 100%; order: 2; min-height: 300px; height: auto; }
    .history-panel { width: 100%; order: 3; max-height: 400px; height: auto; }
    .generate-btn { padding: 15px 20px; font-size: 16px; }
    .college-options { grid-template-columns: repeat(2, 1fr); }
    .style-options { grid-template-columns: repeat(3, 1fr); }
}

