/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    font-size: 14px;
    line-height: 1.5;
}

body {
    padding-bottom: env(safe-area-inset-bottom);
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-top: 50px;
    margin-left: 10px;
    margin-right: 10px;
}

h1 {
    color: #333;
    margin-bottom: 10px;
    font-size: 1.5rem;
}

h2 {
    font-size: 1.25rem;
}

h3 {
    font-size: 1.1rem;
}

p {
    color: #666;
    margin-bottom: 20px;
}

.info-tip {
    background-color: #f0f5ff;
    border: 1px solid #adc6ff;
    border-radius: 4px;
    padding: 15px;
    color: #2f54eb;
    text-align: center;
    margin: 20px 0;
    font-size: 13px;
}

.button-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
}

button {
    padding: 14px 20px;
    background-color: #1989fa;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

button:active {
    opacity: 0.8;
    transform: scale(0.98);
}

button:hover {
    background-color: #07c160;
}

/* 登录页面样式 */
.login-container {
    max-width: 400px;
    margin: 0 auto;
    padding: 20px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-top: 60px;
    margin-left: 10px;
    margin-right: 10px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 600;
    font-size: 14px;
    color: #333;
}

.form-group input {
    padding: 12px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    min-height: 44px;
    -webkit-appearance: none;
}

.form-group input:focus {
    outline: none;
    border-color: #1989fa;
    box-shadow: 0 0 0 2px rgba(25, 137, 250, 0.2);
}

.login-form button {
    margin-top: 10px;
    width: 100%;
}

/* 问卷列表样式 */
.survey-list {
    margin-top: 15px;
}

.survey-item {
    padding: 15px;
    border-bottom: 1px solid #eee;
    background-color: white;
    border-radius: 8px;
    margin-bottom: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.survey-item:hover {
    background-color: #fafafa;
}

.survey-title {
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 15px;
    color: #333;
}

.survey-description {
    color: #666;
    font-size: 13px;
    margin-bottom: 10px;
    line-height: 1.5;
}

.survey-info {
    font-size: 12px;
    color: #999;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.survey-status {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.survey-status.completed {
    background-color: #f6ffed;
    color: #52c41a;
    border: 1px solid #b7eb8f;
}

.survey-status.pending {
    background-color: #fff7e6;
    color: #fa8c16;
    border: 1px solid #ffd591;
}

/* 问卷详情样式 */
.question {
    margin-bottom: 16px;
    padding: 16px;
    border: 1px solid #eee;
    border-radius: 8px;
    background-color: white;
}

.question-title {
    font-weight: 600;
    margin-bottom: 12px;
    font-size: 15px;
    line-height: 1.5;
}

.question-number {
    display: inline-block;
    background-color: #1989fa;
    color: white;
    width: 24px;
    height: 24px;
    line-height: 24px;
    text-align: center;
    border-radius: 50%;
    font-size: 12px;
    margin-right: 8px;
    flex-shrink: 0;
}

.question-content {
    display: flex;
    align-items: flex-start;
}

.option {
    margin-bottom: 12px;
    padding: 10px 12px;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    min-height: 44px;
}

.option:hover {
    border-color: #1989fa;
    background-color: #f0f7ff;
}

.option.selected {
    border-color: #1989fa;
    background-color: #e6f7ff;
}

.option input[type="radio"],
.option input[type="checkbox"] {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.option-text {
    flex: 1;
    font-size: 14px;
    line-height: 1.5;
}

/* 个人中心样式 */
.user-info {
    margin-top: 15px;
}

.user-info-item {
    margin-bottom: 12px;
    padding: 14px;
    background-color: #f9f9f9;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-info-label {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.user-info-value {
    color: #666;
    font-size: 14px;
}

/* 提交按钮 */
.submit-button {
    margin-top: 20px;
    padding: 14px 20px;
    background-color: #1989fa;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    width: 100%;
    min-height: 48px;
    touch-action: manipulation;
}

.submit-button:hover {
    background-color: #07c160;
}

.submit-button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* 错误提示 */
.error-message {
    color: #ff4d4f;
    margin-top: 10px;
    padding: 10px;
    background-color: #fff2f0;
    border: 1px solid #ffccc7;
    border-radius: 4px;
    font-size: 13px;
}

/* 成功提示 */
.success-message {
    color: #52c41a;
    margin-top: 10px;
    padding: 10px;
    background-color: #f6ffed;
    border: 1px solid #b7eb8f;
    border-radius: 4px;
    font-size: 13px;
}

/* 加载中 */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100px;
}

.loading::after {
    content: '';
    width: 24px;
    height: 24px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 查看报告按钮 */
.view-report-btn {
    margin-top: 10px;
    padding: 10px 16px;
    background-color: #52c41a;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    width: 100%;
    min-height: 40px;
    touch-action: manipulation;
}

.view-report-btn:hover {
    background-color: #73d13d;
}

/* 报告展示样式 */
.report-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: none;
    justify-content: center;
    align-items: flex-start;
    z-index: 1000;
    overflow-y: auto;
    padding: 20px 10px;
    -webkit-overflow-scrolling: touch;
}

.report-content {
    background-color: white;
    padding: 24px 16px;
    border-radius: 12px;
    max-width: 600px;
    width: 100%;
    max-height: none;
    overflow-y: auto;
    position: relative;
    margin: auto 0;
    -webkit-overflow-scrolling: touch;
}

.close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 28px;
    background: none;
    border: none;
    cursor: pointer;
    color: #999;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    -webkit-tap-highlight-color: transparent;
}

.close-btn:hover {
    background-color: #f5f5f5;
    color: #333;
}

.report-header {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #1890ff;
}

.report-header h2 {
    color: #1890ff;
    margin: 0;
    font-size: 1.25rem;
}

.report-section {
    margin-bottom: 18px;
}

.report-section h3 {
    color: #333;
    font-size: 15px;
    margin-bottom: 10px;
    padding-left: 10px;
    border-left: 3px solid #1890ff;
}

.report-section p {
    margin: 8px 0;
    line-height: 1.6;
    font-size: 14px;
}

.feedback-text {
    line-height: 1.8;
    color: #555;
    font-size: 14px;
    text-align: justify;
}

.suggestions-list {
    padding-left: 20px;
}

.suggestions-list li {
    margin: 10px 0;
    line-height: 1.6;
    font-size: 14px;
}

.warm-tip {
    background-color: #fffbe6;
    border: 1px solid #ffe58f;
    border-radius: 8px;
    padding: 14px;
    margin: 15px 0;
    color: #d48806;
    font-size: 13px;
    line-height: 1.6;
}

.report-ending {
    background-color: #f0f5ff;
    border: 1px solid #adc6ff;
    border-radius: 8px;
    padding: 14px;
    margin-top: 20px;
    color: #2f54eb;
    font-size: 13px;
    text-align: center;
    line-height: 1.6;
}

/* 响应式设计 - 手机优先 */
@media (max-width: 768px) {
    .container {
        margin-top: 20px;
        padding: 16px;
        border-radius: 0;
        box-shadow: none;
    }

    .login-container {
        margin-top: 40px;
        border-radius: 0;
        box-shadow: none;
    }

    h1 {
        font-size: 1.4rem;
    }

    .button-group {
        gap: 10px;
    }

    button {
        width: 100%;
    }

    .question {
        padding: 14px;
        margin-bottom: 12px;
    }

    .question-title {
        font-size: 14px;
    }

    .option {
        padding: 12px;
        min-height: 44px;
    }

    .report-content {
        padding: 20px 14px;
        border-radius: 8px;
    }

    .report-section h3 {
        font-size: 14px;
    }

    .suggestions-list {
        padding-left: 16px;
    }

    .suggestions-list li {
        font-size: 13px;
    }
}

/* 隐藏表单 */
.hidden-form {
    display: none !important;
    visibility: hidden !important;
}

/* 管理后台样式 */
.tabs {
    display: flex;
    gap: 8px;
    margin: 15px 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 5px;
}

.tab-button {
    padding: 10px 16px;
    background-color: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    white-space: nowrap;
    flex-shrink: 0;
}

.tab-button:hover {
    background-color: #e0e0e0;
}

.tab-button.active {
    background-color: #1989fa;
    color: white;
    border-color: #1989fa;
}

.tab-content {
    margin-top: 15px;
}

.data-list {
    margin-top: 15px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-size: 13px;
    min-width: 600px;
}

.data-table thead {
    background-color: #f5f5f5;
}

.data-table th {
    padding: 10px 8px;
    text-align: left;
    border-bottom: 2px solid #ddd;
    font-weight: 600;
    white-space: nowrap;
}

.data-table td {
    padding: 10px 8px;
    border-bottom: 1px solid #ddd;
    white-space: nowrap;
}

.data-table tbody tr:hover {
    background-color: #f9f9f9;
}

.delete-button {
    padding: 6px 10px;
    background-color: #ff4d4f;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

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

/* 移动端优化 */
@media (max-width: 480px) {
    html {
        font-size: 13px;
    }

    .container {
        padding: 14px;
    }

    .login-container {
        padding: 16px;
    }

    .form-group input {
        padding: 12px;
        font-size: 16px;
    }

    button {
        padding: 14px 18px;
        font-size: 15px;
    }

    .survey-item {
        padding: 12px;
    }

    .question {
        padding: 12px;
    }

    .user-info-item {
        padding: 12px;
    }
}