* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, "PingFang SC", "Microsoft YaHei", Arial, sans-serif; color: #333; background: #f2f4f7; }
a { color: #1565c0; text-decoration: none; }
a:hover { text-decoration: underline; }

/* 布局 */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 210px; background: #1f2d3d; color: #cfd8e3; flex-shrink: 0; }
.sidebar .brand { padding: 18px 20px; font-size: 16px; font-weight: 600; color: #fff; background: #17222e; }
.sidebar nav a { display: block; padding: 12px 20px; color: #cfd8e3; border-left: 3px solid transparent; }
.sidebar nav a:hover, .sidebar nav a.active { background: #2a3a4d; color: #fff; border-left-color: #4a90d9; text-decoration: none; }
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar { height: 52px; background: #fff; border-bottom: 1px solid #e3e8ee; display: flex; align-items: center; justify-content: space-between; padding: 0 20px; }
.topbar .who { color: #666; font-size: 14px; }
.content { padding: 20px; }

/* 组件 */
.card { background: #fff; border: 1px solid #e3e8ee; border-radius: 6px; padding: 18px; margin-bottom: 18px; }
.card h2 { margin: 0 0 14px; font-size: 15px; }
table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid #eef1f5; font-size: 14px; vertical-align: middle; }
th { background: #f7f9fb; color: #555; font-weight: 600; }
tr:hover td { background: #fafbfc; }
img.thumb { height: 40px; border-radius: 4px; vertical-align: middle; }
audio { height: 32px; vertical-align: middle; }

input[type=text], input[type=password], textarea, select { width: 100%; max-width: 420px; padding: 8px 10px; border: 1px solid #cfd6de; border-radius: 4px; font-size: 14px; }
textarea { min-height: 90px; }
label { display: block; margin: 10px 0 4px; font-size: 13px; color: #555; }
.btn { display: inline-block; padding: 7px 14px; border: 0; border-radius: 4px; background: #1976d2; color: #fff; cursor: pointer; font-size: 14px; }
.btn:hover { background: #135ba1; text-decoration: none; }
.btn.danger { background: #e53935; }
.btn.danger:hover { background: #c62828; }
.btn.small { padding: 4px 10px; font-size: 13px; }
.inline { display: inline; }
.muted { color: #999; font-size: 13px; }
.flash { background: #e8f5e9; border: 1px solid #a5d6a7; color: #2e7d32; padding: 10px 14px; border-radius: 4px; margin-bottom: 16px; font-size: 14px; }
.flash.err { background: #ffebee; border-color: #ef9a9a; color: #c62828; }

/* 统计卡 */
.stats { display: flex; gap: 16px; flex-wrap: wrap; }
.stat { background: #fff; border: 1px solid #e3e8ee; border-radius: 6px; padding: 18px 24px; min-width: 130px; }
.stat .n { font-size: 26px; font-weight: 700; color: #1976d2; }
.stat .l { color: #777; font-size: 13px; margin-top: 4px; }

/* 分页 */
.pagination { margin-top: 14px; display: flex; gap: 6px; flex-wrap: wrap; }
.pagination a { padding: 5px 10px; border: 1px solid #cfd6de; border-radius: 4px; color: #1565c0; font-size: 13px; }
.pagination a.cur { background: #1976d2; color: #fff; border-color: #1976d2; }
.pagination .gap { padding: 5px 4px; color: #999; }
.pagination a:hover { text-decoration: none; }

/* 工具条 */
.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 10px; background: #eef1f5; color: #555; font-size: 12px; }
img.thumb-lg { height: 64px; border-radius: 4px; vertical-align: middle; }

/* 动态字段表单 */
.form-row { margin-bottom: 12px; }
.form-row .ctrl { max-width: 520px; }
.form-row .opt { display: inline-block; margin-right: 14px; font-weight: normal; }
.req { color: #e53935; }

/* 登录 */
.login-wrap { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-box { background: #fff; padding: 32px; border-radius: 8px; box-shadow: 0 6px 24px rgba(0,0,0,.08); width: 340px; }
.login-box h1 { font-size: 18px; margin: 0 0 20px; text-align: center; }
.login-box .btn { width: 100%; margin-top: 16px; }
