:root {
    --primary: #4285f4;
    --secondary: #f1f3f4;
    --accent: #ea4335;
    --text: #202124;
    --text-secondary: #5f6368;
    --bg-light: #ffffff;
    --bg-lighter: #f8f9fa;
    --border: #dadce0;
    --success: #34a853;
    --warning: #fbbc05;
    --danger: #ea4335;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

body {
    background-color: var(--bg-light);
    color: var(--text);
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* 左侧导航面板 */
.sidebar {
    width: 260px;
    background-color: var(--bg-lighter);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 15px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

.sidebar-header {
    padding: 18px 20px;
    background: linear-gradient(to right, var(--primary), var(--bg-lighter));
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    color: white;
    font-size: 20px;
    display: flex;
    align-items: center;
    height: 60px;
}

.sidebar-header i {
    margin-right: 12px;
    font-size: 22px;
    color: white;
}

.sidebar-content {
    padding: 0;
    flex-grow: 1;
    overflow-y: auto;
}

.nav-group {
    margin-bottom: 20px;
}

.nav-group-title {
    padding: 10px 20px;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
}

.nav-group-title i {
    margin-right: 10px;
    font-size: 18px;
}

.nav-item {
    padding: 12px 20px 12px 50px;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    font-size: 16px;
    color: var(--text-secondary);
    text-decoration: none;
}

.nav-item:hover {
    background-color: rgba(66, 133, 244, 0.1);
    color: var(--text);
}

.nav-item.active {
    background: linear-gradient(to right, rgba(66, 133, 244, 0.1), transparent);
    color: var(--primary);
    border-left: 3px solid var(--primary);
}

.nav-item i {
    margin-right: 12px;
    width: 20px;
    text-align: center;
    font-size: 16px;
    transition: color 0.2s;
}

.nav-item.active i {
    color: var(--primary);
}

.nav-item .badge {
    margin-left: auto;
    background-color: var(--primary);
    color: white;
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 10px;
}

/* 右侧主内容区 */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.toolbar {
    padding: 15px 25px;
    background: linear-gradient(to right, var(--bg-lighter), var(--bg-light));
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    height: 60px;
}

.toolbar-search {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    max-width: 520px;
}

.toolbar-search input[type="text"] {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #dcdfe6;
    border-radius: 6px;
    background: #fff;
    outline: none;
}

.toolbar-search input[type="text"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(66, 133, 244, 0.15);
}

.toolbar-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text);
}

.toolbar-actions {
    display: flex;
    gap: 10px;
}

.btn {
    padding: 8px 16px;
    background-color: var(--secondary);
    border: none;
    border-radius: 4px;
    color: var(--text);
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    border: 1px solid var(--border);
    text-decoration: none;
}

.btn i {
    margin-right: 6px;
}

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

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

.btn-primary:hover {
    background-color: #3367d6;
    border-color: #3367d6;
}

.content-area {
    flex-grow: 1;
    padding: 25px;
    overflow-y: auto;
    background-color: var(--bg-light);
}

/* 根据图片样式调整的产品区域 */
.section-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 20px;
}

.warning-banner {
    background-color: #fff8e1;
    border: 1px solid #ffecb3;
    border-left: 4px solid #ffb300;
    padding: 12px 20px;
    margin-bottom: 20px;
    color: #5d4037;
    font-size: 13px;
    line-height: 1.5;
    border-radius: 4px;
}

.warning-banner i {
    color: #ff9800;
    margin-right: 8px;
}

/* 产品列表样式 - 列表模式 */
.product-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.product-item {
    display: flex;
    align-items: flex-start;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-light);
    transition: all 0.2s ease;
    cursor: pointer;
}

.product-item:hover {
    background: var(--bg-lighter);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.product-item.purchased-item {
    background: #e3f2fd;
    border-color: #bbdefb;
}

.product-item.purchased-item:hover {
    background: #c5e1f5;
}

.product-icon {
    width: 120px;
    height: 90px;
    background: #f7f8fa;
    border: 1px solid var(--border);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 16px;
    color: var(--primary);
    font-size: 16px;
    flex-shrink: 0;
    overflow: hidden;
}

.product-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.product-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.product-header-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
}

.product-main {
    flex: 1 1 320px;
    min-width: 240px;
}

.product-header {
    display: flex;
    align-items: center;
    margin-bottom: 6px;
    flex-wrap: wrap;
    gap: 8px;
}

.product-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin-right: 8px;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-info-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
}

.product-desc {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 0;
    padding-right: 16px;
    border-right: 1px solid var(--border);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 14px;
    color: var(--text-secondary);
    flex: 0 0 220px;
    align-items: flex-end;
    text-align: right;
}

.product-meta-price .product-price {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary);
}

.product-meta-row {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: flex-end;
    width: 100%;
}

.product-meta-tags {
    gap: 8px;
}

.product-meta-item {
    display: flex;
    align-items: center;
}

.product-meta-item i {
    margin-right: 4px;
    font-size: 14px;
}

.product-meta-item.rating {
    color: #ff9800;
}

/* 标签筛选 */
.tags-filter {
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tag-item {
    padding: 8px 16px;
    background: var(--bg-lighter);
    border-radius: 20px;
    text-decoration: none;
    color: var(--text);
    transition: all 0.3s;
    border: 1px solid var(--border);
}

.tag-item:hover,
.tag-item.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 分页 */
.pagination {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.page-btn {
    padding: 8px 16px;
    background-color: var(--secondary);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text);
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.page-btn:hover,
.page-btn.active {
    background-color: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Font Awesome 字体声明 */
@font-face {
    font-family: 'Font Awesome 6 Free';
    font-style: normal;
    font-weight: 900;
    font-display: block;
    src: url("https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/webfonts/fa-solid-900.woff2") format("woff2");
}

/* Font Awesome 图标样式 */
.fas {
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
}

/* 页面使用的图标样式 */
.fas.fa-chart-line:before { content: "\f201"; }
.fas.fa-user-circle:before { content: "\f2bd"; }
.fas.fa-server:before { content: "\f233"; }
.fas.fa-user:before { content: "\f007"; }
.fas.fa-chart-bar:before { content: "\f080"; }
.fas.fa-chart-pie:before { content: "\f200"; }
.fas.fa-robot:before { content: "\f544"; }
.fas.fa-cogs:before { content: "\f085"; }
.fas.fa-scroll:before { content: "\f70e"; }
.fas.fa-bolt:before { content: "\f0e7"; }
.fas.fa-tools:before { content: "\f7d9"; }
.fas.fa-terminal:before { content: "\f120"; }
.fas.fa-toolbox:before { content: "\f552"; }
.fas.fa-sync-alt:before { content: "\f2f1"; }
.fas.fa-plus:before { content: "\f067"; }
.fas.fa-exclamation-triangle:before { content: "\f071"; }
.fas.fa-calendar-alt:before { content: "\f073"; }
.fas.fa-star:before { content: "\f005"; }
.fas.fa-memory:before { content: "\f538"; }
.fas.fa-chart-area:before { content: "\f1fe"; }
.fas.fa-balance-scale:before { content: "\f24e"; }
.fas.fa-clock:before { content: "\f017"; }
.fas.fa-download:before { content: "\f019"; }
.fas.fa-eye:before { content: "\f06e"; }
.fas.fa-tag:before { content: "\f02b"; }
.fas.fa-sign-in-alt:before { content: "\f2f6"; }
.fas.fa-sign-out-alt:before { content: "\f2f5"; }
.fas.fa-list:before { content: "\f03a"; }
.fas.fa-arrow-left:before { content: "\f060"; }
.fas.fa-shopping-cart:before { content: "\f07a"; }
.fas.fa-check-circle:before { content: "\f058"; }
.fas.fa-copy:before { content: "\f0c5"; }
.fas.fa-link:before { content: "\f0c1"; }
.fas.fa-eye:before { content: "\f06e"; }
.fas.fa-wallet:before { content: "\f555"; }
.fas.fa-check-circle:before { content: "\f058"; }

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-lighter);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* 产品详情页样式 */
.product-detail-page {
    padding: 25px;
}

.product-detail-card {
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 22px;
    margin-bottom: 20px;
}

.product-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.product-top-left {
    flex: 1;
    min-width: 0;
}

.product-top-right {
    min-width: 200px;
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.product-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 12px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.product-images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.product-images img {
    width: 100%;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #fff;
    object-fit: cover;
    min-height: 160px;
}

.product-price-large {
    font-size: 26px;
    color: var(--primary);
    font-weight: bold;
    margin-bottom: 10px;
}

.product-desc {
    margin-top: 10px;
}

.product-desc {
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 20px;
    overflow: visible;
    display: block;
    white-space: normal;
    word-break: break-word;
}

/* 详情页正文去掉列表样式的右边框/内边距 */
.product-detail-card .product-desc {
    border: none;
    padding-right: 0;
    margin-bottom: 16px;
}

.product-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
}

.product-tag {
    padding: 6px 12px;
    background: var(--bg-lighter);
    border-radius: 20px;
    font-size: 14px;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-buy {
    padding: 9px 22px;
    background: linear-gradient(135deg, var(--primary) 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
    box-shadow: 0 4px 10px rgba(64, 158, 255, 0.15);
}

.btn-buy:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(66, 133, 244, 0.3);
}

.btn-buy.purchased {
    background: var(--success);
}

.btn-buy.purchased:hover {
    background: #2d8f47;
}

.purchased-info {
    background: #e3f2fd;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    color: #1976d2;
    border-left: 4px solid var(--success);
}

.paid-view-content {
    background: var(--bg-lighter);
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    border: 1px solid var(--border);
}

.paid-view-item {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
}

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

.paid-view-label {
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
    font-size: 14px;
}

.paid-view-value {
    color: var(--text-secondary);
    word-break: break-all;
    font-size: 14px;
}

.copy-btn {
    padding: 6px 12px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    margin-left: 10px;
    transition: all 0.2s;
}

.copy-btn:hover {
    background: #3367d6;
}

.copy-btn.copied {
    background: var(--success);
}

.share-box {
    background: #f0f7ff;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
    border: 1px solid rgba(66, 133, 244, 0.2);
}

.share-box h3 {
    font-size: 16px;
    margin-bottom: 10px;
    color: var(--text);
}

.share-url {
    background: white;
    padding: 10px;
    border-radius: 5px;
    border: 1px solid var(--border);
    margin: 10px 0;
    word-break: break-all;
    font-family: monospace;
    font-size: 14px;
    color: var(--text);
}

.btn-share {
    padding: 10px 20px;
    background: var(--success);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    margin-right: 10px;
    transition: all 0.2s;
}

.btn-share:hover {
    background: #2d8f47;
}

/* 用户中心样式 */
.user-center-card {
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 20px;
}

.user-info {
    display: flex;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.user-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 32px;
    margin-right: 20px;
    flex-shrink: 0;
}

.user-details {
    flex: 1;
}

.user-email {
    font-size: 20px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 5px;
}

.user-balance {
    color: var(--text-secondary);
    font-size: 14px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--bg-lighter);
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid var(--border);
    transition: all 0.2s;
}

.stat-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.stat-value {
    font-size: 32px;
    font-weight: bold;
    color: var(--primary);
    margin-bottom: 5px;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 14px;
}

.section {
    margin-bottom: 30px;
}

.section-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary);
}

.invite-box {
    background: #f0f7ff;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid rgba(66, 133, 244, 0.2);
}

.invite-url {
    background: white;
    padding: 15px;
    border-radius: 5px;
    border: 1px solid var(--border);
    margin: 10px 0;
    word-break: break-all;
    font-family: monospace;
    font-size: 14px;
    color: var(--text);
}

.share-product-box {
    background: #fff3cd;
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
    border: 1px solid #ffecb3;
}

.share-product-input {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 5px;
    margin: 10px 0;
    font-family: monospace;
    font-size: 14px;
    color: var(--text);
}

.orders-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-light);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border);
}

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

.orders-table th {
    background: var(--bg-lighter);
    font-weight: 600;
    color: var(--text);
}

.orders-table tr:hover {
    background: var(--bg-lighter);
}

.orders-table tr:last-child td {
    border-bottom: none;
}

.orders-table tr.purchased-row {
    background: #e3f2fd;
}

.orders-table tr.purchased-row:hover {
    background: #bbdefb;
}

/* 已购买产品卡片高亮 */
.product-item.purchased-item {
    background: #e8f4fd;
    border-color: #90caf9;
}

.product-item.purchased-item:hover {
    background: #d0e8f7;
}

.badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.badge-success {
    background: #e3f2fd;
    color: #1976d2;
}

.badge-warning {
    background: #fff3cd;
    color: #856404;
}

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

.modal-content {
    background: var(--bg-light);
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: var(--text);
    font-size: 18px;
}

.modal-close {
    color: var(--text-secondary);
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text);
}

.modal-body {
    padding: 20px;
}

.form-group {
    margin-bottom: 20px;
}

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

.form-input {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 5px;
    font-size: 14px;
    color: var(--text);
    box-sizing: border-box;
}

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

/* 响应式调整 */
@media (max-width: 1200px) {
    .sidebar {
        width: 220px;
    }
}

@media (max-width: 768px) {
    body {
        flex-direction: column;
        overflow-y: auto;
        height: auto;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border);
        box-shadow: none;
    }
    
    .sidebar-content {
        display: none;
    }
    
    .sidebar-header {
        justify-content: center;
        background: var(--primary);
    }
    
    .main-content {
        height: auto;
    }
    
    .toolbar {
        padding: 12px 15px;
        height: auto;
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    
    .toolbar-title {
        font-size: 18px;
        text-align: center;
    }
    
    .toolbar-actions {
        justify-content: center;
    }
    
    .content-area {
        padding: 15px;
    }
    
    .product-item {
        flex-direction: column;
        align-items: stretch;
        padding: 12px;
    }
    
    .product-icon {
        margin-right: 0;
        margin-bottom: 12px;
        align-self: center;
    }
    
    .product-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .product-info-row {
        flex-direction: column;
        gap: 12px;
    }
    
    .product-desc {
        border-right: none;
        padding-right: 0;
        border-bottom: 1px solid var(--border);
        padding-bottom: 12px;
    }
    
    .product-meta {
        flex-wrap: wrap;
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .sidebar-header {
        font-size: 18px;
    }
    
    .sidebar-header i {
        font-size: 20px;
    }
    
    .toolbar-title {
        font-size: 16px;
    }
    
    .btn {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .product-name {
        font-size: 15px;
    }
    
    .product-desc {
        font-size: 13px;
    }
    
    .product-meta {
        font-size: 13px;
    }
}

