/* ============================================================================
   CISCO UNIFIED STYLESHEET — 2026 Digital Identity Version
   ============================================================================
   Theme:      Cisco Official 2026 (Refined Contrast & Accessibility)
   Responsive: Mobile First -> Tablet -> Desktop
   Print:      Optimized for technical whitepapers
   ============================================================================ */

/* ============================================================================
   §1  CSS CUSTOM PROPERTIES (更新至 2026 配色标准)
   ============================================================================ */
:root {
  /* Brand & Status Colors - 2026 Updated Palette (基于官方与 Partner 门户) */
  --cisco-blue:          #049FD9; /* Cisco 官方核心品牌蓝 */
  --cisco-blue-dark:     #005073; /* 沉稳的导航与交互蓝 (Indigo Blue) */
  --cisco-navy:          #0D274D; /* 深邃午夜蓝 (Midnight)，替代纯黑 */
  --cisco-accent:        #00BCEB; /* 思科亮蓝 (Cerulean)，作为点缀/高亮色 */
  --color-success:       #67B346; /* Cisco Partner 特有的 Miles Green */
  
  /* 追加的新品牌色彩 (Necessary Supplements 状态色补充) */
  --cisco-purple:        #9232AC; /* 官方紫，常用于高级产品线 */
  --cisco-orange:        #F58025; /* 官方橙 */
  --cisco-red:           #E2231A; /* 官方红/危险操作 */
  --color-warning:       #FBAB18; /* 合作伙伴体系常用预警橙 */
  
  /* Text & Background - 增强易读性 (Slate 灰度体系) */
  --text-primary:        #1A1A1A; /* 接近黑色但更加柔和 */
  --text-secondary:      #58585B; /* 官方次级文本灰 (Slate) */
  --text-muted:          #9B9CA0; /* 辅助性灰度 (Medium Gray) */
  --bg-white:            #FFFFFF;
  --bg-light:            #F7F8FA; /* Cisco Gray 50: 偏冷色调的极浅灰 */
  --bg-soft:             #EEF0F3; /* Cisco Gray 100: 面板与引用底色 */
  
  /* Borders & Shadows - 2026 软化视觉感 */
  --border-color:        #D4D8DE; /* Cisco Gray 200 */
  --border-radius-sm:    6px;     /* Cisco 趋向于更简洁的微圆角 */
  --border-radius-md:    12px;    /* 更新为12px，使卡片边缘更具现代感 */
  --shadow-sm:           0 2px 8px rgba(13, 39, 77, 0.04);
  --shadow-md:           0 8px 24px rgba(13, 39, 77, 0.08);
  --shadow-hover:        0 12px 32px rgba(4, 159, 217, 0.15); /* 补充: 悬停光晕 */

  /* Typography - 品牌字体规范 */
  --font-sans:           "CiscoSans", "Cisco Sans", system-ui, -apple-system, sans-serif;
  --font-mono:           "CiscoSansMono", "SF Mono", Consolas, monospace;
  --line-height-base:    1.65;
  
  /* Spacing */
  --space-2: 0.5rem;   --space-4: 1rem;     --space-6: 1.5rem; 
  --space-8: 2rem;     --space-12: 3rem;
  
  /* Layout */
  --container-max:       1200px;
  --transition-fast:     200ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================================================
   §2  RESET & BASE
   ============================================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  line-height: var(--line-height-base);
  color: var(--text-primary);
  background-color: var(--bg-white);
  -webkit-font-smoothing: antialiased;
}

:focus-visible { outline: 3px solid var(--cisco-accent); outline-offset: 2px; }

img, svg { display: block; max-width: 100%; height: auto; }

/* ============================================================================
   §3  TYPOGRAPHY
   ============================================================================ */
h1, h2, h3, h4 { color: var(--cisco-navy); font-weight: 700; line-height: 1.25; margin-bottom: var(--space-4); }

h1 { font-size: 2.75rem; letter-spacing: -0.02em; margin-bottom: var(--space-8); }
h2 { 
  font-size: 2rem; 
  margin-bottom: var(--space-6); 
  padding-bottom: var(--space-2); 
  border-bottom: 4px solid var(--cisco-accent); /* 标志性的桥梁线条色 */
  display: inline-block; 
}
h3 { font-size: 1.5rem; color: var(--cisco-blue); margin-bottom: var(--space-4); padding-bottom: var(--space-2); }
h4 { font-size: 1.25rem; color: var(--cisco-navy); margin-bottom: var(--space-4); padding-bottom: var(--space-2);}

p { margin-bottom: var(--space-4); }

a { color: var(--cisco-blue); text-decoration: none; transition: all var(--transition-fast); border-bottom: 1px solid transparent; }
a:hover { color: var(--cisco-blue-dark); border-bottom-color: var(--cisco-blue-dark); }

code {
  font-family: var(--font-mono); font-size: 0.9em;
  background-color: var(--bg-soft); color: var(--cisco-blue-dark);
  padding: 0.2em 0.4em; border-radius: var(--border-radius-sm);
}

blockquote {
  border-left: 5px solid var(--cisco-blue);
  background-color: var(--bg-light);
  padding: var(--space-4) var(--space-8);
  margin: var(--space-8) 0;
  color: var(--text-secondary);
  font-style: normal; /* 2026 现代排版趋向于非斜体引用 */
}

/* ============================================================================
   §4  LAYOUT & GRIDS
   ============================================================================ */
.container {
  width: 100%; max-width: var(--container-max);
  margin: 0 auto; padding: 0 var(--space-6);
}

.chapter { padding: var(--space-12) 0; }
.chapter:nth-child(even) { background-color: var(--bg-light); }

.grid { display: grid; gap: var(--space-6); }

.grid > * {
  min-width: 0;
}

@media (min-width: 768px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
}

/* ============================================================================
   §5  CORE COMPONENTS (Hero, Cards, Buttons, Callouts)
   ============================================================================ */
.hero {
  /* 使用 2026 渐变规范：由深海蓝向品牌蓝过渡 */
  background: linear-gradient(135deg, var(--cisco-navy) 0%, var(--cisco-blue) 100%);
  color: var(--bg-white); padding: var(--space-12) 0; text-align: center;
}
.hero h1 { color: var(--bg-white); border: none; margin-bottom: var(--space-4); }

.card {
  background: var(--bg-white); border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md); padding: var(--space-6);
  box-shadow: var(--shadow-sm); transition: all var(--transition-fast);
}
.card:hover { transform: translateY(-5px); box-shadow: var(--shadow-hover); border-color: var(--cisco-accent); }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: var(--space-4) var(--space-8); font-weight: 600;
  background-color: var(--cisco-blue); color: var(--bg-white);
  border-radius: 50px; /* 2026 全圆角按钮更具交互感 */
  transition: all var(--transition-fast);
  border: none; cursor: pointer;
}
.btn:hover { background-color: var(--cisco-blue-dark); transform: scale(1.02); color: var(--bg-white); }

.callout {
  padding: var(--space-6); margin: var(--space-8) 0;
  border-left: 6px solid var(--cisco-accent); background-color: var(--bg-soft);
  border-radius: 0 var(--border-radius-sm) var(--border-radius-sm) 0;
}

/* ============================================================================
   §6  DATA DISPLAY (Tables, SVGs, Code Blocks)
   ============================================================================ */
.svg-scroll-wrapper, .table-scroll-wrapper {
  width: 100%; overflow-x: auto; margin: var(--space-6) 0;
  border: 1px solid var(--border-color); border-radius: var(--border-radius-sm);
}

table { width: 100%; border-collapse: collapse; min-width: 600px; }
thead { background: var(--cisco-navy); color: var(--bg-white); }
th, td { padding: var(--space-4); text-align: left; border-bottom: 1px solid var(--border-color); }
tbody tr:nth-child(even) { background-color: var(--bg-light); }
tbody tr:hover { background-color: var(--bg-soft); }

pre {
  background: var(--cisco-navy); color: var(--bg-white); padding: var(--space-6);
  border-radius: var(--border-radius-md); overflow-x: auto;
  font-family: var(--font-mono); margin: var(--space-8) 0;
  border: 1px solid var(--text-secondary);
}
pre code { background: none; color: inherit; padding: 0; }

/* ============================================================================
   §7  RESPONSIVE (Mobile specific tweaks)
   ============================================================================ */
@media (max-width: 768px) {
  .container { padding: 0 var(--space-4); }
  h1 { font-size: 2.25rem; }
  h2 { font-size: 1.75rem; }
  .chapter { padding: var(--space-8) 0; }
  .btn { width: 100%; } /* 移动端按钮全宽便于点击 */
}

/* ===== §8  PRINT STYLES ===== */
@media print{

  /* ---------- base ---------- */
  body{font-size:10pt;color:#000;background:#fff!important;}
  .chapter{padding:10pt 0;background:transparent!important;}

  @page {
    margin: 2cm;
    @bottom-center {
      content: "Page " counter(page) " of " counter(pages);
      font-size: 9pt;
      color: #58585B;
      font-family: "CiscoSans", sans-serif;
    }
  /* ---------- page breaks ---------- */
  h2{page-break-before:always;break-before:page;}
  .chapter:first-of-type h2{page-break-before:avoid;break-before:avoid;}

  /* tables / cards still avoid internal splits */
  table,pre,.card{page-break-inside:avoid;break-inside:avoid;}

  /* FIX-A ① : .svg-scroll-wrapper —
     Remove break-inside:avoid so large SVGs can span pages
     instead of pushing to a new page and leaving a blank one.
     Also force overflow visible so nothing is clipped. */
  .svg-scroll-wrapper{
    break-inside:auto!important;
    page-break-inside:auto!important;
    overflow:visible!important;
    border:none!important;          /* hide the visible border on the "blank" page */
    max-height:none!important;
  }

  /* Let large SVGs shrink to fit the page width */
  .svg-scroll-wrapper svg{
    width:100%!important;
    height:auto!important;
    max-width:100%!important;
  }

  /* FIX-B : #closing section — dark-bg text invisible when printed
     Override inline color:#fff and gradient background so text is readable */
  #closing,
  #closing *{
    background:transparent!important;
    color:#000!important;
  }
  #closing h2{
    border-bottom-color:#049fd9!important;   /* keep a Cisco-blue accent line */
  }
}
}