/* 前台样式 - 移动优先 */
:root{
  --gold:#c8961e;
  --gold-dark:#a87a14;
  --gold-light:#fdf6e3;
  --bg:#f5f6f8;
  --text:#2c3e50;
  --muted:#95a5a6;
  --border:#eee;
}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent;}
body{margin:0;background:var(--bg);color:var(--text);font-family:-apple-system,"Microsoft YaHei",sans-serif;font-size:14px;line-height:1.5;}
a{color:inherit;text-decoration:none;}
input,button,select,textarea{font-family:inherit;font-size:14px;}

/* 页面容器 - 最大480px居中 */
.app{max-width:480px;margin:0 auto;min-height:100vh;background:var(--bg);position:relative;padding-bottom:60px;}
.app.with-header{padding-top:56px;}

/* 顶部栏 */
.top-bar{position:fixed;top:0;left:50%;transform:translateX(-50%);width:100%;max-width:480px;background:#fff;border-bottom:1px solid var(--border);height:56px;display:flex;align-items:center;justify-content:space-between;padding:0 14px;z-index:100;box-shadow:0 1px 3px rgba(0,0,0,.04);}
.top-bar .title{font-size:17px;font-weight:bold;}
.top-bar .left,.top-bar .right{display:flex;align-items:center;gap:10px;min-width:30px;}
.top-bar .right{justify-content:flex-end;}

/* 底部Tab栏 */
.tab-bar{position:fixed;bottom:0;left:50%;transform:translateX(-50%);width:100%;max-width:480px;background:#fff;border-top:1px solid var(--border);display:flex;height:56px;z-index:100;}
.tab-bar a{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;color:var(--muted);font-size:11px;gap:2px;}
.tab-bar a i{font-size:20px;}
.tab-bar a.active{color:var(--gold);}

/* 卡片 */
.card{background:#fff;border-radius:10px;box-shadow:0 1px 3px rgba(0,0,0,.05);margin-bottom:8px;overflow:hidden;}
.card-body{padding:12px 14px;}
.card-title{font-size:14px;font-weight:bold;margin:0 0 8px;}

/* 统计概览卡 */
.overview{background:linear-gradient(135deg,var(--gold),var(--gold-dark));color:#fff;border-radius:10px;padding:16px;margin-bottom:10px;}
.overview .label{font-size:13px;opacity:.9;}
.overview .amount{font-size:26px;font-weight:bold;margin:4px 0;}
.overview .row2{display:flex;justify-content:space-between;margin-top:10px;font-size:13px;}

/* 表单 */
.form-group{margin-bottom:12px;}
.form-group label{display:block;font-size:13px;color:var(--muted);margin-bottom:4px;}
.form-control{width:100%;padding:10px 12px;border:1px solid #ddd;border-radius:8px;background:#fff;font-size:15px;}
.form-control:focus{outline:none;border-color:var(--gold);box-shadow:0 0 0 2px rgba(200,150,30,.15);}
textarea.form-control{resize:vertical;min-height:60px;}

/* 按钮 */
.btn{display:inline-block;padding:10px 16px;border:none;border-radius:8px;font-size:15px;font-weight:bold;text-align:center;cursor:pointer;width:100%;}
.btn-warning{background:var(--gold);color:#fff;}
.btn-warning:active{background:var(--gold-dark);}
.btn-outline{background:#fff;color:var(--gold);border:1px solid var(--gold);}
.btn-block{width:100%;}

/* 记账页 */
.record-type-tabs{display:flex;background:#fff;border-radius:8px;padding:4px;margin-bottom:12px;}
.record-type-tabs button{flex:1;padding:8px;border:none;background:transparent;font-size:14px;color:var(--muted);border-radius:6px;}
.record-type-tabs button.active{background:var(--gold);color:#fff;font-weight:bold;}
.amount-input{font-size:32px;font-weight:bold;text-align:right;border:none;border-bottom:2px solid var(--gold);width:100%;padding:8px 0;color:var(--gold);}
.amount-input:focus{outline:none;}

/* 分类宫格 */
.cat-grid{display:grid;grid-template-columns:repeat(5,1fr);gap:5px;}
.cat-item{display:flex;flex-direction:column;align-items:center;justify-content:center;width:50px;height:50px;padding:2px;border-radius:8px;background:#fafafa;font-size:16px;color:var(--text);cursor:pointer;box-sizing:border-box;overflow:hidden;}
.cat-item span{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.cat-item i{font-size:14px !important;margin-bottom:1px;color:var(--muted);}
.cat-item.active{background:var(--gold-light);color:var(--gold);}
.cat-item.active i{color:var(--gold);}
.cat-item.parent{}

/* 记录列表 */
.record-list .date-header{padding:8px 14px;font-size:12px;color:var(--muted);background:#fafafa;font-weight:bold;}
.record-item{display:flex;align-items:center;padding:12px 14px;border-bottom:1px solid var(--border);background:#fff;}
.record-item .icon{width:36px;height:36px;border-radius:50%;background:var(--gold-light);display:flex;align-items:center;justify-content:center;margin-right:10px;flex-shrink:0;}
.record-item .icon i{font-size:18px;color:var(--gold);}
.record-item .info{flex:1;min-width:0;}
.record-item .info .name{font-size:14px;font-weight:600;}
.record-item .info .note{font-size:12px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.record-item .amount{font-size:15px;font-weight:bold;}
.record-item .amount.expense{color:#e74c3c;}
.record-item .amount.income{color:#27ae60;}

/* 统计 */
.stats-summary{display:flex;background:#fff;border-radius:10px;margin-bottom:10px;overflow:hidden;}
.stats-summary .col{flex:1;padding:14px;text-align:center;}
.stats-summary .col .label{font-size:12px;color:var(--muted);}
.stats-summary .col .val{font-size:18px;font-weight:bold;margin-top:2px;}
.stats-summary .col.expense .val{color:#e74c3c;}
.stats-summary .col.income .val{color:#27ae60;}
.stats-summary .col+.col{border-left:1px solid var(--border);}

/* 进度条 */
.progress{height:8px;background:#eee;border-radius:4px;overflow:hidden;}
.progress-bar{height:100%;background:var(--gold);}
.progress-bar.danger{background:#e74c3c;}

/* 列表项 */
.list-item{display:flex;align-items:center;justify-content:space-between;padding:12px 14px;border-bottom:1px solid var(--border);background:#fff;}
.list-item:last-child{border-bottom:none;}
.list-item .label{color:var(--muted);font-size:14px;}
.list-item .value{font-size:14px;font-weight:600;}

/* 空状态 */
.empty{text-align:center;padding:40px 20px;color:var(--muted);}
.empty i{font-size:48px;display:block;margin-bottom:8px;}

/* 登录注册 */
.auth-box{padding:30px 20px;}
.auth-box .logo{text-align:center;font-size:36px;color:var(--gold);margin-bottom:6px;}
.auth-box h2{text-align:center;font-size:20px;margin-bottom:24px;}

/* 弹出层 */
.modal-mask{position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,.5);z-index:200;display:none;}
.modal-mask.show{display:flex;align-items:center;justify-content:center;}
.modal-box{background:#fff;border-radius:10px;width:80%;max-width:300px;padding:20px;text-align:center;}
.modal-box .msg{margin-bottom:16px;font-size:15px;}
.modal-box .btn{width:auto;padding:8px 24px;}

/* 头像 */
.avatar{width:40px;height:40px;border-radius:50%;background:var(--gold);color:#fff;display:flex;align-items:center;justify-content:center;font-weight:bold;font-size:16px;flex-shrink:0;}
.avatar.lg{width:64px;height:64px;font-size:24px;}
