/* ===================================================
   业务复盘 · 管理决策系统 - 前端样式表
   =================================================== */

:root {
    --primary: #2d3436;
    --accent: #636e72;
    --bg: #f0f2f5;
    --border: #dfe6e9;
    --blue: #0984e3;
    --green: #2ecc71;
    --red: #d63031;
    --cause-bg: #fff5f5;
    --cause-border: #ff7675;
    --sol-bg: #f0f7ff;
    --sol-border: #74b9ff;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-font-smoothing: antialiased; }

body {
    background: var(--bg);
    color: var(--primary);
    font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Helvetica Neue', sans-serif;
    padding-bottom: 40px;
}

header {
    background: var(--primary);
    color: #fff;
    padding: 12px 16px;
    position: sticky;
    top: 0;
    z-index: 1100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: calc(12px + env(safe-area-inset-top));
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.header-title { font-size: 15px; font-weight: 600; }

#date-select {
    background: rgba(255,255,255,0.2);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.3);
    padding: 5px 8px;
    border-radius: 6px;
    font-size: 12px;
    outline: none;
    cursor: pointer;
    min-width: 150px;
}

#date-select option { background: #2d3436; color: #fff; }

.main-tabs {
    display: flex;
    background: #fff;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 48px;
    z-index: 1000;
}

.tab-item {
    flex: 1;
    text-align: center;
    padding: 16px 0;
    font-size: 14px;
    color: var(--accent);
    transition: 0.3s;
    cursor: pointer;
    user-select: none;
}

.tab-item.active { color: var(--blue); font-weight: 700; border-bottom: 3px solid var(--blue); }
.tab-item:hover:not(.active) { background: #f8f9fa; }

.content-section { display: none; padding: 12px; }
.content-section.active { display: block; }

.project-group {
    background: #fff;
    border-radius: 12px;
    margin-bottom: 12px;
    border: 1px solid var(--border);
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.project-header {
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.project-header:hover { background: #f8f9fa; }
.project-header h2 { font-size: 14px; font-weight: 700; }

.arrow { font-size: 10px; color: #b2bec3; transition: transform 0.3s; }

.project-content { display: none; padding: 10px; border-top: 1px solid var(--border); }
.project-group.open .project-content { display: block; }
.project-group.open .arrow { transform: rotate(180deg); }

.table-container {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 15px;
    -webkit-overflow-scrolling: touch;
    position: relative;
}

table {
    border-collapse: collapse;
    min-width: 100%;
    width: auto;
    table-layout: auto;
}

th, td {
    border: 1px solid var(--border);
    padding: 10px 6px;
    text-align: center;
    font-size: 12px;
    word-break: break-all;
    vertical-align: middle;
}

.row-dim {
    width: 75px !important;
    min-width: 75px;
    background: #fdfdfd !important;
    font-weight: 700;
    position: sticky;
    left: 0;
    z-index: 20;
    color: var(--accent);
    box-shadow: 2px 0 5px rgba(0,0,0,0.06);
    text-align: left;
    padding-left: 8px;
    font-size: 11px;
}

.sticky-header { position: sticky; top: 0; z-index: 30; background: #eceff1; }
.sticky-header .row-dim { z-index: 40; background: #eceff1 !important; }
.head-brand { background: #eceff1; font-weight: bold; font-size: 12px; }

.summary-col {
    background: #fcfcfc;
    color: var(--blue);
    font-weight: 700;
    min-width: 65px;
}

.status-tag {
    display: inline-block;
    font-size: 9px;
    padding: 1px 5px;
    border-radius: 4px;
    margin-left: 2px;
    vertical-align: middle;
    font-weight: 600;
    white-space: nowrap;
}

.tag-ok { background: #e8f5e9; color: #2e7d32; }
.tag-err { background: #ffebee; color: var(--red); }
.tag-warn { background: #fff3e0; color: #e65100; }

.analysis-box {
    padding: 12px 14px;
    border-radius: 8px;
    border-left: 4px solid #ddd;
    margin-top: 10px;
}

.box-cause { background: var(--cause-bg); border-left-color: var(--cause-border); }
.box-sol { background: var(--sol-bg); border-left-color: var(--sol-border); }

.box-title {
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    color: var(--primary);
}

.box-title span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    color: #fff;
    font-size: 10px;
    margin-right: 6px;
    flex-shrink: 0;
}

.title-cause span { background: var(--red); }
.title-sol span { background: var(--blue); }

.list-item {
    font-size: 12px;
    line-height: 1.7;
    color: #455a64;
    margin-bottom: 4px;
    padding-left: 15px;
    position: relative;
}

.list-item::before { content: "•"; position: absolute; left: 5px; color: #b2bec3; }

.list-item.empty-placeholder { color: #ccc; font-style: italic; }
.list-item.empty-placeholder::before { display: none; }

.empty-placeholder { color: #ccc; font-style: italic; font-size: 11px; }

.progress-bar {
    width: 100%;
    background: #eee;
    height: 6px;
    border-radius: 3px;
    margin-top: 4px;
    overflow: hidden;
}

.progress-fill { height: 100%; background: var(--green); transition: width 0.5s ease; }

.sub-title {
    font-size: 13px;
    font-weight: 700;
    padding: 12px 0 8px 5px;
    color: var(--accent);
    display: flex;
    align-items: center;
}

.sub-title::before {
    content: "";
    width: 3px;
    height: 13px;
    background: var(--blue);
    margin-right: 8px;
    border-radius: 2px;
    flex-shrink: 0;
}

@keyframes flash {
    0%, 100% { background-color: inherit; }
    50% { background-color: #e3f2fd; }
}

.data-updated { animation: flash 0.5s ease; }

@media (max-width: 480px) {
    .header-title { font-size: 13px; }
    #date-select { font-size: 11px; min-width: 120px; }
    .content-section { padding: 8px; }
    .project-header { padding: 12px; }
    .project-header h2 { font-size: 13px; }
    th, td { font-size: 11px; padding: 8px 4px; }
    .row-dim { width: 65px !important; min-width: 65px; font-size: 10px; }
}

@media (min-width: 768px) {
    .content-section { padding: 16px; }
    th, td { font-size: 13px; padding: 10px 8px; }
    .row-dim { width: 90px !important; min-width: 90px; font-size: 12px; }
}

@media (min-width: 1024px) {
    .content-section { max-width: 1200px; margin: 0 auto; }
}
