/* 车配家后台样式 */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; font-family: "Microsoft YaHei", Arial, sans-serif; font-size: 14px; color: #333; background: #f5f7fa; }
a { color: #2c8eff; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }

/* 登录页 */
.login-wrap { display: flex; align-items: center; justify-content: center; height: 100vh; background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%); }
.login-box { width: 380px; background: #fff; border-radius: 8px; padding: 40px 32px; box-shadow: 0 20px 60px rgba(0,0,0,.2); }
.login-box h1 { text-align: center; color: #1e3c72; margin-bottom: 8px; font-size: 24px; }
.login-box .sub { text-align: center; color: #999; margin-bottom: 28px; font-size: 13px; }
.login-box .field { margin-bottom: 18px; }
.login-box label { display: block; margin-bottom: 6px; color: #666; font-size: 13px; }
.login-box input { width: 100%; height: 40px; padding: 0 12px; border: 1px solid #ddd; border-radius: 4px; font-size: 14px; transition: border-color .2s; }
.login-box input:focus { border-color: #2c8eff; outline: none; }
.login-box .btn { width: 100%; height: 42px; background: #2c8eff; color: #fff; border: none; border-radius: 4px; font-size: 15px; margin-top: 8px; }
.login-box .btn:hover { background: #1a7ae0; }
.login-box .btn:disabled { background: #aaa; cursor: not-allowed; }

/* 框架布局 */
.layout { display: flex; height: 100vh; }
.sidebar { width: 200px; background: #1e3c72; color: #fff; flex-shrink: 0; display: flex; flex-direction: column; }
.sidebar .brand { padding: 18px 20px; font-size: 18px; font-weight: bold; border-bottom: 1px solid rgba(255,255,255,.1); }
.sidebar .menu { flex: 1; overflow-y: auto; padding: 8px 0; }
.sidebar .menu a { display: flex; align-items: center; padding: 12px 20px; color: #c5d3e8; font-size: 14px; border-left: 3px solid transparent; transition: all .2s; }
.sidebar .menu a:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar .menu a.active { background: rgba(255,255,255,.1); border-left-color: #ffd54f; color: #fff; }
.sidebar .menu .ico { width: 18px; margin-right: 10px; text-align: center; }
.sidebar .foot { padding: 12px 20px; border-top: 1px solid rgba(255,255,255,.1); font-size: 12px; color: #8aa4c4; }

.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.topbar { height: 56px; background: #fff; border-bottom: 1px solid #e5e5e5; display: flex; align-items: center; padding: 0 24px; }
.topbar .title { flex: 1; font-size: 16px; font-weight: 500; }
.topbar .user { color: #666; }
.topbar .user b { color: #2c8eff; margin: 0 4px; }
.topbar .logout { margin-left: 16px; color: #f56565; cursor: pointer; }
.content { flex: 1; overflow: hidden; }
.content iframe { width: 100%; height: 100%; border: none; }

/* 通用页面 */
.page { padding: 20px 24px; }
.page-head { display: flex; align-items: center; margin-bottom: 16px; }
.page-head h2 { font-size: 18px; flex: 1; }
.toolbar { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }
.toolbar input, .toolbar select { height: 32px; padding: 0 10px; border: 1px solid #ddd; border-radius: 4px; font-size: 13px; }
.toolbar input:focus, .toolbar select:focus { border-color: #2c8eff; outline: none; }

table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 4px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #f0f0f0; font-size: 13px; }
th { background: #fafbfc; color: #666; font-weight: 500; }
tr:hover td { background: #fafbfc; }
tr.empty td { text-align: center; color: #999; padding: 40px; }

.pager { display: flex; gap: 6px; justify-content: center; margin-top: 16px; }
.pager button { min-width: 32px; height: 32px; border: 1px solid #ddd; background: #fff; border-radius: 4px; font-size: 13px; }
.pager button.active { background: #2c8eff; color: #fff; border-color: #2c8eff; }
.pager button:disabled { color: #ccc; cursor: not-allowed; }

/* 按钮 */
.cpj-btn { display: inline-block; padding: 6px 14px; border: 1px solid #ddd; background: #fff; border-radius: 4px; font-size: 13px; color: #333; }
.cpj-btn-primary { background: #2c8eff; color: #fff; border-color: #2c8eff; }
.cpj-btn-primary:hover { background: #1a7ae0; }
.cpj-btn-danger { background: #f56565; color: #fff; border-color: #f56565; }
.cpj-btn-danger:hover { background: #e53e3e; }
.cpj-btn-success { background: #38a169; color: #fff; border-color: #38a169; }
.cpj-btn-sm { padding: 4px 8px; font-size: 12px; }
.cpj-btn:disabled { opacity: .5; cursor: not-allowed; }

/* 状态标签 */
.tag { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; }
.tag-success { background: #e6ffed; color: #38a169; }
.tag-warn { background: #fff8e1; color: #f69300; }
.tag-danger { background: #ffeef0; color: #f56565; }
.tag-info { background: #e6f4ff; color: #2c8eff; }
.tag-gray { background: #f0f0f0; color: #999; }

/* 表单 */
.form-row { margin-bottom: 16px; }
.form-row label { display: block; margin-bottom: 6px; color: #666; font-size: 13px; }
.form-row label .req { color: #f56565; margin-left: 2px; }
.form-row input, .form-row select, .form-row textarea { width: 100%; height: 36px; padding: 0 10px; border: 1px solid #ddd; border-radius: 4px; font-size: 13px; font-family: inherit; }
.form-row textarea { height: auto; padding: 8px 10px; min-height: 80px; }
.form-row input:focus, .form-row select:focus, .form-row textarea:focus { border-color: #2c8eff; outline: none; }

/* 弹窗 */
.cpj-modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.cpj-modal { background: #fff; border-radius: 8px; width: 600px; max-width: 92vw; max-height: 88vh; display: flex; flex-direction: column; }
.cpj-modal.large { width: 880px; }
.cpj-modal-title { padding: 16px 20px; font-size: 16px; font-weight: 500; border-bottom: 1px solid #eee; }
.cpj-modal-body { padding: 20px; overflow-y: auto; flex: 1; }
.cpj-modal-foot { padding: 12px 20px; border-top: 1px solid #eee; display: flex; justify-content: flex-end; gap: 10px; }

/* Toast */
.cpj-toast { position: fixed; top: 24px; left: 50%; transform: translateX(-50%) translateY(-20px); padding: 10px 20px; border-radius: 4px; color: #fff; font-size: 14px; opacity: 0; transition: all .3s; z-index: 2000; }
.cpj-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.cpj-toast-info { background: #2c8eff; }
.cpj-toast-success { background: #38a169; }
.cpj-toast-error { background: #f56565; }

/* 图片上传 */
.img-uploader { display: flex; gap: 10px; flex-wrap: wrap; }
.img-uploader .item { width: 100px; height: 100px; border: 1px solid #e5e5e5; border-radius: 4px; position: relative; overflow: hidden; }
.img-uploader .item img { width: 100%; height: 100%; object-fit: cover; }
.img-uploader .item .del { position: absolute; top: 2px; right: 2px; width: 18px; height: 18px; background: rgba(0,0,0,.5); color: #fff; border-radius: 50%; text-align: center; line-height: 18px; cursor: pointer; font-size: 12px; }
.img-uploader .add { width: 100px; height: 100px; border: 1px dashed #ccc; border-radius: 4px; display: flex; align-items: center; justify-content: center; font-size: 28px; color: #ccc; cursor: pointer; }
.img-uploader .add:hover { border-color: #2c8eff; color: #2c8eff; }

.empty { text-align: center; padding: 60px 20px; color: #999; }
.empty .ico { font-size: 48px; opacity: .3; margin-bottom: 8px; }
