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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

/* 登录页面样式 */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h1 {
    color: #333;
    margin-bottom: 0.5rem;
}

.login-header p {
    color: #666;
}

.login-form .form-group {
    margin-bottom: 1rem;
}

.login-form label {
    display: block;
    margin-bottom: 0.5rem;
    color: #555;
    font-weight: 500;
}

.login-form input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

.login-form input:focus {
    outline: none;
    border-color: #667eea;
}

.login-btn {
    width: 100%;
    padding: 0.75rem;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    margin-top: 1rem;
}

.login-btn:hover {
    background: #5a6fd8;
}

.login-footer {
    text-align: center;
    margin-top: 1.5rem;
    color: #666;
}

.login-footer a {
    color: #667eea;
    text-decoration: none;
}

/* 通用头部样式 */
.header {
    background: white;
    padding: 15px 20px;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header h1 {
    color: #333;
    font-size: 1.5rem;
    margin: 0;
}

.back-btn {
    color: #667eea;
    text-decoration: none;
    padding: 8px 16px;
    border: 1px solid #667eea;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.3s;
}

.back-btn:hover {
    background: #667eea;
    color: white;
}

/* 注册页面特定布局 */
.register-page {
    background: #f5f5f5;
    min-height: 100vh;
}

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

/* 商家中心头部样式 */
.dashboard .header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between; /* 改为两端对齐 */
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: relative;
}

.dashboard .header h1 {
    color: white;
    margin: 0;
    position: absolute; /* 标题绝对定位居中 */
    left: 50%;
    transform: translateX(-50%);
}

.dashboard .user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-left: auto; /* 推到右侧 */
}

.dashboard .headerShopName {
    color: white;
    font-size: 14px;
    margin: 0;
}

.dashboard .logout-btn {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.3s;
    cursor: pointer;
}

.dashboard .logout-btn:hover {
    background: rgba(255,255,255,0.3);
    border-color: rgba(255,255,255,0.5);
    transform: translateY(-1px);
}

.dashboard .user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    color: white;
}

.dashboard .user-info button {
    padding: 6px 12px;
    background: rgba(255,255,255,0.2);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 4px;
    cursor: pointer;
}

.dashboard .user-info button:hover {
    background: rgba(255,255,255,0.3);
}

/* 商家卡片样式 */
.shop-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.shop-card img {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    object-fit: cover;
}

.shop-info h2 {
    margin: 0 0 10px 0;
    color: #333;
}

.shop-info p {
    margin: 5px 0;
    color: #666;
    font-size: 14px;
}

/* 数据统计网格 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-item {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;
}

.stat-item h3 {
    margin: 0 0 10px 0;
    color: #666;
    font-size: 14px;
    font-weight: normal;
}

.stat-item .amount {
    font-size: 24px;
    font-weight: bold;
    color: #667eea;
    margin: 0;
}

/* 导航网格 */
.nav-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
}

.nav-item {
    background: white;
    padding: 30px 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-decoration: none;
    color: #333;
    text-align: center;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.nav-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    color: #667eea;
}

.nav-icon {
    font-size: 32px;
}

/* 错误消息样式 */
.error-message {
    background: #fee;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    padding: 10px;
    margin: 10px 0;
}

.error-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.error-content span:first-child {
    margin-right: 8px;
}

/* 加载指示器 */
.loading-indicator {
    text-align: center;
    padding: 20px;
}

.loading-spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

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

/* 订单状态标签 */
.order-status {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    background: #f8f9fa;
    color: #666;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header {
        padding: 10px 15px;
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .header h1 {
        font-size: 1.3rem;
    }
    
    .register-container {
        padding: 15px;
    }
    
    .shop-card {
        flex-direction: column;
        text-align: center;
        padding: 15px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .nav-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .nav-item {
        padding: 20px 15px;
    }
}

@media (max-width: 480px) {
    .nav-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        flex-direction: column;
    }
}