/* Work12 V16 NOVA UI
 * Visual layer only: existing APIs, permission checks and funds guards remain authoritative.
 */
:root {
  --primary: #2f5bd3;
  --primary-dark: #2b52c4;
  --primary-light: #eaf0fd;
  --primary-gradient: linear-gradient(135deg, #2b52c4 0%, #587ce0 100%);
  --bg: #f7f8fc;
  --bg-card: #fff;
  --bg-grey: #f1f3f9;
  --text: #1a1f33;
  --text-secondary: #777e8c;
  --text-hint: #9ca3b4;
  --border: #e5e8f0;
  --border-light: #eff1f6;
  --radius: 14px;
  --radius-lg: 18px;
  --radius-xl: 22px;
  --shadow: 0 1px 10px rgba(30, 40, 66, .05);
  --shadow-md: 0 8px 24px rgba(30, 40, 66, .09);
  --header-height: 58px;
  --tab-height: 72px;
}

body { background: var(--bg); color: var(--text); font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Helvetica Neue", sans-serif; }
#appMain { background: var(--bg); }

/* Unified entry */
#loginPage {
  background:
    radial-gradient(circle at 12% 10%, rgba(110,143,224,.22), transparent 32%),
    radial-gradient(circle at 90% 90%, rgba(43,182,115,.12), transparent 28%),
    #eef2fb;
}
.login-box { border: 1px solid rgba(255,255,255,.85); border-radius: 26px; box-shadow: 0 22px 64px rgba(30,40,66,.16); overflow: hidden; }
.login-logo { background: var(--primary-gradient); padding: 36px 26px 30px; color: #fff; }
.login-logo i { color: #fff; background: rgba(255,255,255,.15); width: 58px; height: 58px; display: inline-flex; align-items: center; justify-content: center; border-radius: 18px; }
.login-logo h2 { font-size: 22px; letter-spacing: -.3px; margin-top: 14px; }
.login-logo p { color: rgba(255,255,255,.75); line-height: 1.65; max-width: 320px; margin: 6px auto 0; }
.login-welcome strong { color: var(--text); font-size: 17px; }
.login-field input { border-radius: 12px; background: #f7f8fc; border-color: transparent; }
.login-field input:focus { background: #fff; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(47,91,211,.09); }
.login-btn { min-height: 48px; border-radius: 14px; background: var(--primary-gradient); box-shadow: 0 6px 18px rgba(47,91,211,.24); }

/* Header and navigation */
.app-header { background: rgba(247,248,252,.94); border-bottom-color: var(--border-light); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
.header-name-tag { min-width: 32px; height: 32px; padding: 0 9px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; background: var(--primary-light); color: var(--primary-dark); }
.header-username { font-size: 14px; color: var(--text); }
.header-search-btn { background: #fff; border: 1px solid var(--border-light); color: var(--text-secondary); border-radius: 11px; }
.header-add-btn { border: 0; background: var(--primary); box-shadow: 0 4px 12px rgba(47,91,211,.22); }
.header-add-btn i, .header-add-btn:active i { color: #fff; }
.enterprise-popup, .header-menu-popup, .header-search-popup { border: 1px solid rgba(225,229,240,.9); border-radius: 18px; box-shadow: 0 18px 48px rgba(30,40,66,.16); }

.bottom-tabs { height: var(--tab-height); border-top: 1px solid var(--border-light); box-shadow: none; padding-top: 8px; overflow: visible; }
.bottom-tab { gap: 4px; font-size: 11px; color: var(--text-hint); }
.bottom-tab i { font-size: 20px; }
.bottom-tab i svg{width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;display:block}
.bottom-tab span:not(.badge) { font-size: 11px; }
.bottom-tab.active { color: var(--primary-dark); font-weight: 650; }
.bottom-tab[data-tab="home"] { position: relative; }
.bottom-tab[data-tab="home"] i { width: 54px; height: 54px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--primary-dark); color: #fff; border: 4px solid #fff; box-shadow: 0 7px 18px rgba(43,82,196,.34); position: absolute; top: -28px; }
.bottom-tab[data-tab="home"] span:not(.badge) { margin-top: 30px; }
.bottom-tab[data-tab="home"] span:not(.badge) { visibility: hidden; }
.bottom-tab[data-tab="home"].active i { transform: none; }

/* V16 horizontal sub-navigation */
.work-tabs, .msg-sub-tabs { background: var(--bg) !important; border-bottom: 1px solid var(--border-light); padding: 0 14px !important; gap: 2px !important; }
.work-tab, .msg-sub-tab { flex: 0 0 auto !important; padding: 12px 13px !important; border-radius: 0 !important; background: transparent !important; color: var(--text-secondary) !important; border-bottom: 2.5px solid transparent !important; }
.work-tab.active, .msg-sub-tab.active { color: var(--primary) !important; font-weight: 650 !important; border-bottom-color: var(--primary) !important; }
.work-content { padding: 14px 18px 92px; }
.app-content { background: var(--bg); }
.home-section, .mine-section, .gov-card, .detail-card { border-color: transparent; }

/* Home: priorities first, money second, risks third */
.home-feed { padding: 14px 18px 96px; max-width: 860px; }
.home-header { padding: 6px 2px 14px; }
.home-greeting { font-size: 21px; font-weight: 720; letter-spacing: -.5px; color: var(--text); }
.home-role { color: var(--text-hint); margin-top: 3px; }
.home-section { border: 1px solid rgba(239,241,246,.85); border-radius: 18px; padding: 16px; margin-bottom: 12px; box-shadow: var(--shadow); }
.home-section-title { font-size: 16px; font-weight: 650; letter-spacing: -.2px; }
.home-section-badge { background: var(--primary-light); color: var(--primary); }
.home-todo-item { padding: 12px 0; }
.home-todo-title { font-weight: 600; }
.home-nuo-card { background: var(--primary-dark); border: 0; box-shadow: 0 10px 28px rgba(43,82,196,.22); }
.home-nuo-icon { background: rgba(255,255,255,.14); border-radius: 15px; }
.home-nuo-total { font-size: 27px; letter-spacing: -.7px; }
.home-risk-item { border-radius: 12px; }

/* Cards, task flow, solution library and forms */
.detail-page { background: var(--bg); }
.detail-page-body { padding: 14px 18px 92px; }
.detail-card, .gov-card, .task-card { border: 1px solid rgba(239,241,246,.95); border-radius: 18px; box-shadow: var(--shadow); }
.detail-card { padding: 16px; margin-bottom: 12px; }
.detail-card h3 { font-size: 17px; line-height: 1.4; margin-bottom: 8px; }
.detail-card p { color: var(--text-secondary); line-height: 1.7; }
.detail-section-title, .work-section-title, .gov-section-title { font-size: 16px; font-weight: 650; letter-spacing: -.2px; }
.work-section-title::before, .gov-section-title::before { display: none; }
.detail-btn { min-height: 44px; border-radius: 13px; background: var(--primary); font-weight: 600; box-shadow: 0 3px 12px rgba(47,91,211,.18); }
.detail-btn-outline { background: #fff; color: var(--primary); border-color: var(--primary-light); box-shadow: none; }
.detail-actions { gap: 7px; overflow-x: auto; scrollbar-width: none; }
.detail-actions::-webkit-scrollbar { display: none; }
.detail-actions .detail-btn { flex: 1 0 auto; }
.detail-card input:not([type="checkbox"]):not([type="radio"]), .detail-card textarea, .detail-card select { background: #f7f8fc !important; border: 1.5px solid transparent !important; border-radius: 11px !important; }
.detail-card input:focus, .detail-card textarea:focus, .detail-card select:focus { background: #fff !important; border-color: var(--primary) !important; }

.work-quick-actions { gap: 3px; padding: 6px 0 14px; }
.work-quick-btn { min-width: 72px; padding: 9px 5px; }
.work-quick-icon, .work-grid-icon { width: 46px; height: 46px; border-radius: 14px; box-shadow: none; }
.work-grid { gap: 6px 2px; }
.work-grid-label { color: var(--text-secondary); font-size: 11px; }
.task-card { padding: 14px; margin-bottom: 10px; }
.task-card-title { font-size: 14px; font-weight: 650; }

/* Personal space and calendar */
.mine-header { background: var(--primary-dark); }
.mine-header::before, .mine-header::after { opacity: .14; }
.mine-avatar { background: rgba(255,255,255,.18); border: 2px solid rgba(255,255,255,.72); }
.mine-stats { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.08); border-radius: 16px; padding: 12px 6px; }
.calendar-header, .calendar-weekdays, .calendar-days { background: #fff; }
.calendar-header { border-radius: 18px 18px 0 0; }
.calendar-days { border-radius: 0 0 18px 18px; padding: 10px; }
.cal-day-today { background: var(--primary) !important; color: #fff !important; box-shadow: 0 4px 12px rgba(47,91,211,.22); }

@media (min-width: 768px) {
  :root { --tab-height: 56px; }
  .bottom-tab[data-tab="home"] i { position: static; width: auto; height: auto; border: 0; box-shadow: none; background: transparent; color: inherit; }
  .bottom-tab[data-tab="home"] span:not(.badge) { margin-top: 0; }
  .bottom-tab[data-tab="home"] span:not(.badge) { visibility: visible; }
  .bottom-tabs { background: #fff; border-right: 1px solid var(--border-light); }
  .sidebar-brand { background: linear-gradient(180deg, #fff 0%, #f9faff 100%); }
  .app-main-right { background: var(--bg); }
}

@media (max-width: 767px) {
  :root { --header-height: 0px; --tab-height: 76px; }
  #appMain > .app-main-right > #appHeader { height:0;min-height:0;padding:0;border:0;overflow:visible; }
  #appMain > .app-main-right > #appHeader > .header-user-zone,
  #appMain > .app-main-right > #appHeader > .header-right-zone { visibility:hidden;pointer-events:none; }
  #appMain > .app-main-right > #appHeader .header-search-popup { visibility:visible;pointer-events:auto;position:fixed;top:12px;left:18px;right:18px;width:auto;max-height:calc(100vh - 24px); }
  #detailAppHeader { display:none!important; }
  .detail-page-header { height:54px!important;padding-top:env(safe-area-inset-top,0px); }
  .detail-page-body { padding:12px 18px calc(28px + env(safe-area-inset-bottom,0px)); }
  .app-content { padding-bottom: 76px; }
  .home-feed { padding: 10px 18px 96px; }
  .bottom-tabs { align-items: flex-start; padding-top: 11px; border-radius: 18px 18px 0 0; }
  .bottom-tab { justify-content: flex-start; padding-top: 0; gap: 5px; }
  .bottom-tab:not([data-tab="home"]) i { font-size: 19px; }
  .work-tabs,.msg-sub-tabs { min-height: 48px; }
  .work-content { padding-top: 12px; }
  .work-grid-icon,.work-quick-icon { width: 46px!important;height:46px!important;border-radius:14px!important; }
  .work-grid-label,.work-quick-btn span { font-size:11px!important; }
}
.v16-project-card{background:#fff;border-radius:18px;padding:16px;margin-bottom:12px;box-shadow:var(--shadow);border:1px solid var(--border-light);cursor:pointer}

/* V16 日历：摘要周历可收起，展开后显示完整月历；内容只使用真实接口数据。 */
.v16-calendar-page{padding:14px 16px 96px;background:var(--bg-grey);min-height:100%}
.v16-calendar-card,.v16-cal-section{background:#fff;border:1px solid var(--border-light);border-radius:22px;box-shadow:var(--shadow);overflow:hidden}
.v16-calendar-head{display:flex;align-items:center;justify-content:space-between;padding:18px 18px 12px}
.v16-calendar-head>div:first-child{display:flex;align-items:baseline;gap:9px}.v16-calendar-head b{font-size:20px;letter-spacing:-.4px}.v16-calendar-head small{font-size:11px;color:var(--text-hint)}
.v16-calendar-head>div:last-child{display:flex;align-items:center;gap:6px}.v16-calendar-head button{border:0;background:transparent;color:var(--primary);font-size:13px;padding:7px 9px;cursor:pointer}.v16-calendar-head .expand{width:34px;height:34px;border-radius:12px;background:var(--primary-light)}
.v16-cal-week{display:grid;grid-template-columns:repeat(7,1fr);gap:3px;padding:4px 12px 16px}.v16-cal-week button{border:0;background:transparent;border-radius:15px;padding:8px 2px;display:flex;flex-direction:column;align-items:center;gap:7px;color:var(--text-secondary);cursor:pointer}.v16-cal-week small{font-size:11px}.v16-cal-week b{font-size:17px}.v16-cal-week i{width:5px;height:5px;border-radius:50%;background:var(--primary)}.v16-cal-week i.none{visibility:hidden}.v16-cal-week button.selected{background:var(--primary);color:#fff}.v16-cal-week button.selected i{background:#fff}
.v16-cal-nav{display:flex;align-items:center;justify-content:space-between;padding:0 14px 8px;color:var(--text-secondary);font-size:12px}.v16-cal-nav button{border:0;background:var(--bg-grey);width:30px;height:30px;border-radius:10px;color:var(--text-secondary)}
.v16-cal-weekdays,.v16-cal-month{display:grid;grid-template-columns:repeat(7,1fr);padding:0 12px}.v16-cal-weekdays span{text-align:center;color:var(--text-hint);font-size:11px;padding:7px 0}.v16-cal-month{gap:3px;padding-bottom:16px}.v16-cal-day{aspect-ratio:1;border:0;background:transparent;border-radius:13px;position:relative;color:var(--text);cursor:pointer}.v16-cal-day.empty{cursor:default}.v16-cal-day.today span{color:var(--primary);font-weight:700}.v16-cal-day.selected{background:var(--primary);color:#fff}.v16-cal-day.selected span{color:#fff}.v16-cal-day i{position:absolute;right:3px;bottom:3px;min-width:14px;height:14px;border-radius:7px;padding:0 3px;background:#e06a86;color:#fff;font-size:8px;line-height:14px;font-style:normal}
.v16-cal-state{margin:12px 0;padding:13px;text-align:center;color:var(--text-hint);font-size:12px}.v16-cal-state.error{color:var(--danger)}.v16-cal-state button{border:0;background:transparent;color:var(--primary);margin-left:8px}
.v16-cal-section{margin-top:16px}.v16-cal-section-title{display:flex;align-items:center;justify-content:space-between;padding:17px 18px 10px}.v16-cal-section-title b{font-size:17px}.v16-cal-section-title span{font-size:11px;color:var(--text-hint)}.v16-cal-list{padding:0 14px 10px}.v16-cal-event{width:100%;border:0;background:transparent;display:flex;align-items:center;gap:11px;text-align:left;padding:12px 4px;border-top:1px solid var(--border-light);cursor:pointer}.v16-cal-event>i{width:4px;height:38px;border-radius:3px;flex:0 0 auto}.v16-cal-event>span{display:flex;flex:1;min-width:0;flex-direction:column;gap:4px}.v16-cal-event b{font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.v16-cal-event small{font-size:11px;color:var(--text-hint)}.v16-cal-event em{font-size:11px;color:#c4cad6}.v16-cal-empty{padding:22px 8px 25px;text-align:center;color:var(--text-hint);font-size:12px;border-top:1px solid var(--border-light)}

@media (min-width: 1024px) {
  .bottom-tabs { width: 232px !important; padding: 12px !important; }
  .bottom-tab { margin: 3px 0 !important; border-radius: 12px !important; }
  .bottom-tab.active { background: var(--primary-light) !important; }
  .sidebar-user { border-top-color: var(--border-light) !important; border-radius: 14px; margin: auto 4px 4px !important; background: #f8f9fd; }
  .tab-page.active { max-width: 1120px; width: 100%; }
  .home-feed { max-width: 920px; }
  .detail-page { left: 232px !important; width: calc(100% - 232px) !important; }
}
