/**
 * 秀站成品市场 - 前端样式
 * Author: 金小乐
 */

/* ==================== 全局样式 ==================== */
:root {
    --primary: #667eea;
    --primary-dark: #5a67d8;
    --secondary: #764ba2;
    --success: #48bb78;
    --warning: #ed8936;
    --danger: #f56565;
    --dark: #2d3748;
    --gray: #a0aec0;
    --light: #f7fafc;
    --border: #e2e8f0;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 10px 30px rgba(0, 0, 0, 0.1);
    --radius: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
}

/* ==================== 产品列表页 ==================== */
.xiuweb-product-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.xiuweb-product-header {
    text-align: center;
    margin-bottom: 40px;
}

.xiuweb-product-header h1 {
    font-size: 36px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

.xiuweb-product-header p {
    font-size: 16px;
    color: var(--gray);
}

/* 筛选栏 */
.xiuweb-product-filters {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 30px;
    padding: 20px;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.xiuweb-search-box {
    flex: 1;
    min-width: 200px;
    display: flex;
    align-items: center;
    background: var(--light);
    border-radius: 40px;
    padding: 0 15px;
}

.xiuweb-search-box .search-icon {
    color: var(--gray);
    margin-right: 10px;
}

.xiuweb-search-box input {
    flex: 1;
    padding: 12px 0;
    border: none;
    background: transparent;
    outline: none;
    font-size: 14px;
}

.xiuweb-sort-select {
    padding: 10px 15px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: white;
    font-size: 14px;
    cursor: pointer;
    outline: none;
}

/* 产品网格 */
.xiuweb-product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}

.xiuweb-product-card {
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    position: relative;
}

.xiuweb-product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.xiuweb-product-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    z-index: 1;
}

.xiuweb-product-badge.hot {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: white;
}

.xiuweb-product-badge.recommend {
    background: linear-gradient(135deg, #f093fb, #f5576c);
    color: white;
}

.xiuweb-product-badge.new {
    background: linear-gradient(135deg, #4facfe, #00f2fe);
    color: white;
}

.xiuweb-product-icon {
    text-align: center;
    padding: 30px 20px 20px;
    font-size: 60px;
}

.xiuweb-product-title {
    font-size: 20px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 10px;
    color: var(--dark);
}

.xiuweb-product-desc {
    font-size: 14px;
    color: var(--gray);
    text-align: center;
    margin-bottom: 20px;
    padding: 0 15px;
    line-height: 1.5;
}

.xiuweb-product-specs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 15px;
    background: var(--light);
    margin: 0 15px 20px;
    border-radius: 8px;
}

.xiuweb-spec-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--dark);
}

.xiuweb-spec-icon {
    font-size: 14px;
}

.xiuweb-product-price {
    text-align: center;
    padding: 0 15px;
    margin-bottom: 20px;
}

.xiuweb-price {
    font-size: 28px;
    font-weight: 700;
    color: var(--danger);
}

.xiuweb-price-unit {
    font-size: 12px;
    color: var(--gray);
    margin-left: 4px;
}

.xiuweb-original-price {
    font-size: 14px;
    color: var(--gray);
    text-decoration: line-through;
    margin-left: 10px;
}

.xiuweb-product-actions {
    padding: 0 15px 20px;
}

.xiuweb-btn-buy {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.xiuweb-btn-buy:hover {
    transform: scale(1.02);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

/* ==================== 用户面板 ==================== */
.xiuweb-user-dashboard {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
}

/* 用户头部 */
.xiuweb-user-header {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: var(--radius);
    padding: 30px;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    color: white;
}

.xiuweb-user-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid white;
    overflow: hidden;
}

.xiuweb-user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.xiuweb-user-info h2 {
    margin: 0 0 5px;
    font-size: 24px;
}

.xiuweb-user-info p {
    margin: 0 0 5px;
    opacity: 0.9;
}

.xiuweb-user-role {
    display: inline-block;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    font-size: 12px;
}

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

.xiuweb-stat-card {
    background: white;
    padding: 20px;
    border-radius: var(--radius);
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.xiuweb-stat-card:hover {
    transform: translateY(-3px);
}

.xiuweb-stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary);
    display: block;
}

.xiuweb-stat-label {
    font-size: 14px;
    color: var(--gray);
    margin-top: 5px;
}

/* Tab 选项卡 */
.xiuweb-user-tabs {
    display: flex;
    gap: 5px;
    background: white;
    padding: 5px;
    border-radius: var(--radius);
    margin-bottom: 30px;
    box-shadow: var(--shadow);
}

.xiuweb-tab-btn {
    flex: 1;
    padding: 12px;
    background: none;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
}

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

/* Tab 内容 */
.xiuweb-tab-content {
    display: none;
}

.xiuweb-tab-content.active {
    display: block;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 站点卡片 */
.xiuweb-sites-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.xiuweb-sites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.xiuweb-site-card {
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.xiuweb-site-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

.xiuweb-site-header {
    background: linear-gradient(135deg, #667eea, #764ba2);
    padding: 20px;
    color: white;
}

.xiuweb-site-domain {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 5px;
    word-break: break-all;
}

.xiuweb-site-status {
    display: inline-block;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    font-size: 12px;
}

.xiuweb-site-body {
    padding: 20px;
}

.xiuweb-site-info-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 13px;
}

.xiuweb-site-info-label {
    color: var(--gray);
}

.xiuweb-site-info-value {
    color: var(--dark);
    font-weight: 500;
}

.xiuweb-site-progress {
    margin: 15px 0;
}

.xiuweb-progress-bar {
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
}

.xiuweb-progress-fill {
    height: 100%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 3px;
    transition: width 0.3s;
}

.xiuweb-progress-text {
    font-size: 12px;
    color: var(--gray);
    margin-top: 5px;
}

.xiuweb-site-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 15px 20px 20px;
    border-top: 1px solid var(--border);
}

.xiuweb-action-btn {
    flex: 1;
    padding: 8px;
    background: var(--light);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: var(--transition);
    text-align: center;
    text-decoration: none;
    color: var(--dark);
}

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

.xiuweb-action-btn.danger:hover {
    background: var(--danger);
}

/* 订单表格 */
.xiuweb-orders-table {
    width: 100%;
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

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

.xiuweb-orders-table th {
    background: var(--light);
    font-weight: 600;
}

.xiuweb-orders-table tr:hover {
    background: var(--light);
}

/* 域名管理 */
.xiuweb-domain-form {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.xiuweb-domain-form select,
.xiuweb-domain-form input {
    flex: 1;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
}

.xiuweb-domains-table {
    width: 100%;
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

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

/* 订单表单 */
.xiuweb-order-form-container {
    max-width: 600px;
    margin: 0 auto;
    background: white;
    border-radius: var(--radius);
    padding: 30px;
    box-shadow: var(--shadow);
}

.xiuweb-order-summary {
    background: var(--light);
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
}

.xiuweb-summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.xiuweb-summary-row.total {
    border-top: 1px solid var(--border);
    padding-top: 10px;
    margin-top: 10px;
    font-weight: 700;
    font-size: 18px;
}

/* 支付方式 */
.xiuweb-payment-methods {
    display: flex;
    gap: 15px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.xiuweb-payment-option {
    flex: 1;
    padding: 15px;
    border: 2px solid var(--border);
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.xiuweb-payment-option.selected {
    border-color: var(--primary);
    background: rgba(102, 126, 234, 0.05);
}

.xiuweb-payment-icon {
    font-size: 32px;
    display: block;
    margin-bottom: 8px;
}

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

.xiuweb-modal-content {
    background: white;
    border-radius: var(--radius);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

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

.xiuweb-modal-body {
    padding: 20px;
}

.xiuweb-modal-footer {
    padding: 20px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

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

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

.xiuweb-form-group input,
.xiuweb-form-group select,
.xiuweb-form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    transition: var(--transition);
}

.xiuweb-form-group input:focus,
.xiuweb-form-group select:focus,
.xiuweb-form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 状态徽章 */
.xiuweb-status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.xiuweb-status-badge.running,
.xiuweb-status-badge.paid,
.xiuweb-status-badge.active {
    background: #d4edda;
    color: #155724;
}

.xiuweb-status-badge.pending {
    background: #fff3cd;
    color: #856404;
}

.xiuweb-status-badge.suspended,
.xiuweb-status-badge.expired {
    background: #f8d7da;
    color: #721c24;
}

/* 通知提示 */
.xiuweb-notice {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    color: white;
    z-index: 1001;
    animation: slideInRight 0.3s;
}

.xiuweb-notice.success {
    background: var(--success);
}

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

.xiuweb-notice.warning {
    background: var(--warning);
}

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

/* 加载动画 */
.xiuweb-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.xiuweb-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* 响应式设计 */
@media (max-width: 768px) {
    .xiuweb-product-grid {
        grid-template-columns: 1fr;
    }
    
    .xiuweb-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .xiuweb-sites-grid {
        grid-template-columns: 1fr;
    }
    
    .xiuweb-user-header {
        flex-direction: column;
        text-align: center;
    }
    
    .xiuweb-user-tabs {
        flex-wrap: wrap;
    }
    
    .xiuweb-domain-form {
        flex-direction: column;
    }
    
    .xiuweb-orders-table {
        display: block;
        overflow-x: auto;
    }
}

@media (max-width: 480px) {
    .xiuweb-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .xiuweb-product-filters {
        flex-direction: column;
    }
    
    .xiuweb-search-box {
        width: 100%;
    }
    
    .xiuweb-sort-select {
        width: 100%;
    }
}