/* 布局样式 */

/* 增强型标题栏 */
header {
	background: var(--primary-color);
	color: var(--text-on-primary);
	min-height: var(--header-height);
	padding: calc(var(--spacing-unit) * 1.5) var(--spacing-unit);
	display: flex;
	align-items: center;
	justify-content: space-between;
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	z-index: 100;
	box-shadow: var(--box-shadow);
	transition: all var(--transition-speed);
  }
  
  .header-content {
	display: flex;
	flex-direction: column;
	flex: 1;
  }
  
  header h1 {
	margin: 0;
	font-size: 20px;
	font-weight: 500;
	letter-spacing: 0.5px;
  }
  
  .header-info {
	display: flex;
	gap: calc(var(--spacing-unit) * 1.5);
	align-items: center;
	margin-top: 2px;
	font-size: 14px;
	opacity: 0.9;
  }
  
  .header-date {
	display: flex;
	align-items: center;
	gap: 4px;
  }
  
  .header-date:before {
	content: "📅";
	font-size: 12px;
  }
  
  #currentTime {
	display: flex;
	align-items: center;
	gap: 4px;
  }
  
  #currentTime:before {
	content: "⏰";
	font-size: 12px;
  }
  
  .header-actions {
	display: flex;
	align-items: center;
	gap: calc(var(--spacing-unit) * 1.5);
  }
  
  /* 主容器优化 */
  .container {
	flex: 1;
	padding: calc(var(--header-height) + var(--spacing-unit)) var(--spacing-unit) calc(var(--footer-height) + var(--spacing-unit)) var(--spacing-unit);
	transition: opacity var(--transition-speed), transform var(--transition-speed);
	width: 100%;
	max-width: 600px;
	margin: 0 auto;
	animation: fadeIn 0.3s ease-in-out;
  }
  
  /* 优化底部导航栏 */
  nav {
	background-color: var(--card-color);
	height: var(--footer-height);
	display: flex;
	justify-content: space-around;
	position: fixed;
	bottom: 0;
	left: 0;
	width: 100%;
	z-index: 100;
	box-shadow: 0 -1px 8px rgba(0,0,0,0.1);
	transition: all var(--transition-speed);
	border-radius: 20px 20px 0 0;
  }
  
  nav button {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	flex: 1;
	padding: 4px 0;
	border: none;
	background-color: transparent;
	color: var(--text-secondary);
	font-size: 12px;
	font-weight: 500;
	transition: all var(--transition-speed);
	cursor: pointer;
	position: relative;
  }
  
  nav button:before {
	content: "";
	font-size: 24px;
	display: block;
	margin-bottom: 4px;
	transition: transform 0.2s ease;
  }
  
  nav button:active:before {
	transform: scale(0.9);
  }
  
  nav button#viewScheduleBtn:before { content: "📅"; }
  nav button#viewWeeklyBtn:before { content: "📊"; }
  nav button#viewMonthBtn:before { content: "📆"; }
  nav button#settingsBtn:before { content: "⚙️"; }
  nav button#aboutBtn:before { content: "ℹ️"; }
  
  nav button.active {
	color: var(--primary-color);
  }
  
  nav button.active:after {
	content: "";
	position: absolute;
	bottom: calc(var(--footer-height) / 3);
	left: 36%;
	width: 28%;
	height: 4px;
	background-color: var(--primary-color);
	border-radius: 2px;
  }
  
  /* Loading遮罩优化 */
  #loading {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0,0,0,0.5);
	display: none;
	justify-content: center;
	align-items: center;
	z-index: 999;
	backdrop-filter: blur(3px);
  }
  
  .loading-container {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	background-color: white;
	padding: calc(var(--spacing-unit) * 3);
	border-radius: var(--border-radius);
	box-shadow: var(--box-shadow-elevated);
  }
  
  .loading-spinner {
	width: 40px;
	height: 40px;
	border: 3px solid rgba(63, 81, 181, 0.2);
	border-radius: 50%;
	border-top: 3px solid var(--primary-color);
	animation: spin 1s linear infinite;
	margin-bottom: calc(var(--spacing-unit) * 1.5);
  }
  
  .loading-text {
	font-size: 16px;
	font-weight: 500;
	color: var(--text-primary);
  }
  
  /* 响应式调整 */
  @media (max-width: 360px) {
	:root {
	  --spacing-unit: 6px;
	}
	
	header h1 {
	  font-size: 18px;
	}
	
	nav button {
	  font-size: 10px;
	}
  }
  
  /* 平板适配 */
  @media (min-width: 768px) {
	.container {
	  max-width: 700px;
	  padding-left: calc(var(--spacing-unit) * 2);
	  padding-right: calc(var(--spacing-unit) * 2);
	}
	
	nav {
	  max-width: 500px;
	  left: 50%;
	  transform: translateX(-50%);
	  border-radius: 20px 20px 0 0;
	}
  }
  
  /* 防止iOS布局问题 */
  @supports (-webkit-touch-callout: none) {
	body {
	  min-height: -webkit-fill-available;
	}
  }
  
  /* iOS横竖屏切换适配 */
  @media screen and (orientation: landscape) {
	:root {
	  --header-height: 56px;
	  --footer-height: 52px;
	}
  }