/* common.css - 网站通用样式 */

/* 页面背景 */
body {
    background: linear-gradient(135deg, #e6f2ff, #f5edff, #fff5f5);
    min-height: 100vh;
}

/* 容器 */
.container {
    width: 1200px;
    margin: 0 auto;
    padding: 15px;
    /* 移除白色背景和阴影，实现卡片化设计 */
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 6px 12px;
    margin-bottom: 0;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.42857143;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    cursor: pointer;
    border: 1px solid transparent;
    border-radius: 4px;
}

.btn-primary {
    color: #fff;
    background-color: #1890ff;
    border-color: #1890ff;
}

.btn-primary:hover {
    background-color: #40a9ff;
    border-color: #40a9ff;
}

.btn-success {
    color: #fff;
    background-color: #52c41a;
    border-color: #52c41a;
}

.btn-success:hover {
    background-color: #73d13d;
    border-color: #73d13d;
}

.btn-danger {
    color: #fff;
    background-color: #f5222d;
    border-color: #f5222d;
}

.btn-danger:hover {
    background-color: #ff4d4f;
    border-color: #ff4d4f;
}

/* 标题样式 */
.section-title {
    font-size: 18px;
    font-weight: bold;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
    margin-bottom: 15px;
}

/* 表单元素 */
input[type="text"],
input[type="password"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: border-color 0.3s;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
    border-color: #1890ff;
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
}

select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url('../images/arrow-down.png');
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px;
    padding-right: 30px;
}

/* 标签 */
.tag {
    display: inline-block;
    padding: 2px 8px;
    font-size: 12px;
    border-radius: 2px;
    color: #fff;
    margin-right: 5px;
}

.tag-recommend {
    background-color: #f5222d;
}

.tag-hot {
    background-color: #fa8c16;
}

.tag-new {
    background-color: #1890ff;
}

.tag-limited {
    background-color: #722ed1;
}

/* 价格 */
.price {
    color: #f5222d;
    font-size: 16px;
    font-weight: bold;
}

/* 分页 */
.pagination {
    text-align: center;
    padding: 20px 0;
}

.pagination a {
    display: inline-block;
    padding: 5px 10px;
    margin: 0 3px;
    border: 1px solid #ddd;
    border-radius: 3px;
}

.pagination a.active {
    background-color: #1890ff;
    color: #fff;
    border-color: #1890ff;
}

.pagination a:hover:not(.active) {
    border-color: #1890ff;
    color: #1890ff;
}

/* 响应式布局 */
@media screen and (max-width: 1200px) {
    .container {
        width: 100%;
        padding: 10px;
    }
}

@media screen and (max-width: 768px) {
    .container {
        padding: 5px;
    }
}

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

.loading-spinner {
    text-align: center;
}

.spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-left-color: #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-text {
    margin-top: 10px;
    font-size: 16px;
    color: #333;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* 错误提示 */
.error-message {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #f44336;
    color: white;
    padding: 15px 20px;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 1001;
    display: none;
}

/* 产品列表中的加载状态 */
.loading {
    text-align: center;
    padding: 30px;
    font-size: 16px;
    color: #666;
}

/* 无产品提示 */
.no-products {
    text-align: center;
    padding: 50px 0;
    font-size: 18px;
    color: #666;
}