/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Microsoft YaHei", sans-serif;
}

/* 加载动画样式 */
#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: 9999;
}

.loading-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #666;
}

.loading-spinner img {
    max-width: 250px;
    max-height: 250px;
}

.loading-spinner::before {
    content: '';
    width: 30px;
    height: 30px;
    margin-right: 10px;
    border: 4px solid #ddd;
    border-top: 4px solid #2196F3;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: none; /* 隐藏默认的加载动画，使用图片代替 */
}

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

/* 消息提示样式 */
.message-popup {
    position: fixed;
    top: 20px;
    right: 20px;
    max-width: 300px;
    padding: 15px 20px;
    border-radius: 5px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    z-index: 9998;
    animation: slideIn 0.3s ease;
}

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

.message-popup.success {
    background-color: #e7f7e7;
    color: #28a745;
    border-left: 4px solid #28a745;
}

.message-popup.error {
    background-color: #fef0f0;
    color: #dc3545;
    border-left: 4px solid #dc3545;
}

.message-popup.info {
    background-color: #e7f3fe;
    color: #0c5460;
    border-left: 4px solid #17a2b8;
}

.message-popup.center {
    top: 50%;
    left: 50%;
    right: auto;
    transform: translate(-50%, -50%);
    text-align: center;
}

/* 主要内容区域样式 */
.main-content {
    flex-grow: 1;
    padding: 30px;
    margin-left: 300px;
    min-height: 100vh;
}

/* 统计卡片样式 */
.dashboard-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 20px;
}

.stat-card {
    flex: 1;
    min-width: 250px;
    background-color: #fff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
    text-align: center;
}

.stat-card h3 {
    color: #666;
    font-size: 16px;
    margin-bottom: 10px;
}

.stat-card .stat-value {
    font-size: 36px;
    font-weight: bold;
    color: #0c34ff;
    font-family: 'DigitalFont', sans-serif;
}

/* 订单管理样式 */
.order-filters {
    display: flex;
    gap: 15px;
    margin: 20px 0;
}

.search-input {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    flex-grow: 1;
}

.filter-select {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    min-width: 150px;
}

.order-list, .product-list {
    background-color: #fff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
    min-height: 300px;
}

.order-empty, .product-empty {
    text-align: center;
    padding: 30px;
    color: #999;
    font-size: 16px;
}

/* 产品管理样式 */
.add-product-btn {
    background-color: #0c34ff;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    margin-bottom: 20px;
    cursor: pointer;
    font-weight: bold;
}

.add-product-btn:hover {
    background-color: #0a2bd0;
}

/* 设置页面样式 */
.settings-section {
    background-color: #fff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
    margin-top: 20px;
}

.setting-item {
    display: flex;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #eee;
}

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

.setting-item label {
    width: 100px;
    font-weight: bold;
    color: #666;
}

.setting-item span {
    flex-grow: 1;
}

.edit-btn {
    background-color: #f0f0f0;
    border: none;
    padding: 5px 10px;
    border-radius: 3px;
    color: #666;
    cursor: pointer;
}

.edit-btn:hover {
    background-color: #e0e0e0;
}

/* 错误信息 */
.error-message {
    padding: 20px;
    background-color: #ffebee;
    border-left: 4px solid #f44336;
    margin: 20px 0;
    border-radius: 4px;
}

.error-message h3 {
    color: #d32f2f;
    margin-top: 0;
}

/* 欢迎指引 */
.welcome-guide {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.guide-content {
    background-color: white;
    border-radius: 8px;
    padding: 30px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.guide-content h2 {
    color: #1976D2;
    margin-top: 0;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 15px;
}

.guide-step {
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f5f5f5;
    border-radius: 6px;
}

.guide-step h3 {
    margin-top: 0;
    color: #333;
}

.guide-close-btn {
    background-color: #2196F3;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    margin-top: 20px;
    display: block;
    width: 100%;
}

.guide-close-btn:hover {
    background-color: #1976D2;
}

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

.modal-content {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    width: 80%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.close-modal {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
    color: #999;
}

.close-modal:hover {
    color: #333;
}

.order-info {
    background-color: #f5f5f5;
    padding: 15px;
    border-radius: 6px;
    margin: 15px 0;
}

.items-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.items-table th,
.items-table td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: left;
}

.items-table th {
    background-color: #f2f2f2;
}

.items-table tfoot {
    font-weight: bold;
}

.total-label {
    text-align: right;
}

.total-value {
    font-size: 18px;
    color: #d32f2f;
}

/* 表格样式 */
.order-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.order-table th,
.order-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #ddd;
}

.order-table th {
    background-color: #f8f8f8;
    font-weight: 600;
    text-align: left;
}

.order-table tr:hover {
    background-color: #f5f5f5;
}

.view-btn {
    background-color: #2196F3;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
}

.view-btn:hover {
    background-color: #0b7dda;
}

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

.product-card {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

.product-card:hover {
    transform: translateY(-5px);
}

.product-image {
    height: 180px;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-info {
    padding: 15px;
}

.product-info h3 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 18px;
}

.price {
    color: #d32f2f;
    font-weight: bold;
    font-size: 16px;
    margin: 5px 0;
}

.category {
    color: #666;
    font-size: 14px;
    margin-bottom: 15px;
}

.product-actions {
    display: flex;
    justify-content: space-between;
}

.edit-product-btn,
.delete-product-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.edit-product-btn {
    background-color: #4CAF50;
    color: white;
}

.delete-product-btn {
    background-color: #f44336;
    color: white;
}

.edit-product-btn:hover {
    background-color: #45a049;
}

.delete-product-btn:hover {
    background-color: #d32f2f;
}

/* 验证码组样式 */
.verification-group {
    display: flex;
    gap: 10px;
}

.verification-group input {
    flex-grow: 1;
}

.verification-code-btn {
    padding: 0 15px;
    height: 40px;
    background-color: #153dff;
    border: none;
    border-radius: 4px;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.verification-code-btn:hover {
    background-color: #0027c9;
}

.verification-code-btn:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

/* 步骤样式 */
.step-container {
    display: flex;
    justify-content: space-between;
    margin-bottom: 25px;
}

.step {
    flex: 1;
    text-align: center;
    position: relative;
}

.step:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 15px;
    right: -50%;
    width: 100%;
    height: 2px;
    background-color: #dcdfe6;
    z-index: 1;
}

.step.active:not(:last-child)::after {
    background-color: #153dff;
}

.step-number {
    width: 30px;
    height: 30px;
    line-height: 30px;
    border-radius: 50%;
    background-color: #dcdfe6;
    color: #fff;
    margin: 0 auto 10px;
    position: relative;
    z-index: 2;
    text-align: center;
}

.step.active .step-number {
    background-color: #153dff;
}

.step-title {
    font-size: 14px;
    color: #606266;
}

.step.active .step-title {
    color: #153dff;
    font-weight: 500;
}

/* 表单步骤切换 */
.step-form {
    display: none;
}

.step-form.active {
    display: block;
}