/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'PingFang SC', 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.5;
}

/* 应用容器 */
.app-container {
    max-width: 480px;
    height: 100vh;
    margin: 0 auto;
    background-color: #fff;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow-y: auto;
}

/* 登录和注册容器 */
.login-container, .register-container {
    padding: 40px 20px;
}

/* Logo */
.logo {
    text-align: center;
    margin-bottom: 40px;
}

.logo h1 {
    font-size: 28px;
    color: #333;
    margin-bottom: 10px;
}

.logo p {
    font-size: 14px;
    color: #999;
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
}

.captcha-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#captcha-question {
    font-size: 16px;
    font-weight: bold;
    padding: 10px;
    background-color: #f5f5f5;
    border-radius: 4px;
    text-align: center;
}

.form-group label {
    display: block;
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
}

.required {
    color: red;
    margin-right: 4px;
}

.deadline-selector {
    display: flex;
    gap: 20px;
    margin-bottom: 10px;
}

.deadline-selector label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: normal;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #4CAF50;
}

/* 按钮样式 */
.btn {
    display: block;
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-primary {
    background-color: #4CAF50;
    color: #fff;
}

.btn-primary:hover {
    background-color: #45a049;
}

/* 表单底部 */
.form-footer {
    text-align: center;
    margin-top: 20px;
}

.form-footer a {
    color: #4CAF50;
    text-decoration: none;
    font-size: 14px;
}

.form-footer a:hover {
    text-decoration: underline;
}

/* 底部导航栏 */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-width: 480px;
    margin: 0 auto;
    background-color: #fff;
    border-top: 1px solid #ddd;
    display: flex;
    justify-content: space-around;
    padding: 10px 0;
    z-index: 1000;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #999;
    text-decoration: none;
    font-size: 12px;
}

.nav-item.active {
    color: #4CAF50;
}

.nav-item i {
    font-size: 20px;
    margin-bottom: 5px;
}

/* 首页样式 */
.home-container {
    padding: 20px;
    padding-bottom: 70px;
}

/* 首页头部 */
.home-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.home-header h2 {
    font-size: 20px;
    font-weight: bold;
}

.header-actions .btn {
    padding: 8px 16px;
    font-size: 14px;
}

/* 轮播图 */
.carousel {
    width: 100%;
    margin-bottom: 20px;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.carousel-container {
    width: 100%;
    overflow: hidden;
}

.carousel-slide {
    display: flex;
    transition: transform 0.5s ease;
}

.carousel-item {
    min-width: 100%;
    height: 180px;
    position: relative;
}

.carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.banner {
    background-color: #4CAF50;
    color: #fff;
    padding: 30px 20px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.banner-content h3 {
    font-size: 20px;
    margin-bottom: 10px;
}

.banner-content p {
    font-size: 14px;
    opacity: 0.9;
}

/* 分类 */
.categories {
    margin-bottom: 30px;
}

.categories h3 {
    font-size: 18px;
    margin-bottom: 15px;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.category-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px 10px;
    background-color: #f9f9f9;
    border-radius: 8px;
}

.category-item i {
    font-size: 24px;
    color: #4CAF50;
    margin-bottom: 8px;
}

.category-item span {
    font-size: 12px;
    text-align: center;
}

/*  section头部 */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.section-header h3 {
    font-size: 16px;
    font-weight: bold;
}

.section-header a {
    font-size: 14px;
    color: #4CAF50;
    text-decoration: none;
}

/* 作品和需求列表 */
.list-container {
    padding: 20px;
    padding-bottom: 70px;
}

.list-item {
    background-color: #fff;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
}

.requirement-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.status-badge {
    background-color: #ffc107;
    color: #000;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
}

.status-badge.ongoing {
    background-color: orange;
    color: black;
    border-radius: 16px;
    padding: 2px 10px;
    font-size: 10px;
    position: absolute;
    top: 10px;
    right: 10px;
}

.status-badge.completed {
    background-color: #28a745;
    color: white;
    border-radius: 16px;
    padding: 2px 10px;
    font-size: 10px;
    position: absolute;
    top: 10px;
    right: 10px;
}

.publisher-info {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #f0f0f0;
    font-size: 14px;
    color: #666;
}

.publisher-info span {
    margin-right: 15px;
}

.upload-container {
    margin-top: 10px;
}

.image-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.preview-img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 4px;
}

.works-container {
    padding: 15px;
}

.works-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.works-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.work-item {
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.work-item img {
    width: 100%;
    height: 120px;
    object-fit: cover;
}

.work-item-content {
    padding: 10px;
}

.work-item h4 {
    margin: 0 0 5px 0;
    font-size: 14px;
}

.work-item p {
    margin: 0;
    font-size: 12px;
    color: #666;
}

.no-works {
    text-align: center;
    padding: 40px 0;
    color: #999;
}

.publish-btn {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #28a745;
    color: white;
    border: none;
    font-size: 24px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.publish-btn:hover {
    background-color: #218838;
}

.list-item h3 {
    font-size: 16px;
    margin-bottom: 10px;
}

.list-item p {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
}

.list-item .meta {
    font-size: 12px;
    color: #999;
}

/* 个人中心 */
.profile-container {
    padding: 20px;
    padding-bottom: 70px;
}

.profile-header {
    text-align: center;
    margin-bottom: 30px;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin-bottom: 10px;
}

.profile-name {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 5px;
}

.profile-role {
    font-size: 14px;
    color: #999;
}

.role-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    color: white;
    font-weight: 500;
    margin-top: 5px;
}

.role-badge.user {
    background-color: #4A90E2;
}

.role-badge.designer {
    background-color: #4CAF50;
}

.role-badge.worker {
    background-color: #FF9800;
}

.profile-menu {
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
}

.menu-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
    text-decoration: none;
    color: #333;
}

.menu-item:last-child {
    border-bottom: none;
}

.menu-item i {
    color: #999;
}

/* 需求发布页 */
.publish-container {
    padding: 20px;
    padding-bottom: 70px;
}

.publish-container h2 {
    font-size: 18px;
    margin-bottom: 20px;
}

.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    resize: vertical;
    min-height: 120px;
}

.form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
}

/* 入驻申请页 */
.apply-container {
    padding: 20px;
    padding-bottom: 70px;
}

.apply-container h2 {
    font-size: 18px;
    margin-bottom: 20px;
}

/* 管理员后台 */
.admin-container {
    padding: 20px;
}

.admin-container h2 {
    font-size: 20px;
    margin-bottom: 20px;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.stat-card {
    background-color: #fff;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.stat-card h3 {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
}

.stat-card .number {
    font-size: 24px;
    font-weight: bold;
    color: #4CAF50;
}

/* 页面头部 */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
}

.page-header h2 {
    font-size: 18px;
    font-weight: bold;
}

/* 分类标签 */
.category-tabs {
    display: flex;
    margin-bottom: 20px;
    background-color: #f9f9f9;
    border-radius: 8px;
    padding: 5px;
}

.tab-btn {
    flex: 1;
    padding: 10px;
    border: none;
    background: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.tab-btn.active {
    background-color: #4CAF50;
    color: #fff;
}

/* 筛选栏 */
.filter-bar {
    margin-bottom: 20px;
}

.filter-bar select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    background-color: #fff;
}

/* 单选按钮组 */
.radio-group {
    display: flex;
    gap: 20px;
}

.radio-item {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

.radio-item input[type="radio"] {
    width: auto;
}

/* 响应式设计 */
@media screen and (max-width: 480px) {
    .app-container {
        height: 100vh;
    }
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: #4CAF50;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 提示信息 */
.alert {
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 14px;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* 作品卡片样式 */
.work-card {
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.3s;
}

.work-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.work-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.work-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.work-card:hover .work-image img {
    transform: scale(1.05);
}

.work-content {
    padding: 15px;
}

.work-content h4 {
    font-size: 16px;
    margin-bottom: 10px;
    color: #333;
}

.work-content p {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
    line-height: 1.4;
}

.work-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #999;
    margin-bottom: 10px;
}

.work-actions {
    margin-top: 10px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 14px;
    width: auto;
    display: inline-block;
}

/* 作品详情模态框 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: #fff;
    margin: 10% auto;
    padding: 20px;
    border-radius: 8px;
    position: relative;
    max-height: 70vh;
    overflow-y: auto;
    width: 90%;
    max-width: 400px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: bold;
    flex: 1;
    text-align: center;
    margin: 0;
}

.back-btn {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #666;
    padding: 0;
}

.close {
    color: #999;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: #333;
}

.modal-body {
    padding: 10px 0;
}

/* 作品详情样式 */
#work-detail-content h2 {
    font-size: 20px;
    margin-bottom: 15px;
    color: #333;
}

.work-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 14px;
    color: #666;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.work-detail-images {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.work-detail-images img {
    width: 100%;
    max-height: 300px;
    object-fit: cover;
    border-radius: 8px;
}

.work-detail-description {
    margin-bottom: 20px;
}

.work-detail-description h3 {
    font-size: 16px;
    margin-bottom: 10px;
    color: #333;
}

.work-detail-description p {
    font-size: 14px;
    line-height: 1.5;
    color: #666;
}

.work-detail-link {
    margin-bottom: 20px;
}

.work-detail-link h3 {
    font-size: 16px;
    margin-bottom: 10px;
    color: #333;
}

.work-detail-link a {
    color: #4CAF50;
    text-decoration: none;
    font-size: 14px;
    word-break: break-all;
}

.work-detail-link a:hover {
    text-decoration: underline;
}
