/* 后台管理端公共样式 */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: "Microsoft YaHei", "PingFang SC", sans-serif; background: #f0f2f5; color: #333; font-size: 14px; }

.login-wrap { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-box { background: #fff; padding: 40px; border-radius: 8px; box-shadow: 0 4px 20px rgba(0,0,0,.08); width: 360px; }
.login-box h1 { font-size: 20px; text-align: center; margin-bottom: 8px; color: #1a3a6b; }
.login-box .sub { text-align: center; color: #999; margin-bottom: 24px; font-size: 13px; }

.layout { display: flex; min-height: 100vh; }
.sidebar { width: 200px; background: #1a3a6b; color: #fff; flex-shrink: 0; display: flex; flex-direction: column; }
.sidebar .brand { padding: 20px 16px; font-size: 16px; font-weight: bold; border-bottom: 1px solid rgba(255,255,255,.15); }
.sidebar nav { flex: 1; padding: 8px 0; }
.sidebar nav a { display: block; padding: 12px 20px; color: #cdd8ee; text-decoration: none; font-size: 14px; }
.sidebar nav a.active, .sidebar nav a:hover { background: rgba(255,255,255,.12); color: #fff; }
.sidebar .foot { padding: 14px 20px; font-size: 13px; border-top: 1px solid rgba(255,255,255,.15); }
.sidebar .foot a { color: #cdd8ee; text-decoration: none; cursor: pointer; }
.sidebar .foot a:hover { color: #fff; }

.main { flex: 1; padding: 24px; min-width: 0; }
.page-title { font-size: 18px; margin-bottom: 16px; color: #1a3a6b; }

.card { background: #fff; border-radius: 8px; padding: 16px; box-shadow: 0 1px 4px rgba(0,0,0,.05); margin-bottom: 16px; }

.toolbar { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; align-items: center; }
.toolbar input, .toolbar select { height: 34px; padding: 0 10px; border: 1px solid #d9d9d9; border-radius: 4px; font-size: 14px; }
.toolbar input { width: 220px; }

table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { border-bottom: 1px solid #eee; padding: 10px 12px; text-align: left; font-size: 13px; word-break: break-all; }
th { background: #f7f8fa; color: #666; font-weight: 600; white-space: nowrap; }
tr:hover td { background: #fafbff; }

.btn { display: inline-block; padding: 8px 16px; border: none; border-radius: 4px; cursor: pointer; font-size: 14px; text-decoration: none; line-height: 1; }
.btn-primary { background: #1a5cd6; color: #fff; }
.btn-primary:hover { background: #164db5; }
.btn-default { background: #fff; color: #333; border: 1px solid #d9d9d9; }
.btn-default:hover { border-color: #1a5cd6; color: #1a5cd6; }
.btn-danger { background: #e5484d; color: #fff; }
.btn-danger:hover { background: #cc3a3f; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 14px; }
.pager button { padding: 6px 12px; border: 1px solid #d9d9d9; background: #fff; border-radius: 4px; cursor: pointer; }
.pager button:disabled { opacity: .4; cursor: not-allowed; }
.pager span { color: #666; font-size: 13px; }

.tag { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; }
.tag-member { background: #fff3e0; color: #c46a00; }
.tag-plain { background: #f0f2f5; color: #666; }
.tag-read { background: #f0f2f5; color: #999; }
.tag-unread { background: #e8f1ff; color: #1a5cd6; }

.form-item { margin-bottom: 14px; }
.form-item label { display: block; margin-bottom: 6px; color: #555; }
.form-item label .req { color: #e5484d; margin-left: 2px; }
.form-item input, .form-item select, .form-item textarea {
  width: 100%; padding: 8px 10px; border: 1px solid #d9d9d9; border-radius: 4px; font-size: 14px; font-family: inherit;
}
.form-item textarea { min-height: 70px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; }
.form-actions { display: flex; gap: 10px; margin-top: 8px; }

.toast { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); padding: 10px 20px; border-radius: 6px; color: #fff; font-size: 14px; z-index: 9999; display: none; box-shadow: 0 4px 12px rgba(0,0,0,.15); }
.toast.ok { background: #36ad6a; }
.toast.err { background: #e5484d; }

.modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: none; align-items: center; justify-content: center; z-index: 999; }
.modal { background: #fff; border-radius: 8px; width: 440px; max-width: 92vw; padding: 24px; }
.modal h3 { margin-bottom: 16px; font-size: 16px; color: #1a3a6b; }
.modal .err-list { max-height: 300px; overflow: auto; }
.modal .err-list div { padding: 4px 0; border-bottom: 1px dashed #eee; font-size: 13px; color: #c46a00; }

.empty { text-align: center; color: #999; padding: 40px 0; }
.muted { color: #999; }
