/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f5f5f5;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

/* 手机框架 */
.phone-frame {
    width: 375px;
    height: 812px;
    background: #000;
    border-radius: 40px;
    padding: 8px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    position: relative;
}

.phone-container {
    width: 100%;
    height: 100%;
    background: #fff;
    border-radius: 32px;
    overflow: hidden;
    position: relative;
}

/* 顶部导航 */
.top-nav {
    background: #667eea;
    color: #fff;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.back-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background 0.3s ease;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.nav-title {
    font-size: 18px;
    font-weight: 600;
}

.nav-actions {
    display: flex;
    gap: 8px;
}

.publish-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    padding: 6px 16px;
    border-radius: 16px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.publish-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* 主要内容 */
.main-content {
    padding: 16px;
    height: calc(100% - 60px);
    overflow-y: auto;
}

/* 发布表单 */
.publish-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.form-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-label {
    font-weight: 600;
    color: #333;
    font-size: 16px;
}

/* 内容输入 */
.content-input {
    width: 100%;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 12px;
    font-size: 14px;
    line-height: 1.5;
    resize: none;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.content-input:focus {
    outline: none;
    border-color: #667eea;
}

.char-count {
    text-align: right;
    color: #999;
    font-size: 12px;
}

.current-count {
    color: #667eea;
    font-weight: 500;
}

/* 图片上传 */
.image-upload-area {
    margin-top: 8px;
}

.upload-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.upload-item {
    aspect-ratio: 1;
    border: 2px dashed #e9ecef;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.upload-item:hover {
    border-color: #667eea;
    background: #f0f2ff;
}

.upload-item.add-upload {
    border-style: dashed;
}

.upload-item.uploaded {
    border-style: solid;
    border-color: #667eea;
    background: #fff;
    position: relative;
}

.upload-icon {
    font-size: 24px;
    margin-bottom: 4px;
    color: #667eea;
}

.upload-text {
    font-size: 12px;
    color: #666;
    text-align: center;
}

.uploaded-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
}

.remove-btn {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 20px;
    height: 20px;
    background: #dc3545;
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.upload-tip {
    color: #999;
    font-size: 12px;
    margin-top: 8px;
}

/* 发布设置 */
.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.setting-item:last-child {
    border-bottom: none;
}

.setting-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.setting-label {
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.setting-desc {
    color: #999;
    font-size: 12px;
}

/* 开关样式 */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #667eea;
}

input:checked + .slider:before {
    transform: translateX(20px);
}

/* 手机状态栏 */
.status-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background: #000;
    color: #fff;
    padding: 4px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    font-weight: 600;
    z-index: 1000;
}

.status-left .time {
    font-weight: 600;
}

.status-right {
    display: flex;
    gap: 4px;
}

/* 响应式设计 */
@media (max-width: 400px) {
    .phone-frame {
        width: 100%;
        height: 100vh;
        border-radius: 0;
        padding: 0;
    }
    
    .phone-container {
        border-radius: 0;
    }
    
    .main-content {
        padding: 12px;
    }
    
    .upload-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }
}

/* 滚动条样式 */
.main-content::-webkit-scrollbar {
    width: 4px;
}

.main-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 2px;
}

.main-content::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 2px;
}

.main-content::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
} 