/* 作业终端核实程序 - 公共样式 */

/* CSS变量 - 根据设计规范 */
:root {
    /* 主色调 */
    --primary: #00706B;
    --primary-dark: #005A56;
    --primary-deeper: #004542;
    --primary-light: #00898D;
    --primary-lighter: #00A8AB;
    --primary-bg: #E6F2F2;
    --primary-bg-light: #F0F7F7;
    
    /* 辅助色 */
    --accent: #C9973E;
    --accent-light: #F5E6C8;
    --accent-dark: #A07828;
    
    /* 透明色变量 */
    --accent-transparent-5: rgba(201, 151, 62, 0.05);
    --accent-transparent-8: rgba(201, 151, 62, 0.08);
    --accent-transparent-15: rgba(201, 151, 62, 0.15);
    --accent-transparent-20: rgba(201, 151, 62, 0.2);
    --accent-transparent-30: rgba(201, 151, 62, 0.3);
    --accent-transparent-40: rgba(201, 151, 62, 0.4);
    --warning-transparent-5: rgba(255, 193, 7, 0.05);
    --warning-transparent-8: rgba(255, 160, 0, 0.08);
    --warning-transparent-20: rgba(255, 193, 7, 0.2);
    --info-transparent-3: rgba(0, 122, 255, 0.03);
    
    /* 功能色 */
    --success: #4CAF50;
    --success-bg: #E6F2EB;
    --danger: #F44336;
    --danger-bg: #F5E6E6;
    --warning: #FF9800;
    --warning-bg: #FDF3E2;
    --info: #2196F3;
    
    /* 中性色 */
    --bg: #F5F5F5;
    --surface: #FFFFFF;
    --surface-alt: #F7F8FA;
    --surface-hover: #EDF0F4;
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-muted: #999999;
    --border: #E0E0E0;
    --border-light: #F0F0F0;
    
    /* 阴影 */
    --shadow-sm: 0 1px 4px rgba(0,112,107,0.06);
    --shadow-md: 0 4px 16px rgba(0,112,107,0.08);
    --shadow-lg: 0 8px 32px rgba(0,112,107,0.12);
    
    /* 圆角 */
    --radius: 14px;
    --radius-sm: 10px;
    
    /* 高度常量 */
    --nav-h: 64px;
    --status-h: 44px;
    --header-height: var(--nav-h);
    --bottom-nav-height: var(--nav-h);
}

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

body {
    font-family: 'Noto Sans SC', system-ui, sans-serif;
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-primary);
    background: var(--bg);
    -webkit-tap-highlight-color: transparent;
    -webkit-overflow-scrolling: touch;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    font-family: inherit;
    cursor: pointer;
}

/* 应用容器 */
.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 顶部导航 */
.top-header {
    height: var(--header-height);
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    min-width: 40px;
}

.back-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    color: white;
    font-size: 18px;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.page-title {
    flex: 1;
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.header-right {
    display: flex;
    align-items: center;
    min-width: 40px;
}

.header-right .btn-primary {
    background: white;
    color: var(--primary);
}

.header-right .btn-primary:hover {
    background: rgba(255, 255, 255, 0.9);
    color: var(--primary-light);
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
}

.logo i {
    font-size: 20px;
}

.status-indicators {
    display: flex;
    gap: 12px;
}

.indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.indicator.connected {
    background: rgba(76, 175, 80, 0.3);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
}

.user-info:hover {
    background: rgba(255, 255, 255, 0.1);
}

.user-info i {
    font-size: 18px;
}

/* 主内容区 */
.main-content {
    flex: 1;
    padding: 4px;
    padding-bottom: calc(var(--bottom-nav-height) + 16px + env(safe-area-inset-bottom, 0px));
    overflow-y: auto;
}

/* 底部导航 */
.bottom-nav {
    height: var(--bottom-nav-height);
    background: var(--surface);
    border-top: 1px solid var(--border-light);
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: var(--text-muted);
    font-size: 12px;
    transition: all 0.2s;
    cursor: pointer;
}

.nav-item i {
    font-size: 20px;
}

.nav-item.active {
    color: var(--primary);
}

.nav-item:hover {
    background: var(--surface-hover);
}

/* 按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-light);
}

.btn-secondary {
    background: var(--surface-alt);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

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

.btn-success {
    background: var(--success);
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-block {
    width: 100%;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 卡片样式 */
.card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.card-header {
    padding: 16px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
}

.card-body {
    padding: 16px;
}

/* 表单样式 */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-label.required::after {
    content: '*';
    color: var(--error-color);
    margin-left: 4px;
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text-primary);
    background: var(--surface);
    transition: all 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 112, 107, 0.1);
}

.form-control::placeholder {
    color: var(--text-muted);
}

select.form-control {
    cursor: pointer;
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

/* 模态框 */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 16px;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--surface);
    border-radius: var(--radius);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 16px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 16px;
    font-weight: 600;
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.modal-close:hover {
    background: var(--bg-secondary);
}

.modal-body {
    padding: 16px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 16px;
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* Toast提示 */
.toast {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: var(--text-primary);
    color: white;
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    opacity: 0;
    transition: all 0.3s;
    z-index: 2000;
}

.toast.active {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast.success {
    background: var(--success);
}

.toast.error {
    background: var(--danger);
}

.toast.warning {
    background: var(--warning);
}

.toast.info {
    background: var(--info);
}

/* 进度条 */
.progress-bar {
    height: 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar .progress {
    height: 100%;
    background: var(--primary);
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 13px;
}

/* 工具函数 */
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-error { color: var(--danger); }
.text-muted { color: var(--text-muted); }

.text-center { text-align: center; }
.text-right { text-align: right; }

.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }

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