/* 中海·学仕里项目管理网页 - 样式文件 */
/* 深蓝/深灰主色 + 亮色点缀，移动端优先设计 */

:root {
    --primary-dark: #1a2744;
    --primary-blue: #2563eb;
    --primary-light: #3b82f6;
    --secondary-gray: #374151;
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --accent-orange: #f97316;
    --accent-green: #22c55e;
    --accent-red: #ef4444;
    --accent-yellow: #eab308;
    --border-color: #334155;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    padding-bottom: 70px;
}

.header {
    background: var(--primary-dark);
    padding: 15px 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.header h1 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.header-subtitle {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.tab-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--primary-dark);
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    border-top: 1px solid var(--border-color);
    z-index: 1000;
}

.tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 12px;
    color: var(--text-secondary);
    font-size: 11px;
    cursor: pointer;
    transition: color 0.2s;
}

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

.tab-item svg {
    width: 24px;
    height: 24px;
    margin-bottom: 4px;
}

.content {
    padding: 16px;
    max-width: 800px;
    margin: 0 auto;
}

.page { display: none; }
.page.active { display: block; }

.card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    border: 1px solid var(--border-color);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

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

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.stat-item {
    background: var(--bg-card);
    border-radius: 10px;
    padding: 14px;
    text-align: center;
    border: 1px solid var(--border-color);
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-light);
}

.stat-value.warning { color: var(--accent-orange); }
.stat-value.danger { color: var(--accent-red); }
.stat-value.success { color: var(--accent-green); }

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.filter-bar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.filter-btn {
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn.active {
    background: var(--primary-blue);
    color: white;
    border-color: var(--primary-blue);
}

.node-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.node-item {
    background: var(--bg-card);
    border-radius: 10px;
    padding: 14px;
    border-left: 4px solid var(--text-secondary);
    transition: all 0.2s;
}

.node-item.engineering { border-left-color: var(--primary-blue); }
.node-item.pending { opacity: 0.7; }
.node-item.in-progress { border-left-color: var(--primary-light); opacity: 1; }
.node-item.warning { border-left-color: var(--accent-orange); background: rgba(249, 115, 22, 0.1); }
.node-item.overdue { border-left-color: var(--accent-red); background: rgba(239, 68, 68, 0.1); }
.node-item.completed { border-left-color: var(--accent-green); opacity: 0.6; }

.node-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.node-name {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    flex: 1;
    margin-right: 10px;
}

.node-status {
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

.status-pending { background: rgba(148, 163, 184, 0.2); color: var(--text-secondary); }
.status-progress { background: rgba(59, 130, 246, 0.2); color: var(--primary-light); }
.status-warning { background: rgba(249, 115, 22, 0.2); color: var(--accent-orange); }
.status-overdue { background: rgba(239, 68, 68, 0.2); color: var(--accent-red); }
.status-completed { background: rgba(34, 197, 94, 0.2); color: var(--accent-green); }

.node-meta {
    display: flex;
    gap: 12px;
    font-size: 13px;
    color: var(--text-secondary);
}

.node-actions {
    margin-top: 10px;
    display: flex;
    gap: 8px;
}

.btn {
    padding: 8px 16px;
    border-radius: 8px;
    border: none;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary { background: var(--primary-blue); color: white; }
.btn-secondary { background: var(--secondary-gray); color: white; }
.btn-small { padding: 6px 12px; font-size: 12px; }

.form-group { margin-bottom: 16px; }

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

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-dark);
    color: var(--text-primary);
    font-size: 14px;
}

.form-textarea { min-height: 100px; resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.issue-list { display: flex; flex-direction: column; gap: 10px; }

.issue-item { display: flex; gap: 10px; align-items: flex-start; }
.issue-item input { flex: 1; }

.issue-number {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary-blue);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

.remove-issue {
    padding: 6px;
    background: transparent;
    border: none;
    color: var(--accent-red);
    cursor: pointer;
}

.iframe-container {
    background: var(--bg-card);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.iframe-tabs { display: flex; background: var(--primary-dark); }

.iframe-tab {
    flex: 1;
    padding: 12px;
    text-align: center;
    color: var(--text-secondary);
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 13px;
}

.iframe-tab.active {
    color: var(--primary-light);
    border-bottom: 2px solid var(--primary-light);
}

.iframe-wrapper {
    height: calc(100vh - 280px);
    min-height: 400px;
}

.iframe-wrapper iframe { width: 100%; height: 100%; border: none; }

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: var(--bg-card);
    border-radius: 10px;
    margin-bottom: 10px;
    border: 1px solid var(--border-color);
    cursor: pointer;
}

.setting-item-left { display: flex; align-items: center; gap: 12px; }

.setting-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--primary-blue);
    display: flex;
    align-items: center;
    justify-content: center;
}

.setting-title { font-size: 15px; color: var(--text-primary); }
.setting-desc { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }

.reminder-item {
    background: var(--bg-card);
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 10px;
    border-left: 4px solid var(--accent-orange);
}

.reminder-header { display: flex; justify-content: space-between; margin-bottom: 8px; }
.reminder-title { font-size: 15px; font-weight: 500; }
.reminder-time { font-size: 12px; color: var(--accent-orange); }
.reminder-desc { font-size: 13px; color: var(--text-secondary); }

.history-item {
    background: var(--bg-card);
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 10px;
    border: 1px solid var(--border-color);
}

.history-header { display: flex; justify-content: space-between; margin-bottom: 6px; }
.history-title { font-size: 14px; font-weight: 500; }
.history-date { font-size: 12px; color: var(--text-secondary); }
.history-preview {
    font-size: 13px;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.toast {
    position: fixed;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-blue);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 2000;
    animation: toastIn 0.3s ease;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(-50%) translateY(20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.amount-display {
    background: var(--bg-dark);
    padding: 12px;
    border-radius: 8px;
    margin-top: 8px;
}

.amount-uppercase {
    color: var(--accent-orange);
    font-size: 18px;
    font-weight: 600;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
}

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

.modal-content {
    background: var(--bg-card);
    border-radius: 12px;
    width: 100%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
}

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

.modal-body { padding: 16px; }
.modal-footer {
    padding: 16px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 10px;
}

.custom-reminder {
    background: var(--bg-card);
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 10px;
    border: 1px solid var(--border-color);
}

.custom-reminder input {
    width: 100%;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--bg-dark);
    color: var(--text-primary);
    font-size: 14px;
    margin-bottom: 8px;
}

.custom-reminder-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }

.custom-reminder-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: var(--bg-dark);
    border-radius: 6px;
}

.custom-reminder-text { flex: 1; font-size: 14px; }

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .form-row { grid-template-columns: 1fr; }
    .header h1 { font-size: 16px; }
}

/* 子tab切换 - 单据生成页 */
.sub-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 12px;
    background: var(--card-bg);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}
.sub-tab {
    flex: 1;
    padding: 10px 0;
    text-align: center;
    font-size: 14px;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}
.sub-tab.active {
    background: var(--primary);
    color: #fff;
    font-weight: 500;
}
.doc-form {
    display: none;
}
.doc-form.active {
    display: block;
}