/* PDD互助系统 - 闲鱼风格 */

:root {
    --primary-color: #FF6B00;
    --primary-light: #FFB800;
    --primary-gradient: linear-gradient(135deg, #FFB800, #FF6B00);
    --bg-color: #FFF8E8;
    --card-bg: #FFFFFF;
    --text-color: #333333;
    --text-secondary: #666666;
    --text-light: #999999;
    --border-color: #F0F0F0;
    --success-color: #52C41A;
    --warning-color: #FAAD14;
    --shadow: 0 4px 20px rgba(255, 107, 0, 0.1);
    --shadow-sm: 0 2px 12px rgba(0, 0, 0, 0.06);
    --radius: 16px;
    --radius-lg: 24px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    padding-bottom: 80px;
}

.container {
    max-width: 750px;
    margin: 0 auto;
    padding: 0;
}

/* 头部 */
.header {
    background: var(--primary-gradient);
    color: white;
    padding: 20px 16px 24px;
    position: relative;
    overflow: hidden;
}

.header::after {
    content: '';
    position: absolute;
    bottom: -30px;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--bg-color);
    border-radius: 50% 50% 0 0;
}

.header-content {
    position: relative;
    z-index: 1;
}

.header h1 {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.header .subtitle {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 12px;
}

.header .links {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.header .links a {
    color: white;
    text-decoration: none;
    font-size: 13px;
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 20px;
    transition: all 0.3s;
    backdrop-filter: blur(10px);
}

.header .links a:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: translateY(-1px);
}

/* Banner 图片 */
.banner {
    margin: 0 16px 16px;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.banner img {
    width: 100%;
    display: block;
}

/* 统计卡片 */
.stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin: 0 16px 16px;
}

.stat-card {
    background: var(--card-bg);
    padding: 20px;
    border-radius: var(--radius);
    text-align: center;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-gradient);
}

.stat-card .icon {
    font-size: 28px;
    margin-bottom: 8px;
}

.stat-card .number {
    font-size: 36px;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-card .label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* 提交区域 */
.submit-section {
    background: var(--card-bg);
    margin: 0 16px 16px;
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.submit-section h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.input-group {
    display: flex;
    gap: 12px;
}

.input-group input {
    flex: 1;
    padding: 14px 16px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s;
    outline: none;
    background: #FAFAFA;
}

.input-group input:focus {
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 3px rgba(255, 107, 0, 0.1);
}

.input-group button {
    padding: 14px 28px;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(255, 107, 0, 0.3);
}

.input-group button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 107, 0, 0.4);
}

.input-group button:active {
    transform: translateY(0);
}

.input-group button:disabled {
    background: #ccc;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* 提示消息 */
.message {
    padding: 12px 16px;
    border-radius: 10px;
    margin-top: 12px;
    font-size: 14px;
    display: none;
}

.message.success {
    background: #F6FFED;
    color: var(--success-color);
    display: block;
    border: 1px solid #B7EB8F;
}

.message.error {
    background: #FFF2E8;
    color: var(--primary-color);
    display: block;
    border: 1px solid #FFBB96;
}

/* 使用说明 */
.instructions {
    background: var(--card-bg);
    margin: 0 16px 16px;
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.instructions h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.instructions ol {
    padding-left: 20px;
    font-size: 14px;
    color: var(--text-secondary);
}

.instructions li {
    margin-bottom: 10px;
    line-height: 1.8;
}

.instructions .notice {
    margin-top: 16px;
    padding: 14px;
    background: linear-gradient(135deg, #FFF7E6, #FFFBE6);
    border-radius: 12px;
    font-size: 13px;
    color: #D48806;
    border-left: 4px solid var(--warning-color);
}

/* 助力池 */
.pool-section {
    background: var(--card-bg);
    margin: 0 16px 16px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.pool-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #FFFBF0, #FFFFFF);
}

.pool-header h3 {
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pool-header .refresh-btn {
    background: var(--primary-gradient);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 13px;
    padding: 8px 16px;
    border-radius: 20px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 4px;
}

.pool-header .refresh-btn:hover {
    transform: scale(1.05);
}

/* 邀请码列表 */
.code-list {
    max-height: 400px;
    overflow-y: auto;
}

.code-item {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s;
}

.code-item:hover {
    background: #FFFBF0;
}

.code-item:last-child {
    border-bottom: none;
}

.code-info .masked-code {
    font-size: 20px;
    font-weight: 700;
    font-family: 'SF Mono', 'Consolas', monospace;
    letter-spacing: 2px;
    color: var(--text-color);
    background: linear-gradient(135deg, #FFFBF0, #FFF7E6);
    padding: 8px 16px;
    border-radius: 10px;
    display: inline-block;
}

.code-info .submit-time {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.code-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.btn {
    padding: 10px 20px;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: none;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 12px rgba(255, 107, 0, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 107, 0, 0.4);
}

.status-badge {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.status-badge.pending {
    background: linear-gradient(135deg, #E6F7FF, #BAE7FF);
    color: #1890FF;
}

.status-badge.used {
    background: #F5F5F5;
    color: #999;
}

/* 空状态 */
.empty-state {
    padding: 48px 20px;
    text-align: center;
    color: var(--text-light);
}

.empty-state .icon {
    font-size: 56px;
    margin-bottom: 16px;
    opacity: 0.6;
}

.empty-state p {
    font-size: 14px;
    line-height: 1.8;
}

/* 联系方式 */
.contact {
    background: var(--card-bg);
    margin: 0 16px 16px;
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    text-align: center;
}

.contact p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.contact .wechat {
    margin-top: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #07C160, #06AD56);
    color: white;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 12px rgba(7, 193, 96, 0.3);
}

/* 底部导航 */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--card-bg);
    display: flex;
    justify-content: space-around;
    padding: 10px 0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
    z-index: 100;
}

.bottom-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--text-light);
    text-decoration: none;
    font-size: 12px;
    padding: 6px 16px;
    border-radius: 12px;
    transition: all 0.3s;
}

.bottom-nav .nav-item.active {
    color: var(--primary-color);
    background: #FFF7E6;
}

.bottom-nav .nav-item .icon {
    font-size: 22px;
}

/* 页脚 */
.footer {
    text-align: center;
    padding: 20px 16px;
    color: var(--text-light);
    font-size: 12px;
}

.footer a {
    color: var(--primary-color);
    text-decoration: none;
}

/* 响应式 */
@media (max-width: 600px) {
    .container {
        padding: 0;
    }
    
    .header h1 {
        font-size: 22px;
    }
    
    .stats {
        grid-template-columns: 1fr;
        margin: 0 12px 12px;
    }
    
    .input-group {
        flex-direction: column;
    }
    
    .input-group button {
        width: 100%;
    }
    
    .code-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .code-actions {
        width: 100%;
        justify-content: flex-end;
    }
    
    .submit-section,
    .instructions,
    .pool-section,
    .contact {
        margin: 0 12px 12px;
    }
    
    .stat-card {
        padding: 16px;
    }
    
    .stat-card .number {
        font-size: 28px;
    }
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 复制成功提示 */
.copy-success {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.75);
    color: white;
    padding: 16px 32px;
    border-radius: 12px;
    font-size: 14px;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.copy-success.show {
    opacity: 1;
}

/* 滚动条美化 */
.code-list::-webkit-scrollbar {
    width: 4px;
}

.code-list::-webkit-scrollbar-track {
    background: transparent;
}

.code-list::-webkit-scrollbar-thumb {
    background: var(--primary-light);
    border-radius: 2px;
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.code-item {
    animation: fadeIn 0.3s ease-out;
}

/* 闪烁动画 */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.loading-text {
    animation: pulse 1.5s infinite;
}
