/**
 * iOS极简风格样式 - NoLine主题改造版
 * 设计理念：极简、优雅、留白、圆角、毛玻璃
 */

/* ============================================
   1. CSS变量 - iOS设计系统
   ============================================ */
:root {
  /* iOS系统色 */
  --ios-blue: #007AFF;
  --ios-green: #34C759;
  --ios-indigo: #5856D6;
  --ios-orange: #FF9500;
  --ios-pink: #FF2D55;
  --ios-purple: #AF52DE;
  --ios-red: #FF3B30;
  --ios-teal: #5AC8FA;
  --ios-yellow: #FFCC00;
  
  /* iOS灰度色 */
  --ios-gray-1: #8E8E93;
  --ios-gray-2: #AEAEB2;
  --ios-gray-3: #C7C7CC;
  --ios-gray-4: #D1D1D6;
  --ios-gray-5: #E5E5EA;
  --ios-gray-6: #F2F2F7;
  
  /* 浅色模式 */
  --ios-bg-primary: #FFFFFF;
  --ios-bg-secondary: #F2F2F7;
  --ios-bg-tertiary: #FFFFFF;
  --ios-text-primary: #000000;
  --ios-text-secondary: #3C3C43;
  --ios-text-tertiary: #8E8E93;
  --ios-separator: rgba(60, 60, 67, 0.12);
  --ios-card-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
  
  /* 圆角 */
  --ios-radius-sm: 8px;
  --ios-radius-md: 12px;
  --ios-radius-lg: 16px;
  --ios-radius-xl: 20px;
  
  /* 过渡动画 */
  --ios-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  
  /* 毛玻璃 */
  --ios-blur: saturate(180%) blur(20px);
  --ios-blur-light: saturate(180%) blur(10px);
}

/* 深色模式 */
@media (prefers-color-scheme: dark) {
  :root {
    --ios-bg-primary: #000000;
    --ios-bg-secondary: #1C1C1E;
    --ios-bg-tertiary: #2C2C2E;
    --ios-text-primary: #FFFFFF;
    --ios-text-secondary: #EBEBF5;
    --ios-text-tertiary: #8E8E93;
    --ios-separator: rgba(84, 84, 88, 0.6);
    --ios-card-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
  }
}

/* 手动深色模式切换 */
[data-theme="dark"] {
  --ios-bg-primary: #000000;
  --ios-bg-secondary: #1C1C1E;
  --ios-bg-tertiary: #2C2C2E;
  --ios-text-primary: #FFFFFF;
  --ios-text-secondary: #EBEBF5;
  --ios-text-tertiary: #8E8E93;
  --ios-separator: rgba(84, 84, 88, 0.6);
  --ios-card-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

/* ============================================
   2. 全局基础样式
   ============================================ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Helvetica Neue', 'PingFang SC', 'Noto Sans SC', sans-serif;
  font-size: 17px;
  line-height: 1.5;
  color: var(--ios-text-primary);
  background: var(--ios-bg-secondary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: var(--ios-transition);
}

/* 移除原有阴影效果 */
* {
  text-shadow: none !important;
}

a {
  color: var(--ios-blue);
  text-decoration: none;
  transition: var(--ios-transition);
}

a:hover {
  opacity: 0.7;
}

/* ============================================
   3. iOS风格导航栏
   ============================================ */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: 52px;
  padding: 0 20px;
  background: var(--ios-blur);
  background-color: rgba(255, 255, 255, 0.72);
  border-bottom: 0.5px solid var(--ios-separator);
  backdrop-filter: var(--ios-blur);
  -webkit-backdrop-filter: var(--ios-blur);
  border-radius: 0 !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

[data-theme="dark"] .header {
  background-color: rgba(28, 28, 30, 0.72);
}

.header-wide {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0;
}

.header h1,
#newtitle {
  font-size: 17px;
  font-weight: 600;
  color: var(--ios-text-primary) !important;
  background: transparent !important;
  padding: 0 !important;
  margin: 0 !important;
}

#nav_menu {
  display: flex;
  align-items: center;
  gap: 24px;
  list-style: none;
  margin: 0;
  padding: 0;
}

#nav_menu li {
  position: relative;
}

#nav_menu a {
  font-size: 14px;
  font-weight: 500;
  color: var(--ios-text-primary) !important;
  padding: 8px 0;
  transition: var(--ios-transition);
}

#nav_menu a:hover {
  color: var(--ios-blue) !important;
  opacity: 1;
}

/* 分类下拉菜单 */
#classwork {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 8px;
  background: var(--ios-bg-primary);
  border-radius: var(--ios-radius-lg);
  box-shadow: var(--ios-card-shadow), 0 0 1px rgba(0, 0, 0, 0.1);
  padding: 8px;
  min-width: 150px;
  border: none;
  height: auto;
  opacity: 0;
  visibility: hidden;
  transition: var(--ios-transition);
}

#classwork.visible {
  opacity: 1;
  visibility: visible;
}

#classwork ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: block;
}

#classwork li {
  display: block;
  margin: 0;
  padding: 0;
  font-size: 14px;
}

#classwork a {
  display: block;
  padding: 10px 16px;
  color: var(--ios-text-primary) !important;
  border-radius: var(--ios-radius-sm);
  transition: var(--ios-transition);
}

#classwork a:hover {
  background: var(--ios-bg-secondary);
}

/* 汉堡菜单按钮 */
#box_hover {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  background: transparent;
  border-radius: var(--ios-radius-md);
  cursor: pointer;
  transition: var(--ios-transition);
}

#box_hover:hover {
  background: var(--ios-bg-secondary);
}

#box_hover svg {
  width: 20px;
  height: 20px;
  stroke: var(--ios-text-primary);
}

/* ============================================
   4. iOS风格内容区域
   ============================================ */
.content-all {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 72px 20px 40px;
  opacity: 1;
  visibility: visible;
}

.content {
  width: 100%;
  margin-top: 20px;
}

.content-list {
  width: 100%;
  margin: 0;
}

/* ============================================
   5. iOS风格文章卡片
   ============================================ */
.post-list {
  width: 100%;
  margin-bottom: 16px;
  break-inside: avoid;
}

.post {
  background: var(--ios-bg-primary);
  border-radius: var(--ios-radius-xl);
  padding: 20px;
  box-shadow: var(--ios-card-shadow);
  border: 0.5px solid var(--ios-separator);
  transition: var(--ios-transition);
  cursor: pointer;
}

.post:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.12);
}

/* 文章头部信息 */
.postinfo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.postinfo .logo {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--ios-bg-secondary);
  box-shadow: none;
  padding: 0;
}

.postinfoofdaily {
  flex: 1;
}

.nameinfo {
  font-size: 15px;
  font-weight: 600;
  color: var(--ios-text-primary);
  display: block;
  margin-bottom: 2px;
}

.postinfoofdailytime {
  font-size: 13px;
  color: var(--ios-text-tertiary);
  font-weight: 400;
}

/* 文章标题 */
.entry_title {
  margin: 0 0 12px;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
}

.entry_title a {
  color: var(--ios-text-primary);
}

.entry_title a:hover {
  color: var(--ios-blue);
}

/* 文章摘要 */
.entry_text {
  font-size: 15px;
  line-height: 1.6;
  color: var(--ios-text-secondary);
  margin-bottom: 12px;
}

.entry_text p {
  margin: 0;
}

/* 文章元数据 */
.post_views {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--ios-text-tertiary);
  margin-right: 12px;
}

/* 日记风格 */
.diary-style .post {
  background: linear-gradient(135deg, #fff5f5 0%, #fff0f0 100%);
  border-left: 4px solid var(--ios-pink);
}

[data-theme="dark"] .diary-style .post {
  background: linear-gradient(135deg, rgba(255, 45, 85, 0.1) 0%, rgba(255, 45, 85, 0.05) 100%);
}

/* 加载更多按钮 */
.nextWide {
  text-align: center;
  margin-top: 24px;
}

.nextWide a,
.next {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 32px;
  background: var(--ios-blue);
  color: white;
  font-size: 15px;
  font-weight: 500;
  border-radius: 980px;
  border: none;
  cursor: pointer;
  transition: var(--ios-transition);
}

.nextWide a:hover,
.next:hover {
  opacity: 0.8;
  transform: scale(1.02);
}

/* ============================================
   6. iOS风格侧边栏
   ============================================ */
.sideroom {
  position: fixed;
  top: 0;
  left: -280px;
  width: 280px;
  height: 100vh;
  background: var(--ios-bg-primary);
  z-index: 2000;
  transition: var(--ios-transition);
  overflow-y: auto;
  box-shadow: 2px 0 20px rgba(0, 0, 0, 0.1);
}

.sideroom.active {
  left: 0;
}

.sideroom-blur {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  z-index: 1999;
  opacity: 0;
  visibility: hidden;
  transition: var(--ios-transition);
}

.sideroom-blur.active {
  opacity: 1;
  visibility: visible;
}

/* 个人卡片 */
.bg_color-sideroom {
  padding: 32px 20px;
  background: linear-gradient(135deg, var(--ios-blue) 0%, var(--ios-indigo) 100%);
  text-align: center;
}

.alaver-img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.3);
  margin-bottom: 12px;
}

.name {
  font-size: 20px;
  font-weight: 600;
  color: white;
  margin-bottom: 4px;
}

.name-talk {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.8);
  font-weight: 400;
}

/* 侧边栏菜单 */
#nav_menu-m {
  list-style: none;
  padding: 8px;
  margin: 16px 0;
}

#nav_menu-m li {
  margin: 0;
}

#nav_menu-m a {
  display: block;
  padding: 14px 16px;
  font-size: 17px;
  color: var(--ios-text-primary);
  border-radius: var(--ios-radius-md);
  transition: var(--ios-transition);
}

#nav_menu-m a:hover {
  background: var(--ios-bg-secondary);
}

/* ============================================
   7. iOS风格文章详情页
   ============================================ */
.typecho-user-text {
  max-width: 800px;
  margin: 0 auto;
}

.contenthead {
  background: var(--ios-bg-primary);
  border-radius: var(--ios-radius-xl);
  padding: 32px;
  margin-bottom: 20px;
  box-shadow: var(--ios-card-shadow);
  border: 0.5px solid var(--ios-separator);
}

.contentheadFortitlesmall {
  font-size: 12px;
  color: var(--ios-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
  margin-bottom: 8px;
  display: block;
}

.contentheadFortitle2 {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.contentheadFortitle2 svg {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.contentheadFortitle2 .post-title {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.3;
  margin: 0;
  color: var(--ios-text-primary);
}

.contentheadFortitle3 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--ios-text-secondary);
  margin-bottom: 16px;
}

.contentheadFortitle3 .logo {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
}

.contentheadFortitle4 {
  font-size: 15px;
  line-height: 1.6;
  color: var(--ios-text-secondary);
  padding: 16px;
  background: var(--ios-bg-secondary);
  border-radius: var(--ios-radius-md);
  border: 1px dashed var(--ios-separator);
}

/* 文章正文 */
.content-list-post {
  background: var(--ios-bg-primary);
  border-radius: var(--ios-radius-xl);
  padding: 32px;
  box-shadow: var(--ios-card-shadow);
  border: 0.5px solid var(--ios-separator);
}

.typecho-time {
  font-size: 12px;
  color: var(--ios-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
  margin-bottom: 16px;
  display: block;
}

.content-text-2 {
  font-size: 17px;
  line-height: 1.8;
  color: var(--ios-text-primary);
}

.content-text-2 h1,
.content-text-2 h2,
.content-text-2 h3,
.content-text-2 h4,
.content-text-2 h5,
.content-text-2 h6 {
  margin: 32px 0 16px;
  color: var(--ios-text-primary);
  font-weight: 600;
  line-height: 1.3;
}

.content-text-2 h1 { font-size: 32px; }
.content-text-2 h2 { font-size: 28px; }
.content-text-2 h3 { font-size: 24px; }
.content-text-2 h4 { font-size: 20px; }

.content-text-2 p {
  margin-bottom: 16px;
}

.content-text-2 img {
  max-width: 100%;
  height: auto;
  border-radius: var(--ios-radius-lg);
  margin: 24px 0;
}

.content-text-2 a {
  color: var(--ios-blue);
  border-bottom: 1px solid transparent;
}

.content-text-2 a:hover {
  border-bottom-color: var(--ios-blue);
}

.content-text-2 blockquote {
  margin: 24px 0;
  padding: 16px 20px;
  background: var(--ios-bg-secondary);
  border-left: 4px solid var(--ios-blue);
  border-radius: var(--ios-radius-md);
  font-style: italic;
}

.content-text-2 code {
  font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
  font-size: 15px;
  background: var(--ios-bg-secondary);
  padding: 2px 6px;
  border-radius: 4px;
}

.content-text-2 pre {
  margin: 24px 0;
  padding: 16px;
  background: var(--ios-bg-tertiary);
  border-radius: var(--ios-radius-md);
  overflow-x: auto;
}

.content-text-2 pre code {
  background: transparent;
  padding: 0;
}

/* 标签 */
.post-tags {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 0.5px solid var(--ios-separator);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.post-tags a {
  display: inline-flex;
  padding: 6px 14px;
  background: var(--ios-bg-secondary);
  color: var(--ios-blue);
  font-size: 14px;
  border-radius: 980px;
  transition: var(--ios-transition);
}

.post-tags a:hover {
  background: var(--ios-blue);
  color: white;
}

/* ============================================
   8. iOS风格评论区
   ============================================ */
.comments {
  margin-top: 32px;
}

#comments-padding {
  background: var(--ios-bg-primary);
  border-radius: var(--ios-radius-xl);
  padding: 24px;
  box-shadow: var(--ios-card-shadow);
  border: 0.5px solid var(--ios-separator);
}

.comments-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 20px;
  color: var(--ios-text-primary);
}

.comments-3-text {
  margin-bottom: 20px;
}

.comments-3-text .text {
  width: 100%;
  min-height: 100px;
  padding: 12px 16px;
  background: var(--ios-bg-secondary);
  border: 1px solid var(--ios-separator);
  border-radius: var(--ios-radius-md);
  font-size: 15px;
  color: var(--ios-text-primary);
  font-family: inherit;
  resize: vertical;
  transition: var(--ios-transition);
}

.comments-3-text .text:focus {
  outline: none;
  border-color: var(--ios-blue);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

.comments-unuser {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.comments-unuser input {
  width: 100%;
  padding: 12px 16px;
  background: var(--ios-bg-secondary);
  border: 1px solid var(--ios-separator);
  border-radius: var(--ios-radius-md);
  font-size: 15px;
  color: var(--ios-text-primary);
  font-family: inherit;
  transition: var(--ios-transition);
}

.comments-unuser input:focus {
  outline: none;
  border-color: var(--ios-blue);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

.submit-alone {
  width: 100%;
  padding: 14px 24px;
  background: var(--ios-blue);
  color: white;
  font-size: 17px;
  font-weight: 500;
  border: none;
  border-radius: var(--ios-radius-md);
  cursor: pointer;
  transition: var(--ios-transition);
}

.submit-alone:hover {
  opacity: 0.9;
  transform: scale(1.01);
}

/* ============================================
   9. iOS风格底部
   ============================================ */
.footer {
  background: var(--ios-bg-primary);
  border-top: 0.5px solid var(--ios-separator);
  padding: 32px 20px;
  text-align: center;
  margin-top: 60px;
  border-radius: 0 !important;
}

.footer h3 {
  font-size: 15px;
  font-weight: 500;
  color: var(--ios-text-primary);
  margin-bottom: 8px;
}

.footer h3 a {
  color: var(--ios-blue);
}

.footer h4 {
  font-size: 13px;
  color: var(--ios-text-tertiary);
  font-weight: 400;
}

.footer h4 a {
  color: var(--ios-text-secondary);
}

/* ============================================
   10. 深色模式切换按钮
   ============================================ */
.theme-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 50px;
  height: 50px;
  background: var(--ios-bg-primary);
  border: 0.5px solid var(--ios-separator);
  border-radius: 50%;
  box-shadow: var(--ios-card-shadow);
  cursor: pointer;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--ios-transition);
}

.theme-toggle:hover {
  transform: scale(1.1);
}

.theme-toggle svg {
  width: 24px;
  height: 24px;
  stroke: var(--ios-text-primary);
}

/* ============================================
   11. 移动端响应式布局
   ============================================ */
@media screen and (max-width: 768px) {
  body {
    font-size: 16px;
  }
  
  .header {
    height: 44px;
    padding: 0 16px;
  }
  
  #nav_menu {
    display: none;
  }
  
  #box_hover {
    display: flex;
  }
  
  .content-all {
    padding: 56px 16px 32px;
  }
  
  .post {
    padding: 16px;
    border-radius: var(--ios-radius-lg);
  }
  
  .entry_title {
    font-size: 18px;
  }
  
  .contenthead {
    padding: 20px;
    border-radius: var(--ios-radius-lg);
  }
  
  .contentheadFortitle2 .post-title {
    font-size: 22px;
  }
  
  .content-list-post {
    padding: 20px;
    border-radius: var(--ios-radius-lg);
  }
  
  .content-text-2 {
    font-size: 16px;
  }
  
  .footer {
    padding: 24px 16px;
    margin-top: 40px;
  }
  
  .theme-toggle {
    bottom: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
  }
}

/* ============================================
   12. 工具类
   ============================================ */
.text-ellipsis {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 平滑滚动 */
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

/* 选择文本颜色 */
::selection {
  background: rgba(0, 122, 255, 0.2);
  color: var(--ios-text-primary);
}

/* 滚动条样式 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--ios-gray-3);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--ios-gray-2);
}
/* 图片自适应 */
.entry_text img {
  max-width: 100%;
  width: auto;
  height: auto;
  display: block;
  margin: 12px auto;
  border-radius: var(--ios-radius-md);
  object-fit: contain;
}

/* 日记图片特殊处理 */
.diary-style .entry_text img {
  max-width: 100%;
  max-height: 400px;
  object-fit: cover;
}