/* 公众号托管平台 - 用户后台样式 */

:root {
    --primary: #07c160;
    --primary-dark: #05964a;
    --primary-light: #e6f7ed;
    --text: #333;
    --text-light: #666;
    --text-lighter: #999;
    --border: #e5e5e5;
    --bg: #f5f5f5;
    --white: #fff;
    --danger: #ff4d4f;
    --warning: #faad14;
    --success: #52c41a;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

/* 布局 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 侧边栏 */
.layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 220px;
    background: var(--white);
    border-right: 1px solid var(--border);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-logo {
    padding: 20px;
    font-size: 18px;
    font-weight: bold;
    color: var(--primary);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-menu {
    padding: 10px 0;
}

.menu-item {
    display: block;
    padding: 12px 20px;
    color: var(--text);
    text-decoration: none;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.menu-item:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.menu-item.active {
    background: var(--primary-light);
    color: var(--primary);
    border-left-color: var(--primary);
    font-weight: 500;
}

.menu-item i {
    margin-right: 8px;
    width: 20px;
    text-align: center;
}

/* 主内容区 */
.main {
    flex: 1;
    margin-left: 220px;
    padding: 20px;
}

.header {
    background: var(--white);
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.header-title {
    font-size: 20px;
    font-weight: 600;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-balance {
    color: var(--primary);
    font-weight: 500;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-outline {
    border: 1px solid var(--border);
    background: var(--white);
    color: var(--text);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
}

/* 卡片 */
.card {
    background: var(--white);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    margin-bottom: 20px;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

/* 统计卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--white);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.stat-label {
    color: var(--text-light);
    font-size: 14px;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 28px;
    font-weight: 600;
    color: var(--text);
}

.stat-value.primary {
    color: var(--primary);
}

/* 表格 */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.table th {
    font-weight: 500;
    color: var(--text-light);
    font-size: 14px;
}

.table tr:hover td {
    background: var(--primary-light);
}

/* 表单 */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text);
}

.form-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
}

.form-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    background: var(--white);
}

/* 状态标签 */
.status-tag {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
}

.status-active {
    background: var(--primary-light);
    color: var(--primary);
}

.status-inactive {
    background: #f5f5f5;
    color: var(--text-lighter);
}

.status-pending {
    background: #fff7e6;
    color: var(--warning);
}

/* 套餐卡片 */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.pricing-card {
    background: var(--white);
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    border: 2px solid var(--border);
    transition: all 0.3s;
}

.pricing-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.pricing-card.featured {
    border-color: var(--primary);
    position: relative;
}

.pricing-card.featured::before {
    content: '最受欢迎';
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: var(--white);
    padding: 4px 16px;
    border-radius: 20px;
    font-size: 12px;
}

.pricing-name {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 10px;
}

.pricing-price {
    font-size: 36px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 5px;
}

.pricing-price span {
    font-size: 14px;
    font-weight: 400;
    color: var(--text-light);
}

.pricing-desc {
    color: var(--text-light);
    margin-bottom: 20px;
}

.pricing-features {
    list-style: none;
    text-align: left;
    margin-bottom: 20px;
}

.pricing-features li {
    padding: 8px 0;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 8px;
}

.pricing-features li::before {
    content: '✓';
    color: var(--primary);
    font-weight: bold;
}

/* 邀请码 */
.invite-code-box {
    background: var(--primary-light);
    border: 1px dashed var(--primary);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    margin-bottom: 20px;
}

.invite-code {
    font-size: 24px;
    font-weight: 600;
    color: var(--primary);
    letter-spacing: 2px;
}

/* 优惠券 */
.coupon-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.coupon-item {
    display: flex;
    align-items: center;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 15px 20px;
}

.coupon-amount {
    font-size: 28px;
    font-weight: 700;
    color: var(--danger);
    margin-right: 20px;
}

.coupon-info {
    flex: 1;
}

.coupon-code {
    font-weight: 500;
    margin-bottom: 4px;
}

.coupon-expire {
    font-size: 12px;
    color: var(--text-lighter);
}

/* 弹窗 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: var(--white);
    border-radius: 12px;
    padding: 30px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-lighter);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

/* 登录页 */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, #0ba360 100%);
}

.login-box {
    background: var(--white);
    border-radius: 12px;
    padding: 40px;
    width: 400px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.login-logo {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo h1 {
    font-size: 24px;
    color: var(--primary);
}

.login-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    margin-bottom: 25px;
}

.login-tab {
    flex: 1;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    color: var(--text-light);
}

.login-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 500;
}

.login-form {
    display: none;
}

.login-form.active {
    display: block;
}

.login-btn {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    margin-top: 10px;
}

/* 消息提示 */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 6px;
    color: var(--white);
    z-index: 2000;
    animation: slideIn 0.3s ease;
}

.toast.success {
    background: var(--success);
}

.toast.error {
    background: var(--danger);
}

.toast.info {
    background: var(--primary);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

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

.empty-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

/* 响应式 */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .pricing-grid {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        width: 60px;
    }
    
    .sidebar-logo span,
    .menu-item span {
        display: none;
    }
    
    .main {
        margin-left: 60px;
    }
}
