/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

/* 头部样式 */
.header {
    background-color: #1a56db;
    color: white;
    padding: 2rem 1rem;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header h1 {
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
}

.header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* 容器样式 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* 登录/注册区域 */
.auth-container {
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    padding: 2rem;
    margin: 3rem auto;
}

.auth-tabs {
    display: flex;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.auth-tab {
    padding: 0.8rem 1.5rem;
    cursor: pointer;
    font-weight: 600;
    color: #64748b;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.auth-tab.active {
    color: #1a56db;
    border-bottom-color: #1a56db;
}

.auth-tab:hover:not(.active) {
    color: #334155;
    border-bottom-color: #e2e8f0;
}

.auth-content form {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.auth-content label {
    display: block;
    margin-bottom: 0.3rem;
    font-weight: 500;
    color: #334155;
}

.auth-content input,
.auth-content select {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.auth-content input:focus,
.auth-content select:focus {
    outline: none;
    border-color: #1a56db;
    box-shadow: 0 0 0 3px rgba(26, 86, 219, 0.1);
}

.auth-content button {
    background-color: #1a56db;
    color: white;
    border: none;
    padding: 0.9rem;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.auth-content button:hover {
    background-color: #1e40af;
}

#login-error,
#register-error {
    min-height: 1.5rem;
}

/* 主内容区域 */
.main-container {
    margin: 2rem auto;
}

#current-user {
    font-weight: 600;
    color: #334155;
}

#logout-btn {
    background-color: #ef4444;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#logout-btn:hover {
    background-color: #dc2626;
}

/* 编辑者控制区 */
.editor-controls {
    margin: 1.5rem 0;
}

#add-proposal-btn {
    background-color: #10b981;
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#add-proposal-btn:hover {
    background-color: #059669;
}

/* 搜索区域 */
.search-bar {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin: 1.5rem 0;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

#searchInput {
    flex: 1;
    min-width: 250px;
    padding: 0.8rem 1rem;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 1rem;
}

#searchInput:focus {
    outline: none;
    border-color: #1a56db;
    box-shadow: 0 0 0 3px rgba(26, 86, 219, 0.1);
}

#categoryFilter {
    padding: 0.8rem 1rem;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 1rem;
    background-color: white;
}

.search-bar button {
    background-color: #1a56db;
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.search-bar button:hover {
    background-color: #1e40af;
}

/* 提案列表 */
.proposal-list {
    display: grid;
    gap: 1.5rem;
    margin: 2rem 0;
}

.proposal-card {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.proposal-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
}

.proposal-card h3 {
    color: #1e293b;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.proposal-card div {
    color: #64748b;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.proposal-card p {
    color: #334155;
    margin-bottom: 1.2rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.proposal-card button {
    margin-right: 0.8rem;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.proposal-card button:first-of-type {
    background-color: #1a56db;
    color: white;
    border: none;
}

.proposal-card button:first-of-type:hover {
    background-color: #1e40af;
}

.proposal-card button:last-of-type {
    background-color: #f8fafc;
    color: #ef4444;
    border: 1px solid #ef4444;
}

.proposal-card button:last-of-type:hover {
    background-color: #ef4444;
    color: white;
}

/* 弹窗样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: white;
    border-radius: 10px;
    width: 90%;
    max-width: 700px;
    max-height: 80vh;
    overflow-y: auto;
    padding: 2rem;
    position: relative;
    transform: translateY(-20px);
    transition: transform 0.3s ease;
}

.modal.show .modal-content {
    transform: translateY(0);
}

.close,
.close-modal {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: #64748b;
    transition: color 0.3s ease;
}

.close:hover,
.close-modal:hover {
    color: #ef4444;
}

#modalTitle {
    color: #1e293b;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

#modalRepresentative,
#modalCategory,
#modalDate {
    color: #334155;
}

#modalContent {
    margin-top: 1.5rem;
    color: #334155;
    line-height: 1.8;
}

/* 添加提案表单 */
#proposal-form {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

#proposal-form label {
    display: block;
    margin-bottom: 0.3rem;
    font-weight: 500;
    color: #334155;
}

#proposal-form input,
#proposal-form select,
#proposal-form textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 1rem;
}

#proposal-form textarea {
    min-height: 150px;
    resize: vertical;
}

#proposal-form input:focus,
#proposal-form select:focus,
#proposal-form textarea:focus {
    outline: none;
    border-color: #1a56db;
    box-shadow: 0 0 0 3px rgba(26, 86, 219, 0.1);
}

#proposal-form button {
    background-color: #1a56db;
    color: white;
    border: none;
    padding: 0.9rem;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-top: 1rem;
}

#proposal-form button:hover {
    background-color: #1e40af;
}

/* 页脚样式 */
.footer {
    text-align: center;
    padding: 2rem 1rem;
    color: #64748b;
    border-top: 1px solid #e2e8f0;
    margin-top: 3rem;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .header h1 {
        font-size: 1.8rem;
    }

    .search-bar {
        flex-direction: column;
        align-items: stretch;
    }

    #searchInput,
    #categoryFilter {
        width: 100%;
    }

    .proposal-card h3 {
        font-size: 1.1rem;
    }

    .modal-content {
        padding: 1.5rem;
    }
}