/* 全局重置与基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #ec4899;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    --light: #f3f4f6;
    --dark: #1f2937;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --white: #ffffff;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
}

body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--dark);
    line-height: 1.6;
    padding: 20px 0;
}

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

/* 头部样式 */
.header {
    text-align: center;
    padding: 3rem 0;
    margin-bottom: 2rem;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.header p {
    font-size: 1.125rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 400;
}

/* 主内容区 */
.main {
    margin-bottom: 2rem;
}

/* 商品网格 */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.product-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    transition: all 0.3s ease;
    position: relative;
}

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

.product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.product-card .card-body {
    padding: 2rem;
    text-align: center;
}

.product-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 1rem;
}

.product-card .price {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.product-card .price small {
    font-size: 1rem;
    font-weight: 400;
    color: var(--gray-600);
}

.product-card .stock {
    color: var(--gray-600);
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 0.75rem 2rem;
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--white);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-800);
}

.btn-secondary:hover {
    background: var(--gray-200);
}

/* 结算卡片 */
.checkout-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    max-width: 500px;
    margin: 0 auto;
    box-shadow: var(--shadow-xl);
    text-align: center;
}

.checkout-card h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 1.5rem;
}

.checkout-card .price {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 2rem;
}

/* 表格样式 */
.table-container {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: 2rem;
    box-shadow: var(--shadow-xl);
    overflow-x: auto;
}

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

thead {
    background: var(--gray-100);
}

th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--gray-700);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

td {
    padding: 1rem;
    border-bottom: 1px solid var(--gray-200);
    color: var(--gray-700);
}

tbody tr {
    transition: background 0.2s ease;
}

tbody tr:hover {
    background: var(--gray-100);
}

/* 登录容器 */
.login-container {
    max-width: 400px;
    margin: 4rem auto;
    padding: 2.5rem;
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
}

.login-container h2 {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 2rem;
}

.login-container input {
    width: 100%;
    padding: 0.875rem 1rem;
    margin-bottom: 1rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.login-container input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.login-container .btn {
    width: 100%;
    margin-top: 1rem;
}

/* 页脚 */
.footer {
    text-align: center;
    padding: 2rem 0;
    color: rgba(255, 255, 255, 0.8);
}

.footer a {
    color: var(--white);
    text-decoration: none;
    font-weight: 500;
    margin: 0 0.5rem;
    transition: color 0.3s ease;
}

.footer a:hover {
    color: var(--light);
    text-decoration: underline;
}

/* 响应式适配 */
@media (max-width: 768px) {
    .header h1 {
        font-size: 2rem;
    }
    
    .product-grid {
        grid-template-columns: 1fr;
    }
    
    .checkout-card {
        padding: 1.5rem;
    }
    
    .table-container {
        padding: 1rem;
    }
}
