/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #03a9f4;
    --primary-dark: #0288d1;
    --accent-color: #ff7a22;
    --success-color: #4caf50;
    --warning-color: #ff9800;
    --danger-color: #f44336;
    --text-primary: #333;
    --text-secondary: #666;
    --text-light: #999;
    --bg-body: #f5f7fa;
    --bg-card: #ffffff;
    --border-color: #e8ecef;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

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

/* 头部 */
header {
    background: var(--bg-card);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    background: rgba(255,255,255,0.95);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 1px;
}

.nav {
    display: flex;
    gap: 8px;
}

.nav-btn {
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 500;
    transition: all 0.2s ease;
    background: transparent;
    border: none;
    cursor: pointer;
}

.nav-btn:hover {
    color: var(--primary-color);
    background: rgba(3, 169, 244, 0.08);
    text-decoration: none;
}

.nav-btn.active {
    color: var(--primary-color);
    background: rgba(3, 169, 244, 0.1);
}

/* 主内容区 */
main {
    padding: 24px 20px;
    padding-bottom: 60px;
}

/* 卡片样式 */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 24px;
    margin-bottom: 24px;
    transition: box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 公告区域 */
.notice-content {
    color: var(--text-secondary);
}

.notice-warning {
    background: linear-gradient(135deg, #fff5f5 0%, #fff0f0 100%);
    border-left: 4px solid var(--danger-color);
    padding: 16px 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    color: var(--danger-color);
    font-weight: 500;
}

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

.notice-item {
    background: var(--bg-body);
    padding: 16px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
}

.notice-item:last-child {
    margin-bottom: 0;
}

.notice-item h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.notice-item p {
    font-size: 14px;
    color: var(--text-secondary);
}

.email-list {
    list-style: none;
}

.email-list li {
    padding: 6px 0;
}

.email-list a {
    font-size: 13px;
}

.service-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.service-item {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.service-name {
    font-weight: 500;
    color: var(--text-primary);
}

.service-desc {
    color: var(--text-light);
    font-size: 13px;
}

.notice-tip {
    background: linear-gradient(135deg, #fffbe6 0%, #fff9e6 100%);
    border: 1px solid #ffe58f;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-top: 12px;
    color: var(--warning-color);
    font-size: 14px;
}

.wallet-address {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    font-family: monospace;
    background: var(--bg-body);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
}

.wallet-address code {
    color: var(--primary-color);
    font-size: 14px;
}

.btn-copy {
    background: var(--primary-color);
    color: #fff;
    border: none;
    padding: 4px 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

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

/* 分类标签 */
.category-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding: 4px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.tab-btn {
    padding: 10px 18px;
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab-btn:hover {
    color: var(--primary-color);
    background: rgba(3, 169, 244, 0.08);
}

.tab-btn.active {
    color: #fff;
    background: var(--primary-color);
}

/* 商品区域 */
.product-category {
    display: none;
}

.product-category.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

.category-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    padding-left: 12px;
    border-left: 3px solid var(--primary-color);
}

/* 商品表格 */
.product-table {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.product-table table {
    width: 100%;
    border-collapse: collapse;
}

.product-table th {
    background: var(--bg-body);
    padding: 14px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
}

.product-table td {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
    color: var(--text-secondary);
    vertical-align: middle;
}

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

.product-table tr:hover {
    background: rgba(3, 169, 244, 0.02);
}

.product-table td:first-child {
    color: var(--text-primary);
    font-weight: 500;
}

.product-table td:nth-child(2) {
    color: var(--accent-color);
    font-weight: 600;
    font-size: 15px;
}

/* 库存状态 */
.stock-in {
    color: var(--success-color);
    font-weight: 500;
}

.stock-low {
    color: var(--warning-color);
    font-weight: 500;
}

.stock-out {
    color: var(--danger-color);
    font-weight: 500;
}

/* 购买按钮 */
.btn-buy {
    background: var(--primary-color);
    color: #fff;
    border: none;
    padding: 8px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-buy:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(3, 169, 244, 0.3);
}

.btn-buy:disabled {
    background: var(--text-light);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 搜索表单 */
.search-form {
    display: flex;
    gap: 12px;
    max-width: 500px;
}

.search-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 14px;
    transition: all 0.2s ease;
    outline: none;
}

.search-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(3, 169, 244, 0.1);
}

.btn-search {
    background: var(--primary-color);
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

/* 页脚 */
footer {
    background: var(--bg-card);
    padding: 20px;
    text-align: center;
    color: var(--text-light);
    font-size: 14px;
    border-top: 1px solid var(--border-color);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        height: auto;
        padding: 12px 0;
        gap: 12px;
    }

    .logo {
        font-size: 20px;
    }

    .nav {
        width: 100%;
        justify-content: center;
    }

    .nav-btn {
        padding: 8px 16px;
        font-size: 14px;
    }

    main {
        padding: 16px 12px;
    }

    .card {
        padding: 16px;
    }

    .notice-grid {
        grid-template-columns: 1fr;
    }

    .service-list {
        grid-template-columns: 1fr;
    }

    .category-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    .tab-btn {
        white-space: nowrap;
        padding: 8px 14px;
        font-size: 13px;
    }

    .product-table {
        overflow-x: auto;
    }

    .product-table table {
        min-width: 600px;
    }

    .search-form {
        flex-direction: column;
    }

    .wallet-address {
        flex-direction: column;
        align-items: flex-start;
    }
}

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

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

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

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

/* 选中效果 */
::selection {
    background: var(--primary-color);
    color: #fff;
}
