* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { overscroll-behavior-x: none; }

/* ===== 全局 toast ===== */
.ui-toast-wrap { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 100000; display: flex; flex-direction: column; gap: 10px; align-items: center; pointer-events: none; }
.ui-toast { display: flex; align-items: center; gap: 9px; min-width: 200px; max-width: 480px; padding: 11px 16px; border-radius: 10px; background: #303133; color: #fff; font-size: 14px; line-height: 1.5; box-shadow: 0 8px 28px rgba(0,0,0,.22); opacity: 0; transform: translateY(-14px); transition: opacity .24s, transform .24s; pointer-events: auto; }
.ui-toast.show { opacity: 1; transform: translateY(0); }
.ui-toast-ic { flex: none; width: 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; background: rgba(255,255,255,.22); }
.ui-toast-msg { word-break: break-word; }
.ui-toast-success { background: #1e8e4e; }
.ui-toast-error { background: #d93025; }
.ui-toast-warn { background: #e37400; }
.ui-toast-info { background: #303133; }

/* ===== 全局确认框 ===== */
.ui-modal-ov { position: fixed; inset: 0; z-index: 100001; background: rgba(0,0,0,.32); display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .18s; overflow-y: auto; padding: 16px; box-sizing: border-box; }
.ui-modal-ov.show { opacity: 1; }
.ui-modal { width: 380px; max-width: 92%; background: #fff; border-radius: 14px; box-shadow: 0 20px 60px rgba(0,0,0,.25); overflow: hidden; transform: translateY(10px) scale(.98); transition: transform .2s;
  display: flex; flex-direction: column; max-height: 90vh; }
/* 内容过长时仅正文滚动，标题与底部按钮始终可见 */
.ui-modal-body { overflow-y: auto; -webkit-overflow-scrolling: touch; }
.ui-modal-title, .ui-modal-ft { flex: 0 0 auto; }
.ui-modal-ov.show .ui-modal { transform: translateY(0) scale(1); }
.ui-modal-title { padding: 18px 22px 6px; font-size: 16px; font-weight: 600; color: #1f2329; }
.ui-modal-body { padding: 4px 22px 20px; font-size: 14px; color: #4e5969; line-height: 1.65; word-break: break-word; white-space: pre-wrap; }
.ui-modal-ft { display: flex; justify-content: flex-end; gap: 10px; padding: 12px 20px; background: #fafbfc; border-top: 1px solid #f0f2f5; }
.ui-btn { padding: 7px 20px; border-radius: 8px; font-size: 14px; cursor: pointer; border: 1px solid transparent; transition: background .15s, border-color .15s; }
.ui-btn-cancel { background: #fff; border-color: #dcdfe6; color: #4e5969; }
.ui-btn-cancel:hover { border-color: #c0c4cc; background: #f7f8fa; }
.ui-btn-ok { background: #2563eb; color: #fff; }
.ui-btn-ok:hover { background: #1d4ed8; }
.ui-btn-ok.danger { background: #d93025; }
.ui-btn-ok.danger:hover { background: #c5221f; }

body { font-family: -apple-system, 'Microsoft YaHei', 'PingFang SC', sans-serif; background: #f0f2f5; color: #333; }
/* 横向滚动容器：触控板横滑到边界时不链到浏览器前进/后退手势 */
[style*="overflow-x"], .table-scroll, .project-table-wrap { overscroll-behavior-x: contain; }

.navbar { background: #1a73e8; color: #fff; padding: 0 24px; display: flex; align-items: center; height: 52px; box-shadow: 0 2px 4px rgba(0,0,0,0.1); position: sticky; top: 0; z-index: 200; }
.nav-brand { font-size: 18px; font-weight: 600; margin-right: 40px; display: flex; align-items: center; gap: 9px; }
.nav-links a { color: rgba(255,255,255,0.8); text-decoration: none; padding: 14px 16px; font-size: 14px; display: inline-block; }
.nav-links a:hover, .nav-links a.active { color: #fff; border-bottom: 2px solid #fff; }
.nav-user { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.nav-user span { color: #cfe0ff; font-size: 13px; white-space: nowrap; }
.nav-user a { color: rgba(255,255,255,0.9); text-decoration: none; font-size: 13px; white-space: nowrap; }
.nav-user a:hover { color: #fff; }
.nav-logo { width: 30px; height: 30px; border-radius: 8px; display: block; box-shadow: 0 1px 5px rgba(0,0,0,0.28); background: #fff; }
@media (max-width: 640px) { .nav-logo { width: 26px; height: 26px; } }

.nav-dropdown { position: relative; display: inline-block; }
.nav-dropdown-menu { display: none; position: absolute; top: 100%; left: 0; background: #fff; border-radius: 4px; box-shadow: 0 4px 12px rgba(0,0,0,0.15); min-width: 120px; z-index: 100; padding: 4px 0; }
.nav-dropdown-menu a { display: block; color: #333 !important; padding: 8px 16px !important; font-size: 13px !important; border-bottom: none !important; }
.nav-dropdown-menu a:hover { background: #f0f2f5 !important; color: #1a73e8 !important; }
.nav-dropdown:hover .nav-dropdown-menu { display: block; }

.container { max-width: 1100px; margin: 20px auto; padding: 0 16px; }

.card { background: #fff; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); padding: 20px 24px; margin-bottom: 16px; }
.card h2 { font-size: 18px; margin-bottom: 16px; color: #1a73e8; }

.alert { padding: 10px 16px; border-radius: 4px; margin-bottom: 12px; font-size: 14px; }
.alert-success { background: #e8f5e9; color: #2e7d32; border: 1px solid #c8e6c9; }
.alert-error { background: #ffebee; color: #c62828; border: 1px solid #ffcdd2; }

.btn { display: inline-block; padding: 8px 20px; border: none; border-radius: 4px; font-size: 14px; cursor: pointer; text-decoration: none; }
.btn-primary { background: #1a73e8; color: #fff; }
.btn-primary:hover { background: #1557b0; }
.btn-secondary { background: #f5f5f5; color: #333; border: 1px solid #ddd; }
.btn-secondary:hover { background: #e0e0e0; }
.btn-danger { background: #e53935; color: #fff; }
.btn-sm { padding: 4px 12px; font-size: 13px; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { background: #f5f7fa; font-weight: 600; text-align: left; padding: 10px 12px; border-bottom: 2px solid #e0e0e0; }
td { padding: 10px 12px; border-bottom: 1px solid #eee; vertical-align: top; }
tr:hover { background: #f8f9fa; }

.date-list a { display: block; padding: 10px 0; border-bottom: 1px solid #f0f0f0; text-decoration: none; color: #333; font-size: 15px; }
.date-list a:hover { color: #1a73e8; }

.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 13px; color: #555; margin-bottom: 4px; font-weight: 500; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 8px 12px; border: 1px solid #ddd; border-radius: 4px; font-size: 14px; font-family: inherit;
}
.form-group input[type="checkbox"] { width: auto; margin: 0; vertical-align: middle; }
.form-group textarea { min-height: 60px; resize: vertical; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: #1a73e8; box-shadow: 0 0 0 2px rgba(26,115,232,0.15); }

.form-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.form-row .form-group { flex: 1; min-width: 150px; }

.config-group { margin-bottom: 24px; }
.config-group h3 { font-size: 15px; color: #1a73e8; margin-bottom: 12px; padding-bottom: 6px; border-bottom: 1px solid #e0e0e0; }

.tag { display: inline-block; padding: 2px 8px; border-radius: 3px; font-size: 12px; }
.tag-success { background: #e8f5e9; color: #2e7d32; }
.tag-warning { background: #fff8e1; color: #e65100; }
.tag-info { background: #e3f2fd; color: #1565c0; }
.tag-default { background: #f5f5f5; color: #616161; }

.unchanged-mark { background: #ffecb3; color: #e65100; font-size: 11px; padding: 1px 6px; border-radius: 3px; }

.stats-row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.stat-card { flex: 1; min-width: 120px; background: #f8f9fa; border-radius: 6px; padding: 12px 16px; text-align: center; border: 1px solid #e0e0e0; }
.stat-card .num { font-size: 28px; font-weight: 600; color: #1a73e8; }
.stat-card .label { font-size: 12px; color: #888; margin-top: 2px; }

pre { white-space: pre-wrap; word-wrap: break-word; font-family: inherit; margin: 0; }

.manager-header { font-size: 16px; font-weight: 600; color: #1a73e8; padding: 10px 0; border-bottom: 2px solid #1a73e8; margin: 20px 0 10px; }

.loading { opacity: 0.6; pointer-events: none; }

/* embed 模式（企业微信消息卡片进入）：无导航栏，容器贴顶 */
body.embed-mode .container { margin-top: 10px; max-width: 100%; }

/* ============ 移动端响应式 ============ */
@media (max-width: 768px) {
  /* 导航栏：改为可换行的紧凑布局，去掉固定高度 */
  .navbar { height: auto; min-height: 48px; padding: 6px 12px; flex-wrap: wrap; align-items: center; }
  .nav-brand { font-size: 16px; margin-right: 12px; margin-bottom: 2px; }
  .nav-links { display: flex; flex-wrap: wrap; align-items: center; width: 100%; gap: 2px; }
  .nav-links a { padding: 7px 10px; font-size: 13px; }
  /* 下拉菜单在移动端默认平铺展开（hover 不可靠） */
  .nav-dropdown { position: static; }
  .nav-dropdown-menu { position: static; box-shadow: none; padding: 0; min-width: auto; background: transparent; display: inline; }
  .nav-dropdown-menu a { color: rgba(255,255,255,0.7) !important; padding: 6px 10px !important; display: inline-block; }

  .container { margin: 10px auto; padding: 0 10px; }
  .card { padding: 14px 14px; }
  .card h2 { font-size: 16px; }

  table { font-size: 12px; }
}
