/* 邀请码分享平台 - 重新设计样式 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 头部样式 */
.header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 0;
}

/* 主要内容区域 */
.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 40px;
}

.section {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.section:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

.section-header {
    margin-bottom: 25px;
}

.section-header h2 {
    font-size: 1.5rem;
    color: #2d3748;
    margin-bottom: 8px;
}

.section-header p {
    color: #718096;
    font-size: 0.95rem;
}

/* 获取邀请码区域 */
.get-area {
    text-align: center;
}

.get-btn {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    border: none;
    border-radius: 12px;
    padding: 20px 40px;
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 0 auto;
    min-width: 200px;
}

.get-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(79, 172, 254, 0.4);
}

.btn-icon {
    font-size: 1.3rem;
}

/* 邀请码结果显示 */
.code-result {
    margin-top: 25px;
    animation: slideIn 0.5s ease;
}

.code-display {
    background: #f7fafc;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    border: 2px solid #e2e8f0;
}

.code-label {
    font-size: 0.9rem;
    color: #718096;
    margin-bottom: 8px;
}

.code-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: #2d3748;
    font-family: 'Courier New', monospace;
    letter-spacing: 2px;
    margin-bottom: 15px;
    word-break: break-all;
}

.code-details {
    border-top: 1px solid #e2e8f0;
    padding-top: 15px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.detail-label {
    color: #718096;
    font-weight: 500;
}

.detail-value {
    color: #2d3748;
    font-weight: 600;
}

.code-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.action-btn {
    background: #667eea;
    border: none;
    border-radius: 8px;
    padding: 12px 20px;
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.action-btn:hover {
    background: #5a67d8;
    transform: translateY(-1px);
}

.copy-btn {
    background: #48bb78;
}

.copy-btn:hover {
    background: #38a169;
}

/* 邀请码反馈区域 */
.code-feedback {
    margin-top: 20px;
    padding: 20px;
    background: #f7fafc;
    border-radius: 12px;
    border: 2px solid #e2e8f0;
    text-align: center;
}

.feedback-prompt {
    color: #4a5568;
    font-weight: 600;
    margin-bottom: 15px;
    font-size: 0.95rem;
}

.feedback-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.feedback-btn {
    background: #e2e8f0;
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.valid-btn {
    background: #c6f6d5;
    color: #22543d;
}

.valid-btn:hover {
    background: #9ae6b4;
    transform: translateY(-1px);
}

.invalid-btn {
    background: #fed7d7;
    color: #742a2a;
}

.invalid-btn:hover {
    background: #feb2b2;
    transform: translateY(-1px);
}

/* 上传区域 */
.upload-area {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group label {
    font-weight: 600;
    color: #2d3748;
    font-size: 0.95rem;
}

.input-group input {
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.input-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.upload-btn {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border: none;
    border-radius: 12px;
    padding: 15px 30px;
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
}

.upload-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(245, 87, 108, 0.4);
}

/* 邀请码列表区域 */
.codes-display {
    margin-bottom: 40px;
}

.codes-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.code-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.code-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

.code-header {
    margin-bottom: 12px;
}

.code-main {
    font-size: 1.3rem;
    font-weight: 700;
    color: #2d3748;
    font-family: 'Courier New', monospace;
    letter-spacing: 1px;
    margin-bottom: 5px;
    word-break: break-all;
}



.code-description {
    color: #718096;
    font-size: 0.9rem;
    margin-bottom: 15px;
    line-height: 1.5;
}

.code-footer {
    border-top: 1px solid #e2e8f0;
    padding-top: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.usage-info {
    flex: 1;
}

.usage-count {
    font-size: 0.85rem;
    color: #718096;
    margin-bottom: 5px;
    display: block;
}

.usage-bar {
    width: 100%;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
}

.usage-progress {
    height: 100%;
    background: linear-gradient(90deg, #48bb78, #38a169);
    transition: width 0.3s ease;
}

.code-time {
    font-size: 0.8rem;
    color: #a0aec0;
    margin-left: 15px;
}

/* 已使用邀请码样式 */
.used-card {
    opacity: 0.7;
    border: 1px solid #e2e8f0;
}

.used-badge {
    background: #fed7d7;
    color: #742a2a;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
    margin-top: 5px;
}

.usage-progress.full {
    background: linear-gradient(90deg, #fc8181, #e53e3e) !important;
}

/* 空状态 */
.no-codes-message {
    text-align: center;
    padding: 60px 20px;
    color: #718096;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.empty-icon {
    font-size: 4rem;
    opacity: 0.5;
}

.empty-hint {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* 统计区域 */
.stats-section {
    margin-bottom: 40px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.stat-item {
    background: white;
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    transition: transform 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-3px);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 8px;
}

.stat-label {
    color: #718096;
    font-size: 0.9rem;
    font-weight: 500;
}

/* 规则区域 */
.rules-section {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.rules-section h3 {
    color: #2d3748;
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.rules-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.rules-list li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    color: #4a5568;
    line-height: 1.6;
}

.rules-list li::before {
    content: "✓";
    color: #48bb78;
    font-weight: bold;
    font-size: 1.1rem;
    margin-top: 2px;
}



/* 消息提示 */
.message-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    animation: slideInRight 0.3s ease;
}

.message-toast.success {
    border-left: 4px solid #48bb78;
}

.message-toast.warning {
    border-left: 4px solid #ed8936;
}

.message-toast.error {
    border-left: 4px solid #f56565;
}

.toast-icon {
    font-size: 1.2rem;
}

.toast-message {
    color: #2d3748;
    font-weight: 500;
}

/* 工具类 */
.hidden {
    display: none !important;
}

/* 动画 */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .main-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .section {
        padding: 20px;
    }
    
    .get-btn {
        padding: 18px 30px;
        font-size: 1rem;
    }
    
    .code-value {
        font-size: 1.4rem;
    }
    
    .codes-list {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .code-actions {
        flex-direction: column;
    }
    
    .action-btn {
        width: 100%;
        justify-content: center;
    }
    
    .feedback-buttons {
        flex-direction: column;
    }
    
    .feedback-btn {
        width: 100%;
        justify-content: center;
    }
    
    .message-toast {
        right: 15px;
        left: 15px;
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.8rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-number {
        font-size: 2rem;
    }
}