/* ABOUTME: 履职清单页面样式 */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --red-primary: #C41E24;
  --red-dark: #9E1820;
  --red-light: #E8434A;
  --gold: #D4A843;
  --gold-light: #E8C96A;
  --bg-warm: #F5E6D3;
  --bg-warm-deep: #E8D5B7;
  --text-dark: #1A1A1A;
  --text-muted: #6B5C50;
  --text-light: #FFFFFF;
  --card-bg: rgba(255, 255, 255, 0.85);
  --shadow-card: 0 2px 12px rgba(166, 126, 82, 0.1);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB',
    'Microsoft YaHei', 'Helvetica Neue', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  background: linear-gradient(180deg, var(--bg-warm) 0%, var(--bg-warm-deep) 100%);
  color: var(--text-dark);
  min-height: 100vh;
}

#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
}

/* ========== 顶部导航 ========== */
.nav-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: linear-gradient(135deg, var(--red-dark) 0%, var(--red-primary) 50%, var(--red-light) 100%);
  color: var(--text-light);
}

.nav-back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  color: white;
  text-decoration: none;
  border-radius: 50%;
  transition: background 0.2s;
}

.nav-back:active {
  background: rgba(255,255,255,0.15);
}

.nav-title {
  font-family: 'Noto Serif SC', serif;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.nav-spacer {
  width: 36px;
}

/* ========== 搜索栏 ========== */
.search-bar {
  position: sticky;
  top: 52px;
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  background: rgba(245, 230, 211, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(212, 168, 67, 0.15);
}

.search-icon {
  flex-shrink: 0;
}

.search-input {
  flex: 1;
  border: none;
  outline: none;
  background: rgba(255,255,255,0.7);
  border-radius: 20px;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  color: var(--text-dark);
}

.search-input::placeholder {
  color: #bba890;
}

.search-clear {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}

/* ========== 缩放控制 ========== */
.zoom-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
}

.zoom-label {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.zoom-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 28px;
  border: 1px solid rgba(212, 168, 67, 0.3);
  border-radius: 6px;
  background: rgba(255,255,255,0.6);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-dark);
  cursor: pointer;
  transition: all 0.2s;
}

.zoom-btn:active {
  background: rgba(196, 30, 36, 0.08);
  border-color: var(--red-primary);
}

.zoom-value {
  font-size: 0.72rem;
  color: var(--text-muted);
  min-width: 36px;
  text-align: center;
}

/* ========== 统计概览 ========== */
.summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 1rem 0.6rem;
}

.summary {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.tab-btn-all {
  padding: 0.3rem 0.75rem;
  border: 1px solid rgba(196, 30, 36, 0.2);
  border-radius: 16px;
  background: rgba(255,255,255,0.6);
  font-size: 0.75rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.tab-btn-all.active {
  background: var(--red-primary);
  color: white;
  border-color: var(--red-primary);
}

.summary-num {
  color: var(--red-primary);
  font-weight: 700;
}

/* ========== 分类标签 ========== */
.category-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.375rem;
  padding: 0 1rem 0.75rem;
}

.tab-btn {
  padding: 0.35rem 0.25rem;
  border: 1px solid rgba(196, 30, 36, 0.2);
  border-radius: 16px;
  background: rgba(255,255,255,0.6);
  font-size: 0.72rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  line-height: 1.3;
  min-height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tab-btn.active {
  background: var(--red-primary);
  color: white;
  border-color: var(--red-primary);
}

.tab-btn:active {
  transform: scale(0.95);
}

/* ========== 内容区域 ========== */
.content {
  padding: 0 0.875rem 2rem;
  font-size: 100%;
  transition: font-size 0.2s;
}

.cat-section {
  margin-bottom: 0.75rem;
}

.cat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0.875rem;
  background: var(--card-bg, rgba(255,255,255,0.85));
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  user-select: none;
  backdrop-filter: blur(10px);
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  transition: box-shadow 0.2s;
}

.cat-header:active { box-shadow: 0 1px 4px rgba(0,0,0,0.06); }

.cat-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cat-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  background: var(--red-primary);
  border-radius: 11px;
  font-size: 0.7rem;
  font-weight: 700;
  color: white;
}

.cat-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-dark, #1A1A1A);
  letter-spacing: 0.05em;
}

.cat-arrow {
  color: #999;
  transition: transform 0.3s;
}

.cat-body {
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.cat-body.collapsed {
  max-height: 0 !important;
}

/* ========== 事项卡片 ========== */
.item-card {
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  margin: 0.5rem;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(212, 168, 67, 0.08);
  overflow: hidden;
}

.item-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 0.875rem;
  background: linear-gradient(135deg, rgba(196, 30, 36, 0.04) 0%, rgba(212, 168, 67, 0.06) 100%);
  border-bottom: 1px solid rgba(212, 168, 67, 0.08);
}

.item-seq {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 22px;
  padding: 0 6px;
  background: var(--red-primary);
  border-radius: 11px;
  font-size: 0.65rem;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.item-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1.4;
}

.item-body {
  padding: 0.625rem 0.875rem 0.75rem;
}

.item-links {
  display: flex;
  gap: 8px;
  margin-top: 0.625rem;
  padding-top: 0.625rem;
  border-top: 1px solid #f0ebe5;
}

.item-link {
  flex: 1;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 6px;
  transition: all 0.2s;
  letter-spacing: 0.03em;
}

.item-link:active {
  transform: scale(0.96);
}

.item-link:nth-child(1) {
  color: #C41E24;
  background: rgba(196,30,36,0.06);
  border: 1px solid rgba(196,30,36,0.2);
}

.item-link:nth-child(2) {
  color: #D4A843;
  background: rgba(212,168,67,0.08);
  border: 1px solid rgba(212,168,67,0.25);
}

.item-link:nth-child(3) {
  color: #2D7DD2;
  background: rgba(45,125,210,0.06);
  border: 1px solid rgba(45,125,210,0.2);
}

.item-field {
  margin-bottom: 0.625rem;
}

.item-field:last-child {
  margin-bottom: 0;
}

.field-label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.field-label svg {
  flex-shrink: 0;
}

.label-highlight {
  color: var(--red-primary);
}

.field-value {
  font-size: 0.82rem;
  line-height: 1.7;
  color: var(--text-dark);
  padding-left: 0.25rem;
}

.value-highlight {
  background: rgba(196, 30, 36, 0.03);
  border-left: 3px solid var(--red-primary);
  padding: 0.375rem 0.5rem;
  border-radius: 0 6px 6px 0;
}

.duty-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  background: rgba(196, 30, 36, 0.08);
  border-radius: 9px;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--red-primary);
  margin-right: 2px;
  padding: 0 4px;
}

.basis-text {
  font-size: 0.75rem;
  color: #666;
  line-height: 1.6;
  padding: 0.375rem 0.5rem;
  background: rgba(212, 168, 67, 0.05);
  border-left: 3px solid var(--gold);
  border-radius: 0 6px 6px 0;
}

.dept-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.dept-tag {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  background: rgba(212, 168, 67, 0.1);
  border: 1px solid rgba(212, 168, 67, 0.2);
  border-radius: 4px;
  font-size: 0.75rem;
  color: #7A6840;
  white-space: nowrap;
}

/* ========== 空状态 ========== */
.empty {
  text-align: center;
  padding: 3rem 1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ========== 返回顶部 ========== */
.back-top {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--red-primary);
  color: white;
  border: none;
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(196, 30, 36, 0.3);
  cursor: pointer;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s, transform 0.3s;
  z-index: 50;
}

.back-top.show {
  opacity: 1;
  transform: translateY(0);
}

.back-top:active {
  transform: scale(0.9);
}

/* ========== 响应式 ========== */
@media (min-width: 480px) {
  #app {
    box-shadow: 0 0 40px rgba(0,0,0,0.06);
  }
}
