/* 黑白简约线条风格样式 */
:root {
    --bg: #ffffff;
    --fg: #000000;
    --muted: #666666;
    --accent: #000000;
    --border: #000000;
    --light-border: #cccccc;
    --hover-bg: #f5f5f5;
}

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

body {
    font-family: 'Arial', sans-serif;
    background-color: var(--bg);
    color: var(--fg);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 头部样式 */
header {
    text-align: center;
    margin-bottom: 30px;
    border-bottom: 2px solid #000000;
    padding-bottom: 15px;
}

header h1 {
    font-size: 2.5rem;
    font-weight: bold;
    color: #000000;
}

/* 表格区域样式 */
.table-section {
    margin-bottom: 30px;
}

.table-wrapper {
    /* JavaScript will control the layout dynamically */
    margin: 20px auto;
    max-width: none; /* 移除最大宽度限制 */
    padding: 0 20px;
}

.category-table {
    border: 2px solid #000000;
    border-radius: 5px;
    padding: 6px;
    background-color: #ffffff;
    min-width: 100px;
    max-width: 300px;  /* 调整类别表格容器宽度为300px */
    flex: 1 1 300px;  /* 调整flex基础宽度为300px */
}

.rating-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.rating-table th {
    background-color: #000000;
    color: #ffffff;
    padding: 6px 4px;
    text-align: left;
    font-weight: bold;
    border-bottom: 2px solid #000000;
    font-size: 16px;
}

.rating-table th:first-child {
    width: auto; /* 使用自动宽度，让内容决定 */
    padding-right: 3px;
}

.rating-table th:last-child {
    width: 120px; /* 增加喜欢程度列表头宽度 */
    padding-left: 3px;
}

.rating-table td {
    padding: 6px 4px;
    border-bottom: 1px solid #cccccc;
    font-size: 16px;
}

.rating-table td:last-child {
    width: 120px; /* 增加喜欢程度列内容容器宽度 */
}

.rating-table tr:last-child td {
    border-bottom: none;
}

/* M的简介表格特殊样式 - 两列表格 */
.m-intro-table .rating-table th:first-child,
.m-intro-table .rating-table td:first-child {
    width: 40%;
}

.m-intro-table .rating-table th:last-child,
.m-intro-table .rating-table td:last-child {
    width: 60%;
}

.m-intro-table .rating-table input[type="text"],
.m-intro-table .rating-table select {
    width: 100%;
    max-width: 100%; /* 限制输入框宽度不超过表容器 */
    padding: 4px 6px;
    font-size: 14px;
    box-sizing: border-box;
    border: 1px solid #ccc;
    border-radius: 3px;
}

/* 选择框样式 */
select.rating {
    width: 100%;
    padding: 6px;
    border: 1px solid #000000;
    border-radius: 3px;
    background-color: #ffffff;
    color: #000000;
    font-size: 12px;
    cursor: pointer;
}

select.rating:focus {
    outline: none;
    border-color: #666666;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
}

select.rating option {
    background-color: #ffffff;
    color: #000000;
}

/* 输入框样式 */
.input-field {
    width: 100%;
    padding: 4px 6px;
    font-size: 14px;
    box-sizing: border-box;
    border: 1px solid #ccc;
    border-radius: 3px;
    max-width: 100%; /* 确保在小屏幕上不超出容器 */
    transition: border-color 0.2s ease;
}

/* 输入框焦点样式 */
.input-field:focus,
.textarea-field:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 5px rgba(102, 126, 234, 0.5);
}

/* 文本域样式 */
.textarea-field {
    width: 100%;
    padding: 8px 10px;
    font-size: 14px;
    box-sizing: border-box;
    border: 1px solid #ccc;
    border-radius: 3px;
    resize: vertical;
    max-width: 100%; /* 确保在小屏幕上不超出容器 */
    min-height: 80px;
    font-family: Arial, sans-serif;
}

/* 响应式设计 - 小屏幕优化 */
@media (max-width: 768px) {
    .textarea-field {
        font-size: 16px; /* 手机端字体更大 */
    }
}

/* 响应式设计 - 小屏幕优化 */
@media (max-width: 768px) {
    .rating-table {
        width: 100%;
        overflow-x: auto;
    }

    .rating-table td {
        white-space: nowrap;
    }

    .input-field {
        font-size: 16px; /* 手机端字体更大 */
    }
}

/* 按钮容器样式 */
.button-container {
    text-align: center;
    margin: 30px 0;
}

#saveBtn {
    background-color: #000000;
    color: #ffffff;
    border: 2px solid #000000;
    padding: 12px 30px;
    font-size: 16px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

#saveBtn:hover {
    background-color: #ffffff;
    color: #000000;
}

#saveBtn:disabled {
    background-color: #cccccc;
    border-color: #cccccc;
    cursor: not-allowed;
}

/* 底部导航样式 */
.bottom-nav {
    display: flex;
    justify-content: center;
    gap: 0;
    padding: 0;
    border-top: 1.5px solid var(--border);
    background: var(--bg);
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
}

.nav-button {
    padding: 10px 20px;
    border: 1px solid #000000;
    border-radius: 5px;
    text-decoration: none;
    color: #000000;
    transition: all 0.3s ease;
}

.nav-button:hover,
.nav-button.active {
    background-color: #000000;
    color: #ffffff;
}

/* 其他页面的导航样式 - 仅文字 */
.nav-text {
    display: block;
    padding: 8px 16px;
    text-decoration: none;
    color: var(--muted);
    font-size: 12px;
    transition: all 0.2s;
    border-bottom: 1.5px solid transparent;
    margin-bottom: -1.5px;
}

.nav-text:hover {
    color: var(--fg);
}

.nav-text.active {
    color: var(--fg);
    font-weight: bold;
    border-bottom-color: var(--fg);
}

/* 页脚样式 */
footer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 40px;
    padding: 20px;
    border-top: 1px solid #cccccc;
    color: #666666;
    flex-wrap: wrap;
}

footer a {
    color: #666666;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* 统计信息样式 */
.stats-display {
    font-size: 14px;
    color: #666666;
}

#stats-container {
    display: flex;
    gap: 20px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.stat-label {
    font-weight: normal;
}

.stat-value {
    font-weight: bold;
}

.stat-unit {
    font-weight: normal;
}

/* 预览窗口样式 */
.preview-window {
    margin: 0;
    padding: 20px;
    text-align: center;
    background: #f5f5f5;
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}

.preview-container {
    max-width: 100%;
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.preview-image {
    max-width: 100%;
    height: auto;
    border: 1px solid #ddd;
    border-radius: 5px;
}

/* 图片生成容器样式 */
.image-generate-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 20px;
    background: #ffffff;
    font-family: 'Arial', sans-serif;
    color: #000000;
    z-index: 9999;
    border-radius: 10px;
    border: 2px solid #000000;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.image-generate-title {
    text-align: center;
    font-size: 36px;
    margin-bottom: 30px;
    border-bottom: 3px solid #000000;
    padding-bottom: 15px;
    font-weight: bold;
}

.image-generate-categories {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.image-generate-category-table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
    border: 2px solid #000000;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 0;
}

.image-generate-category-table thead th {
    background: #000000;
    color: #ffffff;
    padding: 12px 12px;
    text-align: center;
    font-weight: bold;
    font-size: 14px;
    border: 1px solid #333333;
    min-width: 120px;
}

.image-generate-category-table tbody td {
    padding: 8px 6px;
    text-align: left;
    border: 1px solid #cccccc;
    font-size: 12px;
    font-weight: 600;
    width: 40%;
}

.image-generate-category-table tbody td:nth-child(2) {
    background: #f9f9f9;
    font-weight: bold;
    width: 60%;
    text-align: center;
}

.image-generate-footer {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #cccccc;
    font-size: 14px;
    color: #666666;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
}

.image-generate-footer .watermark {
    font-weight: bold;
    font-size: 16px;
    color: #000000;
    opacity: 0.3;
}

/* 提示样式已移除，不再使用 */

.preview-save-btn {
    border: none;
    padding: 12px 24px;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    margin: 10px;
    color: white;
}

.preview-save-btn.qq {
    background: #12b7f5;
}

.preview-save-btn.wechat {
    background: #07c160;
}

.preview-save-btn.safari {
    background: #007bff;
}



/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    .table-wrapper {
        flex-direction: column;
    }

    .category-table {
        min-width: 100px;
        max-width: 300px;  /* 调整单列显示时的宽度为300px */
        flex: 1 1 300px;  /* 调整flex基础宽度为300px */
    }

    header h1 {
        font-size: 2rem;
    }

    .bottom-nav {
        flex-wrap: wrap;
    }

    select.rating {
        font-size: 16px; /* 手机端字体更大 */
    }
}

/* 页脚样式 */
.footer {
    text-align: center;
    padding: 20px;
    margin-top: auto;
    background-color: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

/* 统计信息显示 */
.stats-display {
    margin-left: 10px;
    font-size: 12px;
    color: #6c757d;
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.5rem;
    }

    .category-table {
        padding: 10px;
        max-width: 100%; /* 小屏手机上表格宽度100% */
    }

    .rating-table th,
    .rating-table td {
        padding: 8px;
        font-size: 14px;
    }

    #saveBtn {
        width: 100%;
        padding: 15px;
    }

    /* 修复身高体重选择框在小屏手机上的显示 */
    .input-field {
        width: 100%;
        box-sizing: border-box;
    }
}
