/* 现代化 UI 变量基准 */
:root {
    --primary: #4F46E5;       
    --primary-hover: #4338CA;
    --bg-color: #F3F4F6;      
    --card-bg: #FFFFFF;
    --text-main: #111827;
    --text-muted: #6B7280;
    --border-color: #E5E7EB;
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --radius-lg: 16px;
    --radius-md: 10px;
    --shadow-card: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.025);
    --shadow-float: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

body { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Segoe UI", Roboto, Helvetica, Arial, sans-serif; background: var(--bg-color); margin: 0; padding: 16px; color: var(--text-main); -webkit-font-smoothing: antialiased; }
.card { background: var(--card-bg); padding: 16px; border-radius: var(--radius-lg); box-shadow: var(--shadow-card); margin-bottom: 16px; border: 1px solid rgba(255,255,255,0.5); }

.app-view { display: none; animation: fadeIn 0.4s ease-out; }
.app-view.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.top-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; background: #fff; padding: 12px 16px; border-radius: var(--radius-md); box-shadow: 0 2px 4px rgba(0,0,0,0.02); }
.nav-tabs { display: flex; background: #E5E7EB; border-radius: 14px; padding: 4px; margin-bottom: 16px; overflow-x: auto; white-space: nowrap; }
.nav-tab { flex: 1; text-align: center; padding: 10px 8px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--text-muted); border-radius: 10px; transition: all 0.3s ease; white-space: nowrap;}
.nav-tab.active { background: var(--card-bg); color: var(--primary); box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.nav-tabs::-webkit-scrollbar { display: none; }
.page-view { display: none; }
.page-view.active { display: block; animation: slideUp 0.4s ease-out; }
@keyframes slideUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* 优化表单边距，完美适配手机单屏直接添加 */
.form-group { margin-bottom: 12px; }
label { display: block; font-size: 13px; margin-bottom: 6px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px;}
.input-row { display: flex; gap: 8px; align-items: center;}
.input-row > * { flex-grow: 1; min-width: 0;}
input, select, textarea { width: 100%; padding: 10px 12px; border: 1.5px solid var(--border-color); border-radius: var(--radius-md); box-sizing: border-box; font-size: 15px; transition: all 0.2s; background: #F9FAFB; color: var(--text-main); font-family: inherit;}
input:focus, select:focus, textarea:focus { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1); outline: none; }
button { padding: 12px; border: none; border-radius: var(--radius-md); font-size: 15px; font-weight: 700; cursor: pointer; transition: all 0.2s; display: flex; justify-content: center; align-items: center; }
.btn-submit { width: 100%; background: var(--primary); color: white; margin-top: 8px; box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.2); }
.btn-submit:active { transform: scale(0.98); background: var(--primary-hover); }
.btn-action { background: #ECFDF5; color: #059669; border: 1px solid #A7F3D0; box-shadow: 0 2px 4px rgba(5, 150, 105, 0.05);}
.btn-action:active { background: #D1FAE5; }
.btn-danger { background: #FEF2F2; color: #DC2626; border: 1px solid #FECACA; }
.btn-add { background: #ECFDF5; color: #059669; width: 42px; padding: 0; height: 42px; font-size: 20px; flex-grow: 0; border: 1px solid #A7F3D0;}
.btn-delete { background: #FEF2F2; color: #DC2626; width: 42px; padding: 0; height: 42px; font-size: 22px; flex-grow: 0; border: 1px solid #FECACA;}

.calc-result { padding: 8px 10px; background: #EEF2FF; border-radius: var(--radius-md); font-size: 13px; color: var(--primary); text-align: center; border: 1px dashed #C7D2FE; font-weight: 500; white-space: nowrap;}
.cost-highlight { font-size: 18px; font-weight: 800; color: var(--primary); }
.record-item { display: flex; padding: 16px; border: 1px solid var(--border-color); border-radius: var(--radius-md); margin-bottom: 12px; background: #fff; transition: transform 0.2s, box-shadow 0.2s; }
.record-item:hover { transform: translateY(-2px); box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05); }
.meta-info { display: flex; align-items: center; margin-bottom: 8px; flex-wrap: wrap; gap: 8px; }
.record-date { font-size: 12px; color: var(--text-muted); font-weight: 500;}
.tag { font-size: 11px; padding: 4px 8px; border-radius: 6px; font-weight: 600; letter-spacing: 0.5px;}
.tag-device { background: #E0F2FE; color: #0369A1; }
.tag-account { background: #FFEDD5; color: #C2410C; }
.record-content { font-size: 16px; font-weight: 700; margin-bottom: 8px; color: var(--text-main);}
.record-details { font-size: 13px; color: var(--text-muted); background: #F9FAFB; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--border-color);}
.filter-area { background: #F8FAFC; padding: 16px; border-radius: var(--radius-md); margin-bottom: 16px; border: 1px solid #E2E8F0; }

.status-badge { padding: 6px 12px; border-radius: 8px; font-size: 13px; font-weight: 700; text-align: center; min-width: 105px; height: 38px;}
select.status-badge { appearance: none; -webkit-appearance: none; padding-right: 24px; background-image: url('data:image/svg+xml;utf8,<svg fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z" fill="currentColor"/></svg>'); background-repeat: no-repeat; background-position-x: calc(100% - 4px); background-position-y: 50%; border: 2px solid transparent;}

.status-pending { background-color: #F3F4F6; color: #4B5563; } 
.status-arrived { background-color: #FEF3C7; color: #D97706; } 
.status-active { background-color: #D1FAE5; color: #059669; border: 2px solid #34D399;} 
.status-expired { background-color: #FEE2E2; color: #DC2626; border: 2px solid #FCA5A5;} 
.status-completed { background-color: #F3F4F6; color: #9CA3AF; text-decoration: line-through; border: 1px dashed #D1D5DB; opacity: 0.8;} 

.target-date-input { color: var(--danger); font-weight: 700; font-size: 14px; background: #FEF2F2; border: 1px dashed #FCA5A5; border-radius: 6px; padding: 4px 8px; width: 130px; margin-top: 6px; transition: all 0.2s;}
.target-date-input:focus { border-color: var(--danger); background: #fff;}

.overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(17, 24, 39, 0.6); backdrop-filter: blur(4px); z-index: 1000; animation: fadeIn 0.2s; }
.modal { display: none; position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); background: white; width: 92%; max-width: 420px; padding: 24px; border-radius: var(--radius-lg); z-index: 1001; box-sizing: border-box; max-height: 85vh; overflow-y: auto; box-shadow: var(--shadow-float);}
.close-btn { background: #F3F4F6; color: var(--text-main); margin-top: 16px; box-shadow: none;}
.dashboard-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 24px; }
.dash-card { background: #fff; padding: 16px; border-radius: var(--radius-lg); border: 1px solid var(--border-color); box-shadow: 0 2px 4px rgba(0,0,0,0.02); display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center;}
.dash-label { font-size: 12px; color: var(--text-muted); font-weight: 600; margin-bottom: 8px; }
.dash-val { font-size: 20px; font-weight: 800; }
.profit-pos { color: var(--success); font-weight: 800; } 
.profit-neg { color: var(--danger); font-weight: 800; } 
.admin-table { width: 100%; border-collapse: collapse; margin-top: 16px; font-size: 13px; }
.admin-table th, .admin-table td { border: 1px solid #E5E7EB; padding: 8px; text-align: left; }
.admin-table th { background: #F9FAFB; }

.bill-card { background: #fff; border: 1px solid var(--border-color); border-radius: var(--radius-lg); padding: 16px; margin-bottom: 16px; border-left: 5px solid var(--primary); box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);}
.bill-header { display: flex; justify-content: space-between; border-bottom: 1px solid var(--border-color); padding-bottom: 12px; margin-bottom: 12px; }
.bill-title { font-weight: 800; color: var(--text-main); font-size: 16px; }
.bill-summary { display: flex; justify-content: space-between; background: #F8FAFC; padding: 12px; border-radius: var(--radius-md); margin-bottom: 12px; font-size: 13px; border: 1px solid #E2E8F0;}
.bill-details { font-size: 13px; line-height: 1.6; }
.bill-item { display: flex; justify-content: space-between; border-bottom: 1px dashed var(--border-color); padding: 8px 0; }
.bill-item:last-child { border-bottom: none; }

.settle-item { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px dashed var(--border-color); font-size: 14px;}
.settle-item input[type="number"] { width: 75px; padding: 8px; margin-left: 8px; text-align: center; border-radius: 6px;}
.alert-icon { font-size: 40px; text-align: center; margin-bottom: 10px; }

::-webkit-scrollbar { width: 0; background: transparent; }