* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    -webkit-tap-highlight-color: transparent;
}

#app {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    max-width: 640px;
    margin: 0 auto;
    background-color: #fff;
}

.header {
    height: 56px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.header-title {
    color: #fff;
    font-size: 18px;
    font-weight: 600;
}

.main-content {
    flex: 1;
    overflow-y: auto;
}

.page {
    display: block;
    padding: 16px;
}

.page.hidden {
    display: none;
}

.carousel-container {
    position: relative;
    width: 100%;
    height: 180px;
    overflow: hidden;
    border-radius: 12px;
    margin-bottom: 16px;
}

.carousel-wrapper {
    display: flex;
    height: 100%;
    transition: transform 0.5s ease-in-out;
}

.carousel-item {
    min-width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 24px;
    font-weight: 600;
}

.carousel-dots {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
}

.carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s;
}

.carousel-dot.active {
    width: 24px;
    border-radius: 4px;
    background-color: #fff;
}

.carousel-prev,
.carousel-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.3);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s;
}

.carousel-prev:hover,
.carousel-next:hover {
    background-color: rgba(0, 0, 0, 0.5);
}

.carousel-prev {
    left: 8px;
}

.carousel-next {
    right: 8px;
}

.search-bar {
    margin-bottom: 16px;
    display: flex;
    gap: 12px;
}

.search-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 24px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s;
}

.search-input:focus {
    border-color: #667eea;
}

.add-task-btn {
    padding: 12px 18px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.25);
}

.add-task-btn:hover {
    opacity: 0.95;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.35);
}

.add-task-btn:active {
    transform: translateY(0);
}

.fab-btn {
    position: fixed;
    right: 20px;
    bottom: 80px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    transition: all 0.3s ease;
}

.fab-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.fab-btn:active {
    transform: scale(0.95);
}

.fab-icon {
    font-size: 36px;
    color: #fff;
    font-weight: 300;
    line-height: 1;
}

.fab-btn.hidden {
    display: none;
}

.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.filter-btn {
    flex: 1;
    padding: 8px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    background-color: #fff;
    color: #666;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.filter-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

.filter-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-color: transparent;
}

.tasks-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.task-card {
    background-color: #fff;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    border: 1px solid #f0f0f0;
}

.task-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.task-card-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    flex: 1;
    margin-right: 12px;
}

.task-card-status {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.task-card-status.pending {
    background-color: #fff7e6;
    color: #fa8c16;
}

.task-card-status.in_progress {
    background-color: #e6f7ff;
    color: #1890ff;
}

.task-card-status.completed {
    background-color: #f6ffed;
    color: #52c41a;
}

.task-card-desc {
    font-size: 14px;
    color: #666;
    margin-bottom: 12px;
    line-height: 1.5;
}

.task-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin-bottom: 12px;
}

.task-card-meta-item {
    display: flex;
    align-items: center;
    font-size: 13px;
    color: #999;
}

.task-card-meta-item::before {
    content: '';
    margin-right: 4px;
}

.task-card-meta-item.location::before {
    content: '📍';
}

.task-card-meta-item.time::before {
    content: '⏰';
}

.task-card-meta-item.reward::before {
    content: '💰';
    color: #faad14;
}

.task-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
}

.task-card-publisher {
    display: flex;
    align-items: center;
    gap: 8px;
}

.publisher-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
}

.publisher-name {
    font-size: 14px;
    color: #333;
}

.task-card-contact {
    padding: 8px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: opacity 0.3s;
}

.task-card-contact:hover {
    opacity: 0.9;
}

.task-card-action {
    padding: 8px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s;
    font-weight: 500;
}

.task-card-action:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.task-card-action[data-action="contact"] {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.task-card-action[data-action="accept"] {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(245, 87, 108, 0.4);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(245, 87, 108, 0);
    }
}

.task-buttons-group {
    display: flex;
    gap: 8px;
}

.task-btn-delete,
.task-btn-edit,
.task-btn-complete,
.task-btn-republish {
    padding: 6px 14px;
    border: none;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s;
}

.task-btn-edit {
    background: linear-gradient(135deg, #1890ff 0%, #40a9ff 100%);
    color: #fff;
}

.task-btn-edit:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(24, 144, 255, 0.3);
}

.task-btn-delete {
    background-color: #fff1f0;
    color: #ff4d4f;
    border: 1px solid #ff4d4f;
}

.task-btn-delete:hover {
    background-color: #ff4d4f;
    color: #fff;
}

.task-btn-complete {
    background: linear-gradient(135deg, #52c41a 0%, #73d13d 100%);
    color: #fff;
}

.task-btn-complete:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(82, 196, 26, 0.3);
}

.task-btn-republish {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.task-btn-republish:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.sub-tab-bar {
    display: flex;
    margin-bottom: 16px;
    background-color: #f5f5f5;
    border-radius: 8px;
    padding: 4px;
}

.sub-tab-btn {
    flex: 1;
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    background-color: transparent;
    color: #666;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.sub-tab-btn:hover {
    color: #667eea;
}

.sub-tab-btn.active {
    background-color: #fff;
    color: #667eea;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.profile-header {
    display: flex;
    align-items: center;
    padding: 24px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    margin-bottom: 24px;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #667eea;
    font-size: 32px;
    font-weight: 600;
    margin-right: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.profile-info {
    flex: 1;
}

.profile-nickname {
    font-size: 20px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 8px;
}

.profile-details {
    display: flex;
    gap: 16px;
}

.profile-gender,
.profile-location {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
}

.profile-menu {
    background-color: #fff;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 24px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.profile-menu-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background-color 0.3s;
}

.profile-menu-item:last-child {
    border-bottom: none;
}

.profile-menu-item:hover {
    background-color: #f9f9f9;
}

.menu-label {
    font-size: 15px;
    color: #333;
}

.menu-arrow {
    color: #999;
    font-size: 14px;
}

.logout-btn {
    width: 100%;
    padding: 14px 24px;
    background-color: #fff;
    color: #ff4d4f;
    border: 1px solid #ff4d4f;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.logout-btn:hover {
    background-color: #fff1f0;
}

.footer {
    height: 56px;
    background-color: #fff;
    border-top: 1px solid #eee;
    flex-shrink: 0;
}

.nav {
    display: flex;
    height: 100%;
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #999;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s;
}

.nav-item.active {
    color: #667eea;
}

.nav-icon {
    font-size: 20px;
    margin-bottom: 2px;
}

.nav-text {
    font-size: 12px;
}

@media (max-width: 375px) {
    .page {
        padding: 12px;
    }
    
    .carousel-container {
        height: 150px;
    }
    
    .task-card {
        padding: 12px;
    }
    
    .task-card-title {
        font-size: 15px;
    }
    
    .profile-header {
        padding: 20px 12px;
    }
    
    .profile-avatar {
        width: 64px;
        height: 64px;
        font-size: 24px;
    }
    
    .profile-nickname {
        font-size: 18px;
    }
}

@media (min-width: 641px) {
    #app {
        box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    }
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-overlay.hidden {
    display: none;
}

.modal {
    background-color: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border: none;
    background-color: #f5f5f5;
    border-radius: 50%;
    font-size: 20px;
    color: #999;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.modal-close:hover {
    background-color: #e0e0e0;
    color: #666;
}

.login-title {
    text-align: center;
    font-size: 22px;
    font-weight: 600;
    color: #333;
    padding: 32px 24px 8px;
}

.add-task-modal .login-title {
    padding: 24px 24px 4px;
    font-size: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.add-task-modal .modal-close {
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    font-size: 22px;
    line-height: 1;
}

.login-form,
.profile-form {
    padding: 24px;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.3s;
}

.form-input:focus {
    border-color: #667eea;
}

.form-input[readonly] {
    background-color: #f5f5f5;
    color: #999;
}

.form-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.3s;
    min-height: 100px;
    resize: vertical;
    font-family: inherit;
}

.form-textarea:focus {
    border-color: #667eea;
}

.code-input-group {
    display: flex;
    gap: 12px;
}

.code-input {
    flex: 1;
}

.send-code-btn {
    padding: 12px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity 0.3s;
}

.send-code-btn:hover {
    opacity: 0.9;
}

.send-code-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.login-btn {
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.3s;
    margin-top: 8px;
}

.login-btn:hover {
    opacity: 0.9;
}

.login-tip {
    text-align: center;
    font-size: 12px;
    color: #999;
    margin-top: 16px;
}

.avatar-group {
    text-align: center;
}

.avatar-upload {
    position: relative;
    display: inline-block;
}

.avatar-preview {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s;
}

.avatar-preview:hover {
    transform: scale(1.05);
}

.avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-placeholder {
    font-size: 36px;
    color: #fff;
    font-weight: 300;
}

.avatar-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.gender-select {
    display: flex;
    gap: 12px;
}

.gender-btn {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background-color: #fff;
    color: #666;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s;
}

.gender-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

.gender-btn.active {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.add-task-modal {
    max-width: 420px;
}

.add-task-form {
    padding: 20px 24px 24px;
}

.add-task-form .form-group {
    margin-bottom: 18px;
}

.add-task-form .form-label {
    font-size: 13px;
    font-weight: 600;
    color: #555;
    margin-bottom: 6px;
}

.add-task-form .form-input,
.add-task-form .form-textarea {
    font-size: 14px;
    padding: 11px 14px;
    border: 1.5px solid #e8e8e8;
    border-radius: 10px;
    background-color: #fafafa;
    transition: all 0.3s ease;
}

.add-task-form .form-input:focus,
.add-task-form .form-textarea:focus {
    border-color: #667eea;
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.add-task-form .form-input[readonly] {
    background-color: #f5f7fa;
    color: #888;
    cursor: not-allowed;
}

.add-task-form .form-textarea {
    min-height: 120px;
    line-height: 1.6;
    resize: vertical;
}

.add-task-form .login-btn {
    margin-top: 8px;
    padding: 13px 24px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
}

.add-task-form .login-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.add-task-form .login-btn:active {
    transform: translateY(0);
}

.add-task-form .form-input::placeholder,
.add-task-form .form-textarea::placeholder {
    color: #bbb;
}

@media (max-width: 480px) {
    .add-task-modal {
        margin: 16px;
        max-width: none;
    }
    
    .add-task-form {
        padding: 16px 20px 20px;
    }
}

/* 省市区选择器样式 */
.region-select {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.region-select-input {
    flex: 1;
    min-width: 80px;
    padding: 12px 16px;
    border: 1.5px solid #e8e8e8;
    border-radius: 10px;
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
    background-color: #fafafa;
    appearance: none;
    background-image: url('data:image/svg+xml;charset=US-ASCII,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%23666" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"></polyline></svg>');
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
}

.region-select-input:focus {
    border-color: #667eea;
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.region-select-input:disabled {
    background-color: #f5f7fa;
    color: #888;
    cursor: not-allowed;
    background-image: url('data:image/svg+xml;charset=US-ASCII,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%23999" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"></polyline></svg>');
}

@media (max-width: 480px) {
    .region-select {
        flex-direction: column;
        gap: 10px;
    }
    
    .region-select-input {
        width: 100%;
        min-width: unset;
        padding: 13px 16px;
        font-size: 15px;
        border-radius: 12px;
    }
}

/* 任务发布页面的省市区选择器特殊样式 */
.add-task-form .region-select-input {
    border: 1.5px solid #e8e8e8;
    border-radius: 10px;
    background-color: #fafafa;
    font-size: 14px;
    padding: 11px 14px;
}

.add-task-form .region-select-input:focus {
    border-color: #667eea;
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

@media (max-width: 480px) {
    .add-task-form .region-select {
        gap: 8px;
    }
    
    .add-task-form .region-select-input {
        padding: 12px 14px;
        font-size: 14px;
        border-radius: 10px;
    }
}