/* =========================================================
   微办公系统 · WPS 风格
   保持全部 class 名不变，仅重塑视觉，功能逻辑不受影响
   ========================================================= */

/* ---- 基础 ---- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Source Han Sans SC", -apple-system, sans-serif;
  background: #eef1f6;
  color: #1f2329;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: #3370ff; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }

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

/* =========================================================
   顶部导航 —— WPS 菜单条风格
   ========================================================= */
.topbar {
  background: #ffffff;
  border-bottom: 1px solid #e2e6ee;
  padding: 0;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 1px 4px rgba(31, 35, 41, 0.06);
}
.topbar .container { display: flex; align-items: center; gap: 22px; height: 56px; }

/* 品牌：WPS 式红蓝绿三色拼花 + 渐变字 */
.brand {
  display: flex; align-items: center; gap: 10px;
  font-size: 18px; font-weight: 700;
  letter-spacing: 0.5px;
  color: #2b3a55;
  white-space: nowrap;
}
.brand-logo {
  width: 30px; height: 30px; border-radius: 8px; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #3370ff 0%, #1d8cf8 55%, #29c3f2 100%);
  box-shadow: 0 2px 6px rgba(51, 112, 255, 0.35);
}
.brand-logo svg { width: 18px; height: 18px; display: block; }
.brand small { color: #8a94a6; font-weight: 400; font-size: 12px; margin-left: 6px; letter-spacing: 0; }

.topbar nav { flex: 1; display: flex; gap: 4px; height: 100%; align-items: stretch; }
.topbar nav a {
  display: inline-flex; align-items: center;
  padding: 0 16px; border-radius: 6px 6px 0 0;
  color: #566070; font-size: 14.5px; font-weight: 500;
  position: relative; transition: color .15s, background .15s;
}
.topbar nav a:hover { color: #3370ff; background: #f2f6ff; }
.topbar nav a.active { color: #3370ff; font-weight: 600; }
.topbar nav a.active::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 0; height: 3px;
  background: #3370ff; border-radius: 3px 3px 0 0;
}

.userinfo { display: flex; align-items: center; gap: 12px; font-size: 13.5px; color: #566070; }
.userinfo .avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, #3370ff, #29c3f2);
  color: #fff; font-size: 13px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center;
}
.userinfo button {
  border: 1px solid #e0e4ec; background: #fff; color: #6b7488;
  font-size: 12.5px; border-radius: 6px; padding: 5px 12px;
  transition: all .15s;
}
.userinfo button:hover { border-color: #f53f3f; color: #f53f3f; }

/* =========================================================
   页面容器
   ========================================================= */
.page { padding: 22px 0 70px; }

/* 模块视图切换：默认隐藏，仅 active 显示 */
.section { display: none; }
.section.active { display: block; }

/* ---- 卡片 ---- */
.card {
  background: #fff;
  border: 1px solid #e7eaf1;
  border-radius: 10px;
  padding: 20px 22px;
  margin-bottom: 18px;
  box-shadow: 0 1px 3px rgba(31, 35, 41, 0.05);
}
.card h2 {
  font-size: 16.5px; margin-bottom: 16px; color: #2b3a55;
  display: flex; align-items: center; gap: 8px; font-weight: 600;
}
.card h2::before { content: ""; width: 4px; height: 16px; border-radius: 2px; background: linear-gradient(180deg,#3370ff,#29c3f2); }
.card h3 { font-size: 14.5px; margin-bottom: 12px; color: #3a475c; font-weight: 600; }

/* =========================================================
   按钮 —— WPS 蓝色主按钮
   ========================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: none; border-radius: 6px;
  padding: 8px 18px; font-size: 14px; font-weight: 500;
  background: linear-gradient(180deg, #3d80ff, #2f6fe8);
  color: #fff;
  box-shadow: 0 1px 2px rgba(51, 112, 255, 0.3);
  transition: all .15s;
}
.btn:hover { background: linear-gradient(180deg, #2f72f0, #2563e0); box-shadow: 0 2px 6px rgba(51,112,255,.35); }
.btn:active { transform: translateY(1px); }
.btn-secondary {
  background: #fff; color: #566070;
  border: 1px solid #d8dde8; box-shadow: none;
}
.btn-secondary:hover { border-color: #3370ff; color: #3370ff; background: #f5f8ff; box-shadow: none; }
.btn-danger { background: linear-gradient(180deg, #ff5a57, #f53f3f); box-shadow: 0 1px 2px rgba(245,63,63,.3); }
.btn-danger:hover { background: linear-gradient(180deg, #ef4b48, #e23a3a); }
.btn-small { padding: 5px 12px; font-size: 12.5px; border-radius: 5px; }

/* =========================================================
   表单
   ========================================================= */
input[type=text], input[type=password], textarea, select {
  width: 100%;
  border: 1px solid #d8dde8; border-radius: 6px;
  padding: 8px 12px; font-size: 14px;
  margin: 4px 0 12px; background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
input[type=text]:focus, input[type=password]:focus, textarea:focus, select:focus {
  outline: none; border-color: #3370ff;
  box-shadow: 0 0 0 3px rgba(51, 112, 255, 0.12);
}
label { font-size: 13px; color: #566070; }

/* =========================================================
   表格
   ========================================================= */
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid #edf0f5; }
th { background: #f7f9fc; font-weight: 600; color: #566070; white-space: nowrap; }
tr:hover td { background: #f6f9ff; }

/* ---- 状态标签 ---- */
.tag { display: inline-block; padding: 2px 10px; border-radius: 10px; font-size: 12px; font-weight: 500; }
.tag-green { background: #e6f9ee; color: #18a058; }
.tag-red { background: #fdecec; color: #f53f3f; }
.tag-gray { background: #eef1f5; color: #566070; }
.tag-blue { background: #eaf2ff; color: #3370ff; }

.empty { text-align: center; color: #9aa3b2; padding: 36px; font-size: 14px; }

/* ---- 消息 ---- */
.msg {
  padding: 10px 16px; border-radius: 6px; margin-bottom: 14px;
  font-size: 13.5px; display: none; border: 1px solid transparent;
}
.msg.ok { background: #e6f9ee; color: #18a058; border-color: #c9f2da; }
.msg.err { background: #fdecec; color: #f53f3f; border-color: #fbd8d8; }
.msg.show { display: block; }

/* =========================================================
   登录页 —— WPS 渐变背景卡片
   ========================================================= */
.login-wrap {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #e8f0ff 0%, #f0f6ff 45%, #e9f4fb 100%);
  position: relative; overflow: hidden;
}
.login-wrap::before, .login-wrap::after {
  content: ""; position: absolute; border-radius: 50%; filter: blur(70px); opacity: .5;
}
.login-wrap::before { width: 320px; height: 320px; background: #bcd4ff; top: -80px; left: -80px; }
.login-wrap::after { width: 380px; height: 380px; background: #bfe9ff; bottom: -120px; right: -80px; }
.login-box {
  background: #fff; border-radius: 16px;
  padding: 42px 40px; width: 380px;
  box-shadow: 0 12px 40px rgba(43, 58, 85, 0.14);
  position: relative; z-index: 1;
}
.login-brand { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 4px; }
.login-box h1 { font-size: 24px; margin-bottom: 8px; text-align: center; color: #2b3a55; font-weight: 700; }
.login-box .sub { text-align: center; color: #8a94a6; font-size: 13px; margin-bottom: 28px; }
.login-box .btn { width: 100%; margin-top: 6px; padding: 11px; font-size: 15px; border-radius: 8px; }
.login-links { text-align: center; font-size: 13px; margin-top: 18px; color: #8a94a6; }

/* =========================================================
   网格
   ========================================================= */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 800px){ .grid2 { grid-template-columns: 1fr; } }

/* =========================================================
   电子表格编辑器
   ========================================================= */
.sheet-toolbar {
  display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; align-items: center;
  padding: 10px 12px; background: #f7f9fc; border: 1px solid #e7eaf1; border-radius: 8px;
}
.sheet-wrap { overflow: auto; border: 1px solid #d8dde8; border-radius: 8px; max-height: 520px; background: #fff; }
.sheet-grid { border-collapse: collapse; min-width: 100%; }
.sheet-grid td { border: 1px solid #e7eaf1; min-width: 90px; height: 32px; padding: 4px 6px; font-size: 13px; position: relative; }
.sheet-grid td input { border: none; width: 100%; font-size: 13px; padding: 2px; background: transparent; }
.sheet-grid td input:focus { outline: 2px solid #3370ff; background: #fff; }
.sheet-grid .rowhead { background: #f4f6fa; font-weight: 600; text-align: center; min-width: 40px; color: #566070; }
.sheet-grid .colhead { background: #f4f6fa; font-weight: 600; text-align: center; color: #566070; }
.sheet-grid .sel { background: #eaf2ff; }

/* =========================================================
   PDF 阅读器
   ========================================================= */
.pdf-toolbar { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.pdf-frame { width: 100%; height: 76vh; border: 1px solid #d8dde8; border-radius: 8px; background: #525659; }

/* =========================================================
   问卷编辑
   ========================================================= */
.q-item { border: 1px solid #e7eaf1; border-radius: 8px; padding: 14px 16px; margin-bottom: 12px; background: #fafbfd; }
.q-item:hover { border-color: #c9d8f5; }
.q-head { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
.q-head input { margin: 0; flex: 1; min-width: 160px; }
.q-opts { margin: 8px 0 6px 20px; }
.q-opts .opt-row { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.q-opts .opt-row input { margin: 0; width: auto; flex: 1; }
.q-type { width: 110px; flex: 0 0 auto; }

/* =========================================================
   对外问卷（公开页）
   ========================================================= */
.public-topbar {
  background: #fff; border-bottom: 1px solid #e2e6ee;
  box-shadow: 0 1px 4px rgba(31,35,41,.06);
}
.survey-list { margin-top: 26px; }
.survey-item {
  display: flex; align-items: center; justify-content: space-between;
  background: #fff; border: 1px solid #e7eaf1; border-radius: 10px;
  padding: 18px 22px; margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(31,35,41,.05);
  transition: box-shadow .15s, transform .15s;
}
.survey-item:hover { box-shadow: 0 4px 12px rgba(31,35,41,.1); transform: translateY(-1px); }
.survey-item .st { font-size: 15.5px; font-weight: 600; color: #2b3a55; }
.survey-item .sd { font-size: 13px; color: #8a94a6; margin-top: 4px; }

/* ---- 填写问卷 ---- */
.form-q { margin-bottom: 20px; padding-bottom: 18px; border-bottom: 1px solid #edf0f5; }
.form-q .t { font-size: 15.5px; margin-bottom: 10px; font-weight: 600; color: #2b3a55; }
.form-q .t .req { color: #f53f3f; }
.form-q label.opt { display: flex; align-items: center; gap: 8px; margin: 6px 0; font-size: 14px; color: #333; cursor: pointer; }
.form-q input[type=text] { width: 100%; }

/* ---- 文档只读 ---- */
.doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.doc-card {
  background: #fff; border: 1px solid #e7eaf1; border-radius: 10px;
  padding: 16px 18px; box-shadow: 0 1px 3px rgba(31,35,41,.05);
  transition: box-shadow .15s, transform .15s;
}
.doc-card:hover { box-shadow: 0 4px 12px rgba(31,35,41,.1); transform: translateY(-2px); }
.doc-card .dt { font-weight: 600; color: #2b3a55; margin-bottom: 6px; }
.doc-card .dm { font-size: 12.5px; color: #8a94a6; margin-bottom: 12px; }

/* =========================================================
   上传提示等小元素
   ========================================================= */
#uploadHint, #sheetStatus { font-size: 12.5px; color: #8a94a6; }

/* =========================================================
   移动端适配（手机优先体验）
   ========================================================= */
@media (max-width: 720px) {

  /* 容器留白收窄 */
  .container { padding: 0 12px; }

  /* 顶部导航：整体可横向滚动，避免挤压换行 */
  .topbar .container {
    gap: 8px; height: auto; min-height: 48px;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
  }
  .brand { font-size: 16px; flex: 0 0 auto; gap: 8px; }
  .brand-logo { width: 26px; height: 26px; }
  .brand small { display: none; }
  .topbar nav { flex: 0 0 auto; height: 48px; gap: 2px; }
  .topbar nav a { padding: 0 12px; font-size: 13.5px; white-space: nowrap; }
  .topbar nav a.active::after { left: 8px; right: 8px; }
  .userinfo { flex: 0 0 auto; gap: 6px; }
  .userinfo .avatar { width: 26px; height: 26px; font-size: 12px; }
  .userinfo button { padding: 4px 10px; font-size: 12px; }

  /* 卡片与页面 */
  .page { padding: 14px 0 50px; }
  .card { padding: 16px; border-radius: 8px; margin-bottom: 14px; }
  .card h2 { font-size: 15.5px; }

  /* 表格：横向滚动，绝不压缩列宽，操作按钮保持单行 */
  table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; }
  th, td { padding: 8px 10px; font-size: 13px; }
  tr:hover td { background: #f6f9ff; }
  /* 表格里的行内按钮改为紧凑并强制单行 */
  td .btn-small { white-space: nowrap; }
  td a.btn-small { margin-right: 2px; }

  /* 表单输入更舒适 */
  input[type=text], input[type=password], textarea, select { font-size: 16px; padding: 9px 12px; }

  /* 按钮间距 */
  .btn { padding: 9px 14px; font-size: 13.5px; }
  .btn-small { padding: 5px 10px; font-size: 12px; }

  /* 文档上传区：按钮整行排布 */
  .card h2 + div { flex-wrap: wrap; }

  /* 登录页 */
  .login-box { width: 92%; max-width: 380px; padding: 32px 26px; }
  .login-box h1 { font-size: 21px; }
  .login-box .sub { font-size: 12.5px; margin-bottom: 20px; }

  /* 问卷编辑：选项更宽松 */
  .q-opts { margin-left: 8px; }
  .q-head input { min-width: 120px; }

  /* 公开问卷列表 */
  .survey-item { padding: 14px 16px; }
  .survey-item .st { font-size: 14.5px; }

  /* 对外文档卡片单列 */
  .doc-grid { grid-template-columns: 1fr; gap: 12px; }

  /* 电子表格工具栏换行 */
  .sheet-toolbar { padding: 8px 10px; }
}

/* =========================================================
   新增模块样式：公告 / 待办 / 审批 / 日历 / 统计 / 工作表
   ========================================================= */

/* 公告 */
.notice-item {
  border: 1px solid #e7eaf1; border-radius: 8px;
  padding: 14px 16px; margin-bottom: 12px; background: #fafbfd;
}
.notice-item:hover { border-color: #c9d8f5; }
.notice-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.notice-title { font-weight: 600; color: #2b3a55; font-size: 15px; }
.notice-body { color: #566070; font-size: 14px; line-height: 1.7; white-space: pre-wrap; }

/* 待办 */
.todo-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 12px; border-bottom: 1px solid #edf0f5;
}
.todo-item:last-child { border-bottom: none; }
.todo-item input[type=checkbox] { width: auto; margin: 0; flex: 0 0 auto; }
.todo-text { flex: 1; font-size: 14px; }
.todo-item.done .todo-text { color: #9aa3b2; text-decoration: line-through; }
.todo-due { font-size: 12px; color: #8a94a6; }

/* 审批 */
#section-approve table td { vertical-align: top; }

/* 日历 */
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.cal-day { border: 1px solid #e7eaf1; border-radius: 8px; padding: 8px; min-height: 90px; background: #fff; }
.cal-day.today { border-color: #3370ff; background: #f2f6ff; }
.cal-head { font-weight: 600; font-size: 13px; color: #566070; margin-bottom: 6px; }
.cal-day.today .cal-head { color: #3370ff; }
.cal-empty { color: #ccd2dc; font-size: 12px; text-align: center; padding: 10px 0; }
.cal-event {
  background: #eaf2ff; color: #3370ff; font-size: 12px;
  border-radius: 5px; padding: 4px 6px; margin-bottom: 4px; line-height: 1.4;
}
.cal-time { font-weight: 600; margin-right: 4px; }
.cal-event .btn-small { padding: 1px 6px; font-size: 10px; }

/* 问卷统计 */
.stats-row { margin-bottom: 12px; }
.stats-label { font-size: 13.5px; color: #3a475c; margin-bottom: 4px; }
.stats-bar {
  background: #eef1f5; border-radius: 5px; height: 16px; overflow: hidden;
}
.stats-bar-fill {
  height: 100%; border-radius: 5px;
  background: linear-gradient(90deg, #3370ff, #29c3f2);
  transition: width .3s;
}
.stats-texts { display: flex; flex-wrap: wrap; gap: 8px; }
.stats-text {
  background: #f2f6ff; border: 1px solid #dbe7ff; color: #2b3a55;
  border-radius: 6px; padding: 4px 10px; font-size: 13px;
}
#section-survey .card h4 { font-size: 14.5px; margin-bottom: 10px; color: #2b3a55; }

/* 工作表标签 */
.sheet-tabs { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; margin-bottom: 10px; }
.sheet-tab {
  padding: 5px 12px; border: 1px solid #d8dde8; border-radius: 5px;
  font-size: 12.5px; cursor: pointer; color: #566070; background: #fff;
}
.sheet-tab.active { background: #3370ff; color: #fff; border-color: #3370ff; }

/* 日历移动端：一周改滚动/堆叠 */
@media (max-width: 720px) {
  .cal-grid { grid-template-columns: 1fr; gap: 6px; }
  .notice-head { flex-direction: column; align-items: flex-start; gap: 4px; }
}



/* =========================================================
   第二批：通讯录 / 看板 / 个人中心 / 回收站
   ========================================================= */

/* 通讯录 */
.contacts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.contact-card {
  display: flex; align-items: center; gap: 12px;
  background: #fff; border: 1px solid #e7eaf1; border-radius: 10px; padding: 14px 16px;
  box-shadow: 0 1px 3px rgba(31,35,41,.04); transition: box-shadow .15s, transform .15s;
}
.contact-card:hover { box-shadow: 0 4px 12px rgba(31,35,41,.1); transform: translateY(-1px); }
.contact-av {
  width: 40px; height: 40px; border-radius: 50%; flex: 0 0 auto;
  background: linear-gradient(135deg, #3370ff, #29c3f2); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 16px;
}
.contact-info { min-width: 0; }
.contact-name { font-weight: 600; color: #2b3a55; font-size: 14.5px; margin-bottom: 4px; }
.contact-sub { font-size: 12.5px; color: #8a94a6; display: flex; flex-wrap: wrap; gap: 8px; }
.contact-sub span { white-space: nowrap; }

/* 看板 */
.board-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.board-item {
  background: #fff; border: 1px solid #e7eaf1; border-radius: 10px; padding: 16px;
  cursor: pointer; font-weight: 600; color: #2b3a55; box-shadow: 0 1px 3px rgba(31,35,41,.04);
  transition: box-shadow .15s, transform .15s;
}
.board-item:hover { box-shadow: 0 4px 12px rgba(31,35,41,.1); transform: translateY(-1px); }
.kanban { display: flex; gap: 14px; align-items: flex-start; overflow-x: auto; padding-bottom: 8px; }
.kanban-col { flex: 1; min-width: 220px; background: #f2f4f9; border-radius: 10px; padding: 10px; }
.kanban-head { font-weight: 600; color: #566070; font-size: 14px; margin-bottom: 10px; display: flex; align-items: center; gap: 6px; }
.kanban-body { min-height: 40px; }
.kanban-card {
  background: #fff; border: 1px solid #e7eaf1; border-radius: 8px; padding: 10px 12px;
  margin-bottom: 8px; box-shadow: 0 1px 2px rgba(31,35,41,.06);
}
.kcard-title { font-size: 13.5px; color: #2b3a55; font-weight: 500; }
.kcard-note { font-size: 12px; color: #8a94a6; margin-top: 4px; }
.kcard-actions { margin-top: 8px; display: flex; gap: 4px; }

/* 个人中心 */
#section-profile .card h3 { margin-top: 6px; }

/* 移动端：看板列堆叠为整行滚动 */
@media (max-width: 720px) {
  .kanban { flex-direction: column; overflow-x: hidden; }
  .kanban-col { min-width: 100%; }
  .contacts-grid { grid-template-columns: 1fr; }
  .board-list { grid-template-columns: 1fr; }
}
