body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 20px;
    background-color: #f4f7f6;
    color: #333;
}

.container {
    max-width: 960px; /* 限制内容最大宽度，在宽屏上居中 */
    margin: 30px auto;
    background-color: #ffffff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

h1 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 40px;
    font-size: 2.5em;
}

.section {
    background-color: #fdfdfd;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

h2 {
    color: #34495e;
    margin-top: 0;
    margin-bottom: 20px;
    border-bottom: 2px solid #e8e8e8;
    padding-bottom: 10px;
    font-size: 1.6em;
}

/* 默认输入框和选择框样式 (适用于桌面及以上) */
input[type="text"],
input[type="file"],
select {
    display: block;
    margin-bottom: 15px;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 5px;
    width: calc(100% - 18px); /* 默认占据父容器宽度 */
    box-sizing: border-box;
}

/* 桌面端客户姓名输入框宽度优化 */
#customerNameInput {
    max-width: 300px; /* 限制桌面端宽度，避免过长 */
}


/* 默认按钮样式 (适用于桌面及以上) */
button {
    background-color: #4CAF50; /* Green */
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s ease, transform 0.1s ease; /* 添加transform动画 */
    margin-right: 10px; /* 按钮之间默认间距 */
}

button:hover {
    background-color: #45a049;
    transform: translateY(-1px); /* 悬停时略微上浮 */
}

button:active {
    transform: translateY(0); /* 点击时恢复 */
}

button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
    transform: none; /* 禁用状态无动画 */
}

#uploadStatus {
    margin-top: 15px;
    font-weight: bold;
    color: #333;
}

.photo-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 20px;
    justify-content: center; /* 在桌面端也居中对齐图片 */
}

.photo-item {
    width: 150px; /* 桌面端图片固定宽度 */
    height: 150px;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s ease; /* 添加图片项的动画 */
}

.photo-item:hover {
    transform: translateY(-3px); /* 悬停时略微上浮 */
}

.photo-item img {
    width: 100%;
    height: calc(100% - 25px);
    object-fit: cover;
    display: block;
}

.photo-item .photo-id-display {
    background-color: #f8f8f8;
    color: #555;
    margin: 0;
    padding: 3px 5px;
    font-size: 0.8em;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    box-sizing: border-box;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.photo-item .photo-id-display:hover {
    overflow: visible;
    white-space: normal;
    word-break: break-all;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 5px;
    font-size: 0.9em;
    z-index: 20;
    border-radius: 0 0 8px 8px;
}

.delete-photo-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background-color: rgba(255, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    line-height: 25px;
    text-align: center;
    font-size: 0.8em;
    cursor: pointer;
    z-index: 10;
    padding: 0;
    margin: 0;
    transition: background-color 0.3s ease;
}

.delete-photo-btn:hover {
    background-color: rgba(255, 0, 0, 1);
}

.session-info {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    font-size: 1.1em;
}

.session-info p {
    margin: 0;
    margin-right: 15px;
}

.session-info strong {
    color: #007bff;
}

.qr-code-container {
    text-align: center;
    margin-top: 20px;
}

#qrCodeImage {
    max-width: 250px;
    height: auto;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.finish-btn {
    background-color: #007bff;
    margin-top: 20px;
    width: 100%; /* 默认全宽 */
    padding: 15px;
    font-size: 1.1em;
}

.finish-btn:hover {
    background-color: #0056b3;
}

/* --- 优化历史链接/返回链接样式 --- */
.history-link, .back-link {
    display: block; /* 保持块级元素 */
    width: fit-content; /* 宽度自适应内容 */
    min-width: 180px; /* 最小宽度 */
    max-width: 300px; /* 最大宽度 */
    margin: 30px auto; /* 自动居中并设置顶部间距 */
    padding: 12px 20px;
    background-color: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.3s ease, transform 0.1s ease;
}

.history-link:hover, .back-link:hover {
    background-color: #0056b3;
    transform: translateY(-1px);
}
.history-link:active, .back-link:active {
    transform: translateY(0);
}


/* --- 优化历史会话表格样式 --- */
/* 注意：表格样式已被卡片样式取代，但为防止意外，保留注释 */
/*
#sessionTable {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    display: block;
    overflow-x: auto;
    white-space: nowrap;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

#sessionTable thead, #sessionTable tbody, #sessionTable th, #sessionTable td, #sessionTable tr {
    display: table-row;
}

#sessionTable th, #sessionTable td {
    border: none;
    padding: 12px 15px;
    text-align: left;
    white-space: normal;
    vertical-align: middle;
}

#sessionTable th {
    background-color: #e9ecef;
    color: #495057;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 1;
    border-bottom: 2px solid #dee2e6;
}

#sessionTable thead th:first-child {
    border-top-left-radius: 8px;
}
#sessionTable thead th:last-child {
    border-top-right-radius: 8px;
}


#sessionTable tr:nth-child(even) {
    background-color: #f8f9fa;
}

#sessionTable tr:hover {
    background-color: #e2f0ff;
    transition: background-color 0.2s ease;
}

#sessionTable td button {
    padding: 8px 15px;
    font-size: 0.85em;
    margin-right: 8px;
    border-radius: 4px;
    transition: background-color 0.3s ease, transform 0.1s ease;
}

#sessionTable td button:hover {
    transform: translateY(-1px);
}

#sessionTable td button.delete-button-table {
    background-color: #dc3545;
}

#sessionTable td button.delete-button-table:hover {
    background-color: #c82333;
}
*/
/* --- 新增卡片列表样式 --- */
.session-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); /* 响应式列，最小280px */
    gap: 20px; /* 卡片间距 */
    margin-top: 20px;
}

.session-card {
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.session-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.session-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
}

.session-card .card-title {
    margin: 0;
    font-size: 1.2em;
    color: #34495e;
    flex-grow: 1;
}

.session-card .card-status {
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.85em;
    font-weight: bold;
    color: white;
}

/* 状态颜色 */
.session-card .card-status.status-draft {
    background-color: #ffc107; /* 黄色 */
}
.session-card .card-status.status-ready {
    background-color: #28a745; /* 绿色 */
}
.session-card .card-status.status-submitted {
    background-color: #007bff; /* 蓝色 */
}

.session-card .card-body {
    margin-bottom: 15px;
}

.session-card .card-detail-item {
    margin: 5px 0;
    font-size: 0.95em;
    color: #555;
    word-break: break-all; /* 允许长ID换行 */
}

.session-card .card-actions {
    display: flex;
    justify-content: flex-end; /* 按钮右对齐 */
    gap: 10px; /* 按钮间距 */
    margin-top: 10px;
}

.session-card .card-actions button {
    padding: 8px 15px;
    font-size: 0.9em;
    margin-right: 0; /* 覆盖默认的margin-right */
}
.session-card .card-actions .delete-session-btn {
    background-color: #dc3545;
}
.session-card .card-actions .delete-session-btn:hover {
    background-color: #c82333;
}


#sessionListStatus {
    text-align: center;
    margin-top: 20px;
    color: #666;
}

#sessionDetailSection h2 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #34495e;
}

#sessionDetailSection p {
    margin-bottom: 8px;
    font-size: 1.1em;
}

#sessionDetailSection .photo-grid {
    margin-top: 25px;
}

#detailPhotos .photo-item {
    border: 2px solid transparent;
}

#detailPhotos .photo-item.selected {
    border-color: #07c160;
}

#detailPhotos .photo-item .selected-indicator {
    position: absolute;
    top: 5px;
    left: 5px;
    background-color: #07c160;
    color: white;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    line-height: 25px;
    text-align: center;
    font-size: 0.8em;
    font-weight: bold;
    display: none;
}

#detailPhotos .photo-item.selected .selected-indicator {
    display: block;
}

#backToListBtn {
    margin-bottom: 20px;
    background-color: #6c757d;
}

#backToListBtn:hover {
    background-color: #5a6268;
}

/* --- 优化筛选和搜索控件样式 --- */
.filter-controls {
    display: flex;
    gap: 15px; /* 增加间距 */
    margin-bottom: 25px; /* 增加底部间距 */
    flex-wrap: wrap;
    align-items: center;
    padding: 15px; /* 增加内边距 */
    background-color: #f8f9fa; /* 浅背景色 */
    border-radius: 8px; /* 圆角 */
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05); /* 内部阴影 */
}

.filter-controls input[type="text"],
.filter-controls select {
    padding: 10px 15px; /* 增加内边距 */
    border: 1px solid #ced4da; /* 边框颜色 */
    border-radius: 6px; /* 更大圆角 */
    font-size: 1em; /* 调整字体大小 */
    flex-grow: 1;
    min-width: 180px; /* 最小宽度 */
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.075); /* 内部阴影 */
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.filter-controls input[type="text"]:focus,
.filter-controls select:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    outline: none;
}

.filter-controls button {
    padding: 10px 20px; /* 调整按钮内边距 */
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 6px; /* 更大圆角 */
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s ease, transform 0.1s ease;
}

.filter-controls button:hover {
    background-color: #0056b3;
    transform: translateY(-1px);
}

/* --- 优化分页控件样式 --- */
.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 30px; /* 增加顶部间距 */
    gap: 20px; /* 增加间距 */
    flex-wrap: wrap;
}

.pagination-controls button {
    padding: 10px 20px; /* 调整按钮内边距 */
    background-color: #6c757d;
    color: white;
    border: none;
    border-radius: 6px; /* 更大圆角 */
    cursor: pointer;
    font-size: 0.95em;
    transition: background-color 0.3s ease, transform 0.1s ease;
}

.pagination-controls button:hover:not(:disabled) {
    background-color: #5a6268;
    transform: translateY(-1px);
}

.pagination-controls button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
    transform: none;
}

#pageInfo {
    font-size: 1.2em; /* 增大字体 */
    font-weight: bold;
    color: #333;
    min-width: 150px; /* 确保有足够空间显示 */
    text-align: center;
}

/* 历史会话表格列宽 (这些现在不再直接作用于表格，但保留作为参考) */
/*
#sessionTable th:nth-child(1), #sessionTable td:nth-child(1) { min-width: 100px; }
#sessionTable th:nth-child(2), #sessionTable td:nth-child(2) { min-width: 120px; }
#sessionTable th:nth-child(3), #sessionTable td:nth-child(3) { min-width: 80px; }
#sessionTable th:nth-child(4), #sessionTable td:nth-child(4) { min-width: 80px; }
#sessionTable th:nth-child(5), #sessionTable td:nth-child(5) { min-width: 150px; }
#sessionTable th:nth-child(6), #sessionTable td:nth-child(6) { min-width: 150px; }
*/

#sessionDetailSection p span {
    font-weight: bold;
    color: #34495e;
}

.append-photos-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.append-photos-section h3 {
    color: #34495e;
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.4em;
}

.append-photos-section input[type="file"] {
    display: block;
    margin-bottom: 15px;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 5px;
    width: calc(100% - 18px);
}

.append-photos-section button {
    background-color: #28a745;
    color: white;
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s ease, transform 0.1s ease;
}

.append-photos-section button:hover {
    background-color: #218838;
    transform: translateY(-1px);
}

#appendUploadStatus {
    margin-top: 10px;
    font-weight: bold;
    color: #333;
}

.photo-display-filter {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 30px;
    margin-bottom: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    flex-wrap: wrap;
}

.photo-display-filter h3 {
    margin: 0;
    font-size: 1.4em;
    color: #34495e;
}

.photo-display-filter select {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 0.95em;
    min-width: 180px;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    padding-top: 60px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
}

.modal-content {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 800px;
    max-height: 90vh;
    object-fit: contain;
}

.close-button {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}

.close-button:hover,
.close-button:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}

.delete-button {
    background-color: #dc3545;
    margin-left: 10px;
}

.delete-button:hover {
    background-color: #c82333;
}

.detail-actions {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-top: 20px;
}

/* Progress Bar Styles */
.progress-bar-container {
    width: 100%;
    background-color: #e0e0e0; /* 进度条背景色 */
    border-radius: 5px;
    margin-top: 10px;
    overflow: hidden; /* 确保内部进度条不溢出圆角 */
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1); /* 内部阴影 */
}

.progress-bar {
    width: 0%; /* 初始宽度为0 */
    height: 25px; /* 进度条高度 */
    background-color: #4CAF50; /* 进度条填充色 */
    border-radius: 5px;
    text-align: center;
    line-height: 25px; /* 使文本垂直居中 */
    color: white;
    font-weight: bold;
    font-size: 0.9em;
    transition: width 0.3s ease-in-out; /* 平滑过渡动画 */
    white-space: nowrap; /* 防止百分比文本换行 */
}

.progress-bar span {
    /* 混合模式确保文本在背景色变化时始终可见 */
    mix-blend-mode: difference;
}


/* --- 客户选片页面样式 (Client Selection Page Styles) --- */
.client-container {
    max-width: 1200px; /* 客户页面可以更宽一些 */
    margin: 30px auto;
    background-color: #ffffff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.client-container h1 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 30px;
    font-size: 2.2em;
}

.client-message {
    text-align: center;
    padding: 40px 20px;
    font-size: 1.2em;
    color: #555;
    background-color: #f0f8ff;
    border: 1px solid #cceeff;
    border-radius: 8px;
    margin-bottom: 20px;
}

.client-message .error-text {
    color: #dc3545;
    font-weight: bold;
}

.client-message .client-btn {
    background-color: #007bff;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    margin-top: 15px;
    transition: background-color 0.3s ease;
}

.client-message .client-btn:hover {
    background-color: #0056b3;
}

/* 新增：客户照片筛选器样式 */
.client-filter-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

.client-filter-controls h3 {
    margin: 0;
    font-size: 1.1em;
    color: #34495e;
}

.client-filter-controls select {
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 1em;
    flex-grow: 1; /* 允许选择框占据更多空间 */
    min-width: 150px;
}


.client-photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); /* 桌面端多列 */
    gap: 15px;
    margin-top: 20px;
}

.client-photo-item {
    display: flex; /* 使用 flex 布局 */
    flex-direction: column; /* 垂直排列 */
    border: 3px solid #ddd; /* 默认边框 */
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease; /* 添加背景色过渡 */
    background-color: #f8f8f8; /* 确保有背景色 */
}

.client-photo-item.selected {
    border-color: #007bff; /* 选中照片的蓝色边框 */
    box-shadow: 0 5px 15px rgba(0, 123, 255, 0.3); /* 蓝色阴影 */
    background-color: rgba(0, 123, 255, 0.05); /* 整个卡片浅蓝色背景 */
}

.client-photo-wrapper {
    width: 100%;
    padding-top: 100%; /* 保持正方形比例 */
    position: relative;
    flex-shrink: 0; /* 不压缩 */
}

.client-photo-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    cursor: zoom-in; /* 鼠标悬停时显示放大镜 */
}

/* 选中时的半透明覆盖层 */
.client-selected-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 123, 255, 0.3); /* 改为半透明蓝色 */
    display: none; /* 默认隐藏 */
    z-index: 4; /* 在图片上方，在勾选标记下方 */
}

.client-photo-item.selected .client-selected-overlay {
    display: block; /* 选中时显示 */
}


.client-selected-indicator {
    position: absolute;
    top: 8px;
    left: 8px;
    background-color: #07c160;
    color: white;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    line-height: 30px;
    text-align: center;
    font-size: 1.2em;
    font-weight: bold;
    display: none; /* 默认隐藏 */
    z-index: 5;
}

.client-photo-item.selected .client-selected-indicator {
    display: block; /* 选中时显示 */
}

/* 新增：选择按钮样式 */
.client-select-btn {
    width: 100%;
    padding: 10px 0;
    background-color: #4CAF50; /* 绿色 */
    color: white;
    border: none;
    border-radius: 0 0 8px 8px; /* 底部圆角 */
    cursor: pointer;
    font-size: 0.95em;
    font-weight: bold;
    transition: background-color 0.2s ease;
    flex-shrink: 0; /* 不压缩 */
}

.client-select-btn:hover {
    background-color: #45a049;
}

.client-select-btn[disabled] {
    background-color: #cccccc;
    cursor: not-allowed;
}

.client-photo-item.selected .client-select-btn {
    background-color: #dc3545; /* 选中后变为红色取消选择 */
}

.client-photo-item.selected .client-select-btn:hover {
    background-color: #c82333;
}


/* 底部操作栏 */
.client-bottom-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #ffffff;
    border-top: 1px solid #eee;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    box-sizing: border-box;
    z-index: 100;
}

.client-selected-count {
    font-size: 1.2em;
    font-weight: bold;
    color: #333;
}

.client-submit-btn {
    background-color: #007bff;
    color: white;
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1em;
    transition: background-color 0.3s ease, transform 0.1s ease;
}

.client-submit-btn:hover:not(:disabled) {
    background-color: #0056b3;
    transform: translateY(-1px);
}

.client-submit-btn:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
    transform: none;
}

/* --- 响应式调整 for Client Page --- */
@media (max-width: 768px) {
    .client-container {
        padding: 20px;
        margin: 15px auto;
    }
    .client-container h1 {
        font-size: 1.8em;
        margin-bottom: 20px;
    }
    .client-filter-controls {
        flex-direction: column; /* 垂直堆叠 */
        align-items: flex-start;
        gap: 10px;
        padding: 10px;
    }
    .client-filter-controls h3 {
        width: 100%;
        text-align: left;
    }
    .client-filter-controls select {
        width: 100%;
        min-width: unset; /* 移除最小宽度限制 */
    }
    .client-photo-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); /* 平板两列 */
        gap: 10px;
    }
    .client-photo-item {
        border-width: 2px;
    }
    .client-selected-indicator {
        width: 25px;
        height: 25px;
        line-height: 25px;
        font-size: 1em;
    }
    .client-bottom-bar {
        padding: 10px 20px;
    }
    .client-selected-count {
        font-size: 1em;
    }
    .client-submit-btn {
        padding: 10px 20px;
        font-size: 1em;
    }
    .client-select-btn {
        padding: 8px 0;
        font-size: 0.85em;
    }
}

@media (max-width: 480px) {
    .client-container {
        padding: 15px;
        margin: 10px auto;
    }
    .client-container h1 {
        font-size: 1.5em;
        margin-bottom: 15px;
    }
    .client-photo-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); /* 手机两列 */
        gap: 8px;
    }
    .client-photo-item {
        border-width: 2px;
    }
    .client-selected-indicator {
        width: 20px;
        height: 20px;
        line-height: 20px;
        font-size: 0.9em;
    }
    .client-bottom-bar {
        flex-direction: column; /* 手机上堆叠 */
        padding: 10px 15px;
        gap: 10px;
    }
    .client-submit-btn {
        width: 100%; /* 手机上提交按钮全宽 */
        margin-top: 5px;
    }
    .client-select-btn {
        padding: 6px 0;
        font-size: 0.8em;
    }
}

/* 新样式：复制链接按钮 */
.copy-link-btn, .copy-client-link-btn {
    background-color: #17a2b8; /* 信息蓝色 */
    margin-top: 10px; /* 在主页的按钮下方留出间距 */
}

.copy-link-btn:hover, .copy-client-link-btn:hover {
    background-color: #138496;
}

/* 调整卡片内按钮的间距和大小 */
.session-card .card-actions button {
    margin-right: 0; /* 覆盖默认的margin-right */
}
.session-card .card-actions .copy-client-link-btn {
    /* 针对卡片内复制链接按钮的特定样式，如果需要 */
}

/* --- 作品集管理区样式 (index.html) --- */
.portfolio-info {
    padding: 5px;
    text-align: center;
    background-color: #f0f0f0;
    font-size: 0.9em;
    flex-grow: 1; /* 占据剩余空间 */
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 40px; /* 确保信息区域有最小高度 */
}

.portfolio-info .portfolio-title {
    margin: 0;
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.portfolio-info .portfolio-category {
    margin: 0;
    font-size: 0.8em;
    color: #666;
}

.delete-portfolio-btn {
    /* 继承 delete-photo-btn 样式 */
}

/* 作品集上传表单的 textarea */
textarea#portfolioDescriptionInput {
    width: calc(100% - 18px); /* 默认占据父容器宽度 */
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 5px;
    margin-bottom: 15px;
    box-sizing: border-box;
    min-height: 80px; /* 最小高度 */
    resize: vertical; /* 允许垂直拖拽 */
}


/* --- 客户作品展示页面样式 (portfolio.html) --- */
.portfolio-filter-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

.portfolio-filter-controls h3 {
    margin: 0;
    font-size: 1.1em;
    color: #34495e;
}

.portfolio-filter-controls select {
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 1em;
    flex-grow: 1;
    min-width: 150px;
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); /* 响应式列 */
    gap: 20px;
    margin-top: 20px;
}

.portfolio-item-card {
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.portfolio-item-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.portfolio-card-image {
    width: 100%;
    height: 200px; /* 固定图片高度 */
    object-fit: cover;
    display: block;
}

.portfolio-card-info {
    padding: 15px;
    flex-grow: 1; /* 占据剩余空间 */
    display: flex;
    flex-direction: column;
}

.portfolio-card-title {
    margin-top: 0;
    margin-bottom: 5px;
    font-size: 1.2em;
    color: #34495e;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.portfolio-card-category {
    margin-bottom: 5px;
    font-size: 0.9em;
    color: #6c757d;
}

.portfolio-card-description {
    font-size: 0.9em;
    color: #555;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3; /* 限制描述显示3行 */
    -webkit-box-orient: vertical;
}


/* --- 响应式调整 (Mobile-First Overrides) --- */

/* ... (之前的媒体查询，确保新元素也响应式) ... */

@media (max-width: 768px) {
    /* ... (现有样式) ... */
    .portfolio-filter-controls {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 10px;
    }
    .portfolio-filter-controls h3,
    .portfolio-filter-controls select {
        width: 100%;
        min-width: unset;
    }
    .portfolio-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); /* 平板两列 */
        gap: 15px;
    }
    .portfolio-item-card {
        padding: 0; /* 移除内边距，让图片和信息直接接触边缘 */
    }
    .portfolio-card-image {
        height: 150px; /* 调整图片高度 */
    }
    .portfolio-card-info {
        padding: 10px;
    }
    .portfolio-card-title {
        font-size: 1.1em;
    }
    .portfolio-card-category,
    .portfolio-card-description {
        font-size: 0.85em;
    }
}

@media (max-width: 480px) {
    /* ... (现有样式) ... */
    .portfolio-grid {
        grid-template-columns: 1fr; /* 手机单列 */
        gap: 15px;
    }
    .portfolio-card-image {
        height: 200px; /* 手机单列图片可以高一些 */
    }
    .portfolio-card-info {
        padding: 10px;
    }
    .portfolio-card-title {
        font-size: 1.1em;
    }
    .portfolio-card-category,
    .portfolio-card-description {
        font-size: 0.85em;
    }
}

/* 新样式：复制链接按钮 */
.copy-link-btn, .copy-client-link-btn {
    background-color: #17a2b8; /* 信息蓝色 */
    margin-top: 10px; /* 在主页的按钮下方留出间距 */
}

.copy-link-btn:hover, .copy-client-link-btn:hover {
    background-color: #138496;
}

/* 调整卡片内按钮的间距和大小 */
.session-card .card-actions button {
    margin-right: 0; /* 覆盖默认的margin-right */
}
.session-card .card-actions .copy-client-link-btn {
    /* 针对卡片内复制链接按钮的特定样式，如果需要 */
}

/* --- 作品集管理区样式 (portfolio-admin.html) --- */
.portfolio-upload-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.portfolio-upload-controls label {
    font-weight: bold;
    color: #555;
    margin-bottom: 5px;
}

.portfolio-upload-controls select,
.portfolio-upload-controls input[type="text"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box;
}

.portfolio-admin-filter-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

.portfolio-admin-filter-controls h3 {
    margin: 0;
    font-size: 1.1em;
    color: #34495e;
}

.portfolio-admin-filter-controls select {
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 1em;
    flex-grow: 1;
    min-width: 150px;
}

/* 针对 portfolio-item 的信息显示 */
.portfolio-item .portfolio-info {
    padding: 5px;
    text-align: center;
    background-color: #f0f0f0;
    font-size: 0.9em;
    flex-grow: 1; /* 占据剩余空间 */
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 40px; /* 确保信息区域有最小高度 */
}

.portfolio-item .portfolio-title {
    margin: 0;
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.portfolio-item .portfolio-category {
    margin: 0;
    font-size: 0.8em;
    color: #666;
}

.delete-portfolio-btn {
    /* 继承 delete-photo-btn 样式 */
}


/* --- 客户作品展示页面样式 (portfolio.html) --- */
.portfolio-filter-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

.portfolio-filter-controls h3 {
    margin: 0;
    font-size: 1.1em;
    color: #34495e;
}

.portfolio-filter-controls select {
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 1em;
    flex-grow: 1;
    min-width: 150px;
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); /* 响应式列 */
    gap: 20px;
    margin-top: 20px;
}

.portfolio-item-card {
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.portfolio-item-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.portfolio-card-image {
    width: 100%;
    height: 200px; /* 固定图片高度 */
    object-fit: cover;
    display: block;
}

.portfolio-card-info {
    padding: 15px;
    flex-grow: 1; /* 占据剩余空间 */
    display: flex;
    flex-direction: column;
}

.portfolio-card-title {
    margin-top: 0;
    margin-bottom: 5px;
    font-size: 1.2em;
    color: #34495e;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.portfolio-card-category {
    margin-bottom: 5px;
    font-size: 0.9em;
    color: #6c757d;
}

.portfolio-card-description {
    font-size: 0.9em;
    color: #555;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3; /* 限制描述显示3行 */
    -webkit-box-orient: vertical;
}


/* --- 响应式调整 (Mobile-First Overrides) --- */

/* ... (之前的媒体查询，确保新元素也响应式) ... */

@media (max-width: 768px) {
    /* ... (现有样式) ... */
    .portfolio-upload-controls {
        gap: 5px;
    }
    .portfolio-upload-controls select,
    .portfolio-upload-controls input[type="text"] {
        padding: 8px;
    }
    .portfolio-admin-filter-controls {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 10px;
    }
    .portfolio-admin-filter-controls h3,
    .portfolio-admin-filter-controls select {
        width: 100%;
        min-width: unset;
    }
    .portfolio-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); /* 平板两列 */
        gap: 15px;
    }
    .portfolio-item-card {
        padding: 0; /* 移除内边距，让图片和信息直接接触边缘 */
    }
    .portfolio-card-image {
        height: 150px; /* 调整图片高度 */
    }
    .portfolio-card-info {
        padding: 10px;
    }
    .portfolio-card-title {
        font-size: 1.1em;
    }
    .portfolio-card-category,
    .portfolio-card-description {
        font-size: 0.85em;
    }
}

@media (max-width: 480px) {
    /* ... (现有样式) ... */
    .portfolio-grid {
        grid-template-columns: 1fr; /* 手机单列 */
        gap: 15px;
    }
    .portfolio-card-image {
        height: 200px; /* 手机单列图片可以高一些 */
    }
    .portfolio-card-info {
        padding: 10px;
    }
    .portfolio-card-title {
        font-size: 1.1em;
    }
    .portfolio-card-category,
    .portfolio-card-description {
        font-size: 0.85em;
    }
}

/* 新增：分类标签容器样式 */
.category-tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px; /* 标签之间的间距 */
    margin-top: 10px;
}

/* 新增：分类标签按钮样式 */
.category-tag-button {
    background-color: #e0e0e0; /* 默认标签背景色 */
    color: #333;
    padding: 8px 15px;
    border: none;
    border-radius: 20px; /* 圆角，使其看起来像药丸 */
    cursor: pointer;
    font-size: 0.9em;
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.1s ease;
}

.category-tag-button:hover {
    background-color: #c0c0c0;
    transform: translateY(-1px);
}

.category-tag-button.active {
    background-color: #007bff; /* 选中标签的背景色 */
    color: white;
    font-weight: bold;
}

.category-tag-button.active:hover {
    background-color: #0056b3;
}

/* 响应式调整 for portfolio-filter-controls */
@media (max-width: 768px) {
    .portfolio-filter-controls {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 10px;
    }
    .portfolio-filter-controls h3 {
        width: 100%;
        text-align: left;
    }
    .category-tags-container {
        width: 100%;
        justify-content: flex-start; /* 小屏幕上标签左对齐 */
    }
}
