/* 通用样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #ff6b6b;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #17a2b8;
    --text-primary: #333;
    --text-secondary: #666;
    --text-tertiary: #999;
    --border-color: #e0e0e0;
    --bg-gray: #f5f5f5;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 6px 20px rgba(0, 0, 0, 0.15);
}

html, body {
    width: 100%;
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg-gray);
    overflow-x: hidden;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

#app {
    width: 100%;
    min-height: 100vh;
    padding-top: 50px;
    padding-bottom: 60px;
    background: var(--bg-gray);
}

/* 顶部导航栏 */
.top-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 50px;
    background: white;
    box-shadow: var(--shadow-sm);
    z-index: 1000;
}

.navbar-content {
    height: 100%;
    padding: 0 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.navbar-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.navbar-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.navbar-right {
    display: flex;
    align-items: center;
}

.shop-name {
    font-size: 14px;
    color: var(--text-secondary);
}

/* 营业状态 */
.business-status {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #d4edda;
    border-radius: 20px;
}

.business-status.closed {
    background: #f8d7da;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #28a745;
    animation: pulse 2s infinite;
}

.business-status.closed .status-dot {
    background: #dc3545;
}

.status-text {
    font-size: 13px;
    font-weight: 500;
    color: #155724;
}

.business-status.closed .status-text {
    color: #721c24;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.order-count {
    display: flex;
    align-items: center;
    gap: 4px;
}

.count-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.count-number {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary-color);
}

/* 主内容区域 */
.main-content {
    min-height: calc(100vh - 110px);
    padding: 10px;
}

.content-section {
    display: none;
}

.content-section.active {
    display: block;
}

/* 底部导航栏 */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: white;
    display: flex;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.nav-item:active {
    background: rgba(0, 0, 0, 0.05);
}

.nav-icon {
    font-size: 24px;
    margin-bottom: 4px;
    opacity: 0.6;
    transition: all 0.3s ease;
}

.nav-text {
    font-size: 12px;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.nav-item.active .nav-icon {
    opacity: 1;
    transform: scale(1.1);
}

.nav-item.active .nav-text {
    color: var(--primary-color);
    font-weight: 600;
}

/* 加载提示 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    color: white;
    font-size: 14px;
}

/* Toast 提示 */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    font-size: 14px;
    text-align: center;
    z-index: 10000;
    transition: all 0.3s ease;
    min-width: 120px;
    max-width: 70%;
}

.toast.show {
    transform: translate(-50%, -50%) scale(1);
}

/* 通用按钮 */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
}

.btn:active {
    transform: scale(0.95);
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: #ff5252;
}

.btn-secondary {
    background: var(--bg-gray);
    color: var(--text-primary);
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-warning {
    background: var(--warning-color);
    color: #212529;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 通用卡片 */
.card {
    background: white;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: var(--shadow-sm);
}

/* 通用表单 */
.form-item {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.form-label .required {
    color: var(--danger-color);
    margin-left: 2px;
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-primary);
    outline: none;
    transition: all 0.3s ease;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.1);
}

.form-textarea {
    min-height: 80px;
    resize: vertical;
}

.form-hint {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: 6px;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-icon {
    font-size: 60px;
    margin-bottom: 15px;
    opacity: 0.6;
}

.empty-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.empty-desc {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* 响应式 */
@media (min-width: 768px) {
    #app {
        max-width: 768px;
        margin: 0 auto;
        box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    }
    
    .top-navbar,
    .bottom-nav {
        max-width: 768px;
        left: 50%;
        transform: translateX(-50%);
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #999;
}

