* { box-sizing: border-box; margin: 0; padding: 0; font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif; }
body { background: #f2f5f9; padding: 16px; min-height: 100vh; display: flex; flex-direction: column; align-items: center; }
.app { max-width: 720px; width: 100%; background: #fff; border-radius: 28px; box-shadow: 0 12px 30px rgba(0,0,0,0.08); overflow: hidden; padding: 20px 18px 28px; margin-bottom: 20px; }
h1 { font-size: 1.45rem; font-weight: 600; color: #0b2b4a; margin: 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.user-tag { font-size: 0.78rem; font-weight: 500; color: #5e7a9a; background: #eef4fa; padding: 4px 12px; border-radius: 20px; letter-spacing: 0.3px; }
.user-tag.owner { background: #fff3d6; color: #8a6d1a; }
.header-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; gap: 8px; flex-wrap: wrap; }
.header-left { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.subpage-header { display:flex; align-items:center; gap:10px; margin-bottom:22px; min-height:40px; }
.subpage-back { width:36px; height:36px; border:none; border-radius:18px; background:#eef4fa; color:#1f3a57; font-size:1.05rem; font-weight:800; cursor:pointer; touch-action:manipulation; flex-shrink:0; display:inline-flex; align-items:center; justify-content:center; padding:0; line-height:1; }
.subpage-back:active { background:#d9e8f5; }
.subpage-title { flex:1; font-size:1rem; font-weight:800; color:#0b2b4a; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.subpage-refresh { width:36px; height:36px; border:none; border-radius:18px; background:#eef4fa; color:#1f3a57; font-size:1rem; font-weight:800; cursor:pointer; touch-action:manipulation; flex-shrink:0; display:none; align-items:center; justify-content:center; padding:0; line-height:1; }
.subpage-refresh:active { background:#d9e8f5; }
.tab-bar { display: flex; gap: 6px; background: #e9eef4; padding: 6px; border-radius: 40px; margin-bottom: 22px; overflow-x: auto; scrollbar-width: none; }
.tab-bar::-webkit-scrollbar { display: none; }
.tab-btn { flex: 1; text-align: center; padding: 11px 8px; border-radius: 32px; font-weight: 600; font-size: 0.92rem; border: none; background: transparent; color: #3e526b; transition: 0.15s; cursor: pointer; touch-action: manipulation; white-space: nowrap; min-width: 72px; position: relative; }
.tab-btn.active { background: #fff; color: #0b2b4a; box-shadow: 0 3px 8px rgba(0,0,0,0.05); }
.page { display: none; }
.page.active { display: block; }
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 0.9rem; font-weight: 600; color: #1f3a57; margin-bottom: 6px; letter-spacing: 0.3px; }
.field input, .field .custom-select-trigger, .field .native-select { width: 100%; padding: 14px 16px; font-size: 1rem; border: 1.5px solid #d0dae8; border-radius: 16px; background: #fff; outline: none; transition: 0.15s; color: #0a1e2f; font-weight: 500; touch-action: manipulation; }
.field input:focus, .field .native-select:focus { border-color: #1e6f9f; box-shadow: 0 0 0 3px rgba(30,111,159,0.12); }
.native-select { -webkit-appearance: none; appearance: none; background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235e7a9a' stroke-width='2'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e"); background-repeat: no-repeat; background-position: right 14px center; background-size: 18px; padding-right: 40px; cursor: pointer; }
.custom-select { position: relative; user-select: none; }
.custom-select-trigger { display: flex; justify-content: space-between; align-items: center; cursor: pointer; background: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.custom-select-trigger::after { content: "▼"; font-size: 0.7rem; color: #5e7a9a; margin-left: 8px; flex-shrink: 0; }
.custom-select-trigger.active::after { content: "▲"; }
.custom-options { position: absolute; top: calc(100% + 4px); left: 0; right: 0; background: #fff; border-radius: 20px; box-shadow: 0 12px 28px rgba(0,0,0,0.15); border: 1px solid #d9e2ee; z-index: 100; max-height: 260px; overflow-y: auto; padding: 6px 0; display: none; margin-top: 4px; }
.custom-options.show { display: block; }
.custom-search { padding: 10px 14px 6px; position: sticky; top: 0; background: #fff; z-index: 2; }
.custom-search input { width: 100%; padding: 10px 14px; border: 1px solid #cad5e3; border-radius: 40px; font-size: 0.95rem; outline: none; background: #f7faff; }
.custom-search input:focus { border-color: #1e6f9f; background: #fff; }
.option-item { padding: 12px 18px; font-size: 0.98rem; color: #1f344b; cursor: pointer; transition: 0.1s; border-bottom: 1px solid #f0f4fa; touch-action: manipulation; font-weight: 500; }
.option-item:last-child { border-bottom: none; }
.option-item:active, .option-item:hover { background: #e3eefc; }
.option-item .opt-hint { font-size: 0.76rem; color: #9aabbf; font-weight: 400; margin-left: 8px; }
.combo { position: relative; }
.combo-input-wrap { display: flex; align-items: stretch; border: 1.5px solid #d0dae8; border-radius: 16px; background: #fff; overflow: hidden; transition: 0.15s; }
.combo-input-wrap.focused { border-color: #1e6f9f; box-shadow: 0 0 0 3px rgba(30,111,159,0.12); }
.combo-input-wrap input { flex: 1; border: none; outline: none; padding: 14px 16px; font-size: 1rem; font-weight: 500; color: #0a1e2f; background: transparent; min-width: 0; }
.combo-toggle { border: none; border-left: 1px solid #e2ecf6; background: #f7faff; padding: 0 14px; color: #5e7a9a; font-size: 0.72rem; cursor: pointer; touch-action: manipulation; flex-shrink: 0; display: flex; align-items: center; gap: 4px; font-weight: 600; }
.combo-toggle:active { background: #e3eefc; }
.combo-options { position: absolute; top: calc(100% + 4px); left: 0; right: 0; background: #fff; border-radius: 18px; box-shadow: 0 12px 28px rgba(0,0,0,0.15); border: 1px solid #d9e2ee; z-index: 100; max-height: 250px; overflow-y: auto; padding: 6px 0; display: none; }
.combo-options.show { display: block; }
.combo-empty { padding: 14px 18px; font-size: 0.88rem; color: #9aabbf; text-align: center; }
.row-2col { display: flex; gap: 10px; }
.row-2col .field { flex: 1; margin-bottom: 0; }
.switch-mode { display: flex; gap: 6px; margin-bottom: 12px; background: #e9eef4; border-radius: 30px; padding: 4px; }
.switch-mode button { flex: 1; border: none; background: transparent; padding: 10px 4px; border-radius: 26px; font-weight: 600; font-size: 0.85rem; color: #3e526b; cursor: pointer; transition: 0.1s; touch-action: manipulation; white-space: nowrap; }
.switch-mode button.active { background: #fff; color: #0b2b4a; box-shadow: 0 2px 6px rgba(0,0,0,0.05); }
.btn-primary { width: 100%; background: #1e6f9f; color: #fff; font-weight: 700; font-size: 1.1rem; padding: 18px 16px; border: none; border-radius: 40px; margin-top: 12px; cursor: pointer; transition: 0.15s; touch-action: manipulation; box-shadow: 0 6px 16px rgba(30,111,159,0.25); letter-spacing: 0.5px; }
.btn-primary:active { background: #155a82; transform: scale(0.98); }
.btn-primary:disabled { background: #b0c6d9; box-shadow: none; cursor: not-allowed; }
.btn-add { width: 100%; background: #e8f1fb; color: #1e6f9f; font-weight: 700; font-size: 1rem; padding: 14px 16px; border: 1.5px dashed #7fb0d6; border-radius: 40px; margin-top: 6px; cursor: pointer; transition: 0.15s; touch-action: manipulation; }
.btn-add:active { background: #d4e6f7; }
.btn-secondary { background: #e4eaf2; color: #1f3a57; border: none; border-radius: 30px; padding: 10px 14px; font-weight: 600; font-size: 0.85rem; cursor: pointer; touch-action: manipulation; }
.btn-secondary:active { background: #d4dde9; }
.btn-secondary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-mini { background: #e4eaf2; border: none; border-radius: 20px; padding: 6px 12px; font-size: 0.78rem; font-weight: 600; cursor: pointer; color: #1f3a57; touch-action: manipulation; white-space: nowrap; }
.btn-mini.approve { background: #d4f2e0; color: #1a7a4a; }
.btn-mini.reject { background: #fbe9e9; color: #c94a4a; }
.btn-mini.warn { background: #fff3d6; color: #8a6d1a; }
.btn-mini:active { transform: scale(0.97); }
.form-card { background: #fbfdff; border: 1px solid #e2ecf6; border-radius: 22px; padding: 16px 14px 10px; margin-bottom: 18px; }
.form-card-title { font-size: 0.85rem; font-weight: 700; color: #1e6f9f; margin-bottom: 14px; display: flex; align-items: center; gap: 6px; letter-spacing: 0.5px; }
.form-card-title::before { content: ""; width: 4px; height: 14px; background: #1e6f9f; border-radius: 2px; }
.pending-section { background: #fffdf5; border: 1px solid #f0e2b8; border-radius: 22px; padding: 14px 14px 16px; margin-bottom: 14px; }
.pending-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.pending-title { font-size: 0.9rem; font-weight: 700; color: #8a6d1a; display: flex; align-items: center; gap: 6px; }
.pending-badge { background: #f5d878; color: #6b5210; border-radius: 20px; padding: 2px 10px; font-size: 0.75rem; font-weight: 700; }
.pending-item { display: flex; align-items: center; gap: 10px; background: #fff; border-radius: 14px; padding: 10px 12px; margin-bottom: 8px; border: 1px solid #f0e8ce; }
.pending-item-info { flex: 1; min-width: 0; }
.pending-item-main { font-size: 0.92rem; font-weight: 700; color: #0b2b4a; }
.pending-item-sub { font-size: 0.8rem; color: #7b8fa3; margin-top: 2px; }
.pending-remove { flex-shrink: 0; background: #fbe9e9; color: #c94a4a; border: none; border-radius: 50%; width: 28px; height: 28px; font-size: 0.8rem; font-weight: 700; cursor: pointer; touch-action: manipulation; }
.pending-remove:active { background: #f5c6c6; }
.draft-banner { background: #fff8e3; border: 1px solid #f0e2b8; border-radius: 14px; padding: 10px 14px; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.draft-banner-text { flex: 1; min-width: 160px; font-size: 0.85rem; color: #8a6d1a; font-weight: 600; }
.draft-banner button { background: #1e6f9f; color: #fff; border: none; border-radius: 20px; padding: 6px 14px; font-size: 0.78rem; font-weight: 700; cursor: pointer; touch-action: manipulation; white-space: nowrap; }
.draft-banner .draft-discard { background: #fff; color: #c94a4a; border: 1px solid #f1d2d2; }
.stats-bar { display: flex; justify-content: space-around; align-items: center; background: linear-gradient(135deg, #eef6ff, #e0eeff); padding: 12px 6px; border-radius: 18px; margin-bottom: 14px; font-size: 0.86rem; color: #0b2b4a; font-weight: 600; gap: 4px; flex-wrap: wrap; }
.stats-bar .stat-item { text-align: center; flex: 1; min-width: 60px; }
.stats-bar .stat-item small { display: block; color: #5e7a9a; font-size: 0.68rem; font-weight: 500; margin-bottom: 2px; }
.stats-bar .stat-item .stat-cs { color: #1e6f9f; }
.stats-bar .stat-item .stat-ss { color: #8a6d1a; }
.filter-bar { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.search-input-wrap { position: relative; }
.search-input-wrap input { width: 100%; padding: 12px 16px 12px 40px; border: 1.5px solid #d0dae8; border-radius: 40px; font-size: 0.95rem; outline: none; background: #fff; transition: 0.15s; }
.search-input-wrap input:focus { border-color: #1e6f9f; box-shadow: 0 0 0 3px rgba(30,111,159,0.12); }
.search-input-wrap .search-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: #8fa5bd; font-size: 1rem; pointer-events: none; }
.filter-row { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-row select { flex: 1; min-width: 100px; padding: 10px 12px; border: 1.5px solid #d0dae8; border-radius: 14px; font-size: 0.88rem; background: #fff; color: #0b2b4a; font-weight: 500; outline: none; cursor: pointer; -webkit-appearance: none; appearance: none; background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235e7a9a' stroke-width='2'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e"); background-repeat: no-repeat; background-position: right 8px center; background-size: 16px; padding-right: 30px; }
.filter-row select:focus { border-color: #1e6f9f; }
.toolbar-row { display: flex; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.toolbar-row .btn-secondary { font-size: 0.82rem; padding: 8px 12px; flex: 1; min-width: 0; white-space: nowrap; }
.cat-block { margin-bottom: 16px; }
.cat-header { display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: linear-gradient(135deg, #dbe9f7, #cfe0f2); border-radius: 18px; cursor: pointer; user-select: none; transition: 0.15s; touch-action: manipulation; flex-wrap: wrap; }
.cat-header:active { background: #c7daef; }
.cat-arrow { font-size: 0.75rem; color: #1e6f9f; transition: transform 0.2s; flex-shrink: 0; }
.cat-arrow.collapsed { transform: rotate(-90deg); }
.cat-name { font-size: 1rem; font-weight: 800; color: #0b2b4a; letter-spacing: 0.3px; flex: 1; min-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-meta { font-size: 0.72rem; font-weight: 700; color: #1e6f9f; background: #fff; padding: 3px 10px; border-radius: 20px; border: 1px solid #cfe2f3; flex-shrink: 0; display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.weight-cs { color: #1e6f9f; font-weight: 700; }
.weight-ss { color: #8a6d1a; font-weight: 700; }
.cat-body { margin-top: 8px; padding-left: 4px; }
.cat-body.collapsed { display: none; }
.loc-block { background: #f9fcff; border: 1px solid #dbe6f2; border-radius: 16px; margin-bottom: 8px; overflow: hidden; }
.loc-header { display: flex; align-items: center; gap: 8px; padding: 10px 12px; cursor: pointer; user-select: none; transition: 0.15s; touch-action: manipulation; flex-wrap: wrap; }
.loc-header:active { background: #eef4fa; }
.loc-arrow { font-size: 0.7rem; color: #7b8fa3; transition: transform 0.2s; flex-shrink: 0; }
.loc-arrow.collapsed { transform: rotate(-90deg); }
.loc-name { font-size: 0.9rem; font-weight: 700; color: #1f3a57; flex: 1; min-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.loc-count { font-size: 0.7rem; font-weight: 700; color: #5e7a9a; background: #e9eef4; padding: 2px 8px; border-radius: 20px; flex-shrink: 0; display: flex; gap: 5px; align-items: baseline; flex-wrap: wrap; }
.loc-body { padding: 0 10px 8px; }
.loc-body.collapsed { display: none; }
.entry { padding: 9px 60px 9px 4px; border-top: 1px dashed #e2ecf6; position: relative; }
.entry:first-child { border-top: none; }
.entry-top { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; }
.entry-top-right { margin-left: auto; display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: baseline; justify-content: flex-end; }
.entry-mat { font-size: 0.94rem; font-weight: 700; color: #0b2b4a; }
.entry-spec { font-size: 0.82rem; color: #5e7a9a; font-weight: 600; background: #eef4fa; padding: 1px 8px; border-radius: 12px; word-break: break-all; }
.entry-weight { font-size: 0.78rem; color: #1a7a4a; background: #e8f8ef; padding: 1px 8px; border-radius: 12px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.entry-reporter { font-size: 0.78rem; color: #8a6d1a; font-weight: 700; background: #fff8e3; padding: 1px 8px; border-radius: 12px; white-space: nowrap; }
.entry-bottom { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: baseline; margin-top: 5px; }
.entry-qty { font-size: 0.92rem; font-weight: 700; color: #1e6f9f; text-align: left; }
.entry-weight-mini { font-size: 0.82rem; color: #1a7a4a; font-weight: 700; background: #e8f8ef; padding: 1px 8px; border-radius: 12px; text-align: right; min-width: 100px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.entry-weight-mini.placeholder { background: transparent; color: transparent; }
.entry-time { font-size: 0.74rem; color: #9aabbf; font-weight: 500; text-align: right; min-width: 106px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.entry-del, .entry-edit { position: absolute; top: 6px; background: transparent; border: none; font-size: 0.85rem; cursor: pointer; padding: 4px 8px; border-radius: 10px; touch-action: manipulation; color: #c9d4e0; }
.entry-del { right: 2px; }
.entry-edit { right: 28px; }
.entry-del:active { background: #fbe9e9; color: #c94a4a; }
.entry-edit:active { background: #e8f1fb; color: #1e6f9f; }
.empty-msg { text-align: center; color: #7b8fa3; padding: 40px 10px; background: #f7faff; border-radius: 22px; font-size: 0.95rem; line-height: 1.6; }
.empty-msg .big { font-size: 1.6rem; display: block; margin-bottom: 8px; }
.load-more-wrap { text-align: center; padding: 14px 0 4px; }
.load-more-btn { background: #fff; border: 1.5px solid #cfe2f3; border-radius: 30px; padding: 10px 24px; color: #1e6f9f; font-weight: 600; font-size: 0.88rem; cursor: pointer; touch-action: manipulation; }
.load-more-btn:active { background: #e8f1fb; }
.load-more-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.toast { position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%); background: #1e6f9f; color: #fff; padding: 12px 24px; border-radius: 40px; font-weight: 600; font-size: 0.95rem; box-shadow: 0 6px 20px rgba(0,0,0,0.2); opacity: 0; transition: 0.2s; pointer-events: none; z-index: 3600; white-space: nowrap; max-width: 90vw; overflow: hidden; text-overflow: ellipsis; }
.toast.show { opacity: 1; bottom: 40px; }
.mt-2 { margin-top: 8px; }
.auth-card { max-width: 420px; width: 100%; background: #fff; border-radius: 28px; box-shadow: 0 12px 30px rgba(0,0,0,0.08); padding: 26px 22px; }
.auth-card h2 { color: #0b2b4a; font-size: 1.3rem; margin-bottom: 18px; text-align: center; }
.auth-logo { text-align: center; font-size: 1.8rem; margin-bottom: 4px; }
.auth-title { text-align: center; font-size: 1.1rem; color: #1e6f9f; font-weight: 700; margin-bottom: 24px; letter-spacing: 1px; }
.auth-mode { display: none; }
.auth-mode.active { display: block; }
.auth-switch { text-align: center; margin-top: 18px; font-size: 0.9rem; color: #5e7a9a; }
.auth-switch a { color: #1e6f9f; cursor: pointer; font-weight: 600; text-decoration: none; margin-left: 4px; }
.auth-info-box { background: #eef6ff; border: 1px solid #cfe2f3; border-radius: 14px; padding: 12px 14px; margin-bottom: 18px; font-size: 0.85rem; color: #1f3a57; line-height: 1.6; }
.auth-info-box strong { color: #1e6f9f; }
.member-block { background: #f9fcff; border: 1px solid #dbe6f2; border-radius: 18px; padding: 14px; margin-bottom: 12px; }
.member-block-title { font-size: 0.9rem; font-weight: 800; color: #0b2b4a; margin-bottom: 10px; display: flex; align-items: center; justify-content: space-between; }
.member-block-title .badge { background: #f5d878; color: #6b5210; border-radius: 20px; padding: 2px 10px; font-size: 0.72rem; font-weight: 700; }
.member-item { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px dashed #e2ecf6; }
.member-item:first-child { border-top: none; padding-top: 0; }
.member-info { flex: 1; min-width: 0; }
.member-name { font-size: 0.94rem; font-weight: 700; color: #0b2b4a; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.member-name .role-tag { font-size: 0.68rem; background: #fff3d6; color: #8a6d1a; padding: 1px 8px; border-radius: 10px; font-weight: 700; }
.member-sub { font-size: 0.76rem; color: #7b8fa3; margin-top: 2px; }
.member-actions { display: flex; gap: 6px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }
.invite-box { background: linear-gradient(135deg, #fff8e3, #fef3d6); border: 1px solid #f0e2b8; border-radius: 18px; padding: 14px; margin-bottom: 12px; }
.invite-box-title { font-size: 0.85rem; font-weight: 800; color: #8a6d1a; margin-bottom: 10px; }
.invite-row { display: flex; gap: 6px; align-items: center; margin-bottom: 8px; }
.invite-row label { font-size: 0.78rem; font-weight: 600; color: #8a6d1a; width: 60px; flex-shrink: 0; }
.invite-row input, .invite-row .invite-value { flex: 1; padding: 8px 12px; border: 1px solid #e2c976; border-radius: 10px; font-size: 0.85rem; background: #fff; color: #1f3a57; min-width: 0; }
.invite-row .invite-value { font-family: ui-monospace, 'Courier New', monospace; font-weight: 700; letter-spacing: 0.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.invite-row button { background: #1e6f9f; color: #fff; border: none; border-radius: 10px; padding: 8px 14px; font-size: 0.8rem; font-weight: 700; cursor: pointer; touch-action: manipulation; flex-shrink: 0; }
.invite-row button:active { background: #155a82; }
.settings-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.settings-row label { font-size: 0.9rem; color: #1f3a57; font-weight: 600; flex: 1; }
.switch-toggle { position: relative; width: 46px; height: 26px; background: #d0dae8; border-radius: 14px; cursor: pointer; transition: 0.2s; flex-shrink: 0; }
.switch-toggle.on { background: #1e6f9f; }
.switch-toggle::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; background: #fff; border-radius: 50%; transition: 0.2s; box-shadow: 0 1px 3px rgba(0,0,0,0.2); }
.switch-toggle.on::after { left: 23px; }
.modal-mask { position: fixed; inset: 0; background: rgba(10,30,50,0.5); display: flex; align-items: center; justify-content: center; z-index: 3000; padding: 16px; pointer-events:auto; }
.modal-panel { background: #fff; border-radius: 24px; width: 100%; max-width: 440px; max-height: 90vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,0.3); }
.modal-header { padding: 18px 20px 12px; font-weight: 700; color: #0b2b4a; font-size: 1.05rem; border-bottom: 1px solid #e2ecf6; display: flex; justify-content: space-between; align-items: center; }
.modal-close { background: transparent; border: none; color: #8fa5bd; font-size: 1.2rem; cursor: pointer; padding: 4px 10px; border-radius: 8px; }
.modal-body { padding: 16px 20px; }
.modal-actions { padding: 8px 20px 20px; display: flex; gap: 10px; }
.modal-actions .btn-secondary, .modal-actions .btn-primary { flex: 1; margin: 0; padding: 14px; font-size: 1rem; }
.edit-meta { background: #f7faff; border-radius: 14px; padding: 12px 14px; font-size: 0.88rem; color: #3e5f7e; line-height: 1.7; border: 1px dashed #d0dae8; margin-top: 6px; }
.edit-hint { font-size: 0.76rem; color: #9aabbf; margin-top: 8px; padding-top: 8px; border-top: 1px dashed #d0dae8; }
.undo-toast { position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%); background: #2c3e50; color: #fff; padding: 10px 10px 10px 20px; border-radius: 40px; font-weight: 500; font-size: 0.92rem; box-shadow: 0 6px 20px rgba(0,0,0,0.25); z-index: 3001; display: flex; align-items: center; gap: 12px; white-space: nowrap; max-width: 90vw; }
.undo-toast button { background: #4a90c4; color: #fff; border: none; border-radius: 20px; padding: 6px 16px; font-weight: 700; font-size: 0.85rem; cursor: pointer; touch-action: manipulation; }
.pending-screen { text-align: center; padding: 60px 20px; }
.pending-screen .icon { font-size: 3rem; margin-bottom: 16px; }
.pending-screen h2 { color: #0b2b4a; font-size: 1.2rem; margin-bottom: 10px; }
.pending-screen p { color: #5e7a9a; font-size: 0.92rem; line-height: 1.7; margin-bottom: 24px; }
.loading-overlay { position: fixed; inset: 0; background: rgba(255,255,255,0.7); display: flex; align-items: center; justify-content: center; z-index: 2000; color: #1e6f9f; font-weight: 700; font-size: 1rem; }
.gear-btn { background:#eef4fa; border:none; border-radius:20px; width:36px; height:36px; font-size:1.05rem; cursor:pointer; touch-action:manipulation; position: relative; flex-shrink: 0; }
.gear-btn:active { background:#d4e6f7; }
.gear-btn.has-unread::after { content: attr(data-unread); position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; background: #d94a4a; color: #fff; font-size: 0.65rem; font-weight: 700; line-height: 18px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; border: 2px solid #fff; box-sizing: content-box; }
.settings-menu { display:flex; flex-direction:column; gap:8px; padding:16px 20px 20px; }
.settings-item { width:100%; background:#f7faff; border:1px solid #dbe6f2; border-radius:15px; padding:13px 14px; text-align:left; font-size:.92rem; color:#1f3a57; font-weight:700; cursor:pointer; touch-action:manipulation; display:flex; align-items:center; gap:10px; }
.settings-item:active { background:#e8f1fb; }
.settings-item.danger { color:#c94a4a; background:#fff8f8; border-color:#f1d2d2; }
.settings-item > .arrow { margin-left: auto; color: #b0c6d9; font-weight: 400; }
.settings-badge { background: #d94a4a; color: #fff; font-size: 0.68rem; font-weight: 700; padding: 1px 8px; min-width: 18px; border-radius: 10px; text-align: center; display: none; line-height: 16px; }
.team-card { background:#f9fcff; border:1px solid #dbe6f2; border-radius:18px; padding:13px 14px; margin-bottom:10px; display:flex; align-items:center; gap:12px; }
.team-card.current { border-color:#9cc5e6; box-shadow:0 0 0 2px rgba(30,111,159,.08); background:#f5faff; }
.team-card-info { flex:1; min-width:0; }
.team-card-name { font-size:.95rem; font-weight:800; color:#0b2b4a; display:flex; align-items:center; gap:6px; flex-wrap:wrap; }
.team-card-sub { font-size:.76rem; color:#7b8fa3; margin-top:4px; }
.team-status { font-size:.7rem; font-weight:700; border-radius:12px; padding:2px 8px; }
.team-status.ok { background:#d4f2e0; color:#1a7a4a; }
.team-status.pending { background:#fff3d6; color:#8a6d1a; }
.team-status.bad { background:#fbe9e9; color:#c94a4a; }
.team-enter { background:#1e6f9f; color:#fff; border:none; border-radius:18px; padding:7px 12px; font-size:.76rem; font-weight:700; cursor:pointer; white-space:nowrap; }
.team-enter:disabled { background:#cbd7e3; cursor:not-allowed; }
.section-title { font-size:.9rem; font-weight:800; color:#0b2b4a; margin:18px 0 10px; }
.material-group { background:#f9fcff; border:1px solid #dbe6f2; border-radius:18px; padding:10px 12px; margin-bottom:10px; }
.material-group-head { display:flex; align-items:center; gap:8px; cursor:pointer; user-select:none; touch-action:manipulation; padding:4px 2px; }
.material-group-head:active { background: #eef4fa; border-radius: 10px; }
.material-group-arrow { font-size:.75rem; color:#1e6f9f; transition: transform .2s; flex-shrink:0; }
.material-group-arrow.collapsed { transform: rotate(-90deg); }
.material-group-name { flex:1; font-size:.94rem; font-weight:800; color:#0b2b4a; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.material-unit { font-size:.7rem; color:#5e7a9a; background:#eef4fa; padding:2px 8px; border-radius:12px; flex-shrink:0; }
.material-source { font-size:.68rem; padding:2px 7px; border-radius:12px; background:#eef6ff; color:#1e6f9f; flex-shrink:0; }
.material-spec-count { font-size:.68rem; color:#7b8fa3; background:#f0f4fa; padding:2px 8px; border-radius:12px; flex-shrink:0; font-weight:600; }
.material-group-body { margin-top:8px; }
.material-group-body.collapsed { display:none; }
.spec-list { display:flex; flex-direction:column; background:#fff; border:1px solid #e2ecf6; border-radius:14px; overflow:hidden; }
.spec-list-row { display:flex; justify-content:space-between; align-items:center; gap:10px; padding:8px 12px; font-size:.85rem; border-bottom:1px solid #f0f4fa; }
.spec-list-row:last-child { border-bottom:none; }
.spec-list-name { color:#1f3a57; font-weight:600; flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.spec-list-weight { color:#1a7a4a; font-weight:600; font-variant-numeric: tabular-nums; font-size:.82rem; white-space:nowrap; flex-shrink:0; text-align:right; }
.spec-list-weight.empty { color:#c9d4e0; font-weight:400; }
.spec-list-empty { padding:14px; text-align:center; color:#9aabbf; font-size:.82rem; }
.material-actions { display:flex; gap:6px; margin-top:9px; flex-wrap:wrap; }
.field-tip { font-size: 0.74rem; color: #9aabbf; font-weight: 500; margin-left: 6px; letter-spacing: 0; }
.spec-row { display: flex; gap: 6px; margin-bottom: 6px; align-items: stretch; }
.spec-row input { padding: 10px 12px; font-size: 0.9rem; border: 1.5px solid #d0dae8; border-radius: 12px; background: #fff; outline: none; min-width: 0; width: auto; }
.spec-row input:focus { border-color: #1e6f9f; box-shadow: 0 0 0 3px rgba(30,111,159,0.12); }
.spec-row .spec-spec-input { flex: 2; }
.spec-row .spec-weight-input { flex: 1.2; text-align: right; font-variant-numeric: tabular-nums; }
.spec-row .spec-remove-btn { background: #fbe9e9; color: #c94a4a; border: none; border-radius: 12px; padding: 0 12px; cursor: pointer; font-weight: 700; touch-action: manipulation; flex-shrink: 0; }
.spec-row .spec-remove-btn:active { background: #f5c6c6; }
.manage-spec-row { display: flex; gap: 6px; margin-bottom: 6px; align-items: stretch; }
.manage-spec-row input { padding: 9px 12px; font-size: 0.9rem; border: 1.5px solid #d0dae8; border-radius: 12px; background: #fff; outline: none; min-width: 0; }
.manage-spec-row input:focus { border-color: #1e6f9f; box-shadow: 0 0 0 3px rgba(30,111,159,0.12); }
.manage-spec-row .ms-spec { flex: 2; }
.manage-spec-row .ms-weight { flex: 1.2; text-align: right; font-variant-numeric: tabular-nums; }
.manage-spec-row .ms-del { background: #fbe9e9; color: #c94a4a; border: none; border-radius: 12px; padding: 0 12px; cursor: pointer; font-weight: 700; touch-action: manipulation; flex-shrink: 0; }
.manage-spec-row .ms-del:active { background: #f5c6c6; }
.paste-textarea { width: 100%; padding: 12px 14px; font-size: .88rem; border: 1.5px solid #d0dae8; border-radius: 14px; outline: none; font-family: ui-monospace, 'Courier New', monospace; resize: vertical; line-height: 1.6; }
.paste-textarea:focus { border-color: #1e6f9f; box-shadow: 0 0 0 3px rgba(30,111,159,0.12); }
.drag-handle { cursor: grab; color: #9aabbf; font-size: 1.15rem; padding: 0 6px; user-select: none; touch-action: none; flex-shrink: 0; line-height: 1; }
.drag-handle:active { cursor: grabbing; color: #1e6f9f; }
.material-group.dragging { opacity: 0.5; }
.sortable-ghost { opacity: 0.3; background: #eef4fa !important; }
.sortable-chosen { box-shadow: 0 8px 24px rgba(30,111,159,.2); }
.admin-user-card { background: #f9fcff; border: 1px solid #dbe6f2; border-radius: 18px; margin-bottom: 12px; overflow: hidden; }
.admin-user-summary { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 13px 14px; cursor: pointer; user-select: none; touch-action: manipulation; transition: 0.15s; }
.admin-user-summary:active { background: #eef4fa; }
.admin-user-summary-left { flex: 1; min-width: 0; }
.admin-user-name { font-size: 0.98rem; font-weight: 800; color: #0b2b4a; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.admin-user-sub { font-size: 0.76rem; color: #7b8fa3; margin-top: 3px; }
.admin-user-arrow { font-size: 0.75rem; color: #7b8fa3; transition: transform 0.2s; flex-shrink: 0; }
.admin-user-arrow.collapsed { transform: rotate(-90deg); }
.admin-user-body { padding: 0 14px 14px; }
.admin-user-body.collapsed { display: none; }
.admin-user-meta { font-size: 0.82rem; color: #5e7a9a; line-height: 1.8; }
.admin-user-meta .label { color: #9aabbf; }
.admin-user-teams { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; }
.admin-team-tag { font-size: 0.72rem; background: #eef6ff; color: #1e6f9f; padding: 2px 8px; border-radius: 10px; }
.admin-team-tag.owner { background: #fff3d6; color: #8a6d1a; }

/* 离线状态条 */
.offline-bar { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 14px; margin-bottom: 14px; font-size: 0.85rem; font-weight: 600; transition: 0.2s; }
.offline-bar.offline { background: #fff3d6; color: #8a6d1a; border: 1px solid #f0e2b8; }
.offline-bar.syncing { background: #e8f1fb; color: #1e6f9f; border: 1px solid #cfe2f3; }
.offline-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; animation: pulse 1.5s infinite; flex-shrink: 0; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }

@media (max-width:560px) {
  body { padding:10px; }
  .app { border-radius:22px; padding:16px 14px 22px; }
  .gear-btn { width:34px; height:34px; }
  .user-tag { font-size:.72rem; }
  .entry-bottom { grid-template-columns: 1fr auto; row-gap: 3px; }
  .entry-weight-mini { min-width: 76px; font-size: 0.78rem; }
  .entry-time { grid-column: 1 / -1; text-align: right; font-size: 0.7rem; min-width: 0; }
  .cat-meta { font-size: 0.66rem; padding: 2px 8px; gap: 4px; }
  .loc-count { font-size: 0.66rem; padding: 2px 6px; }
}