/* Apple风格CSS - 基础设置 */
:root {
  --apple-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --apple-blue: #0071e3;
  --apple-blue-dark: #0058B9;
  --apple-gray: #86868b;
  --apple-light-gray: #f5f5f7;
  --apple-dark-gray: #1d1d1f;
  --apple-black: #000000;
  --apple-white: #ffffff;
  --apple-success: #4cd964;
  --apple-warning: #ff9500;
  --apple-error: #ff3b30;
  --border-radius: 12px;
  --nav-height: 60px;
  font-size: 16px;
}

/* 全局样式 */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--apple-font);
  background-color: var(--apple-white);
  color: var(--apple-black);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding-bottom: var(--nav-height);
}

/* 响应式基础字体大小调整 */
@media screen and (min-width: 768px) {
  :root {
    font-size: 16px;
  }
}

@media screen and (min-width: 1024px) {
  :root {
    font-size: 18px;
  }
}

@media screen and (min-width: 1440px) {
  :root {
    font-size: 20px;
  }
}

/* 针对高分辨率移动设备的适配 */
@media screen and (-webkit-min-device-pixel-ratio: 2), 
       screen and (min-resolution: 192dpi) {
  input, textarea, select, button {
    font-size: 1.1rem;
    padding: 1rem 1.2rem;
  }
  
  .nav-item i {
    font-size: 1.8rem;
  }
  
  .nav-item span {
    font-size: 0.8rem;
  }
}

/* 针对平板设备的适配 */
@media screen and (min-width: 768px) and (max-width: 1024px) {
  .content {
    max-width: 90%;
    padding: 2rem;
  }
  
  input, textarea, select {
    padding: 1rem 1.2rem;
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
  }
  
  button, input[type="submit"] {
    padding: 1rem 2rem;
    font-size: 1.1rem;
  }
  
  .card {
    padding: 2rem;
  }
  
  .nav-item {
    padding: 0.5rem 0;
  }
  
  .nav-item i {
    font-size: 2rem;
    height: 2.2rem;
  }
  
  .nav-item span {
    font-size: 0.9rem;
    margin-top: 0.3rem;
  }
}

/* 移动端适配 */
@media screen and (max-width: 600px) {
  .content {
    padding: 1rem;
    padding-bottom: calc(1rem + var(--nav-height));
  }
  
  h1 {
    font-size: 2rem;
  }
  
  button, input[type="submit"] {
    width: 100%;
    min-height: 3rem;
  }
  
  input, textarea, select {
    min-height: 3rem;
    font-size: 1rem;
  }
  
  .nav-item {
    padding: 0.3rem 0;
  }
  
  .nav-item i {
    font-size: 1.6rem;
    height: 1.8rem;
  }
  
  .nav-item span {
    font-size: 0.75rem;
    margin-top: 0.1rem;
  }
}

/* 确保最小可触摸区域 */
button, 
input[type="submit"], 
.nav-item,
input,
textarea,
select,
.action-card,
.card {
  min-height: 44px; /* Apple推荐的最小可触摸区域 */
  touch-action: manipulation; /* 优化触摸操作 */
}

/* 优化表单控件在触摸设备上的显示 */
@supports (-webkit-touch-callout: none) {
  input, 
  textarea, 
  select {
    font-size: 16px; /* 防止iOS自动缩放 */
  }
  
  button, 
  input[type="submit"] {
    -webkit-tap-highlight-color: transparent;
  }
}

/* 底部导航栏样式 */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: rgba(255, 255, 255, 0.8);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  z-index: 1000;
  height: var(--nav-height);
}

.bottom-nav ul {
  list-style-type: none;
  display: flex;
  justify-content: space-around;
  align-items: center;
  height: 100%;
  margin: 0;
  padding: 0;
  max-width: 600px;
  margin: 0 auto;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--apple-gray);
  text-decoration: none;
  font-size: 0.8rem;
  transition: all 0.2s ease;
  padding: 0.5rem 0;
  width: 50%;
  height: 100%;
  position: relative;
  white-space: nowrap;
  text-align: center;
}

.nav-item i {
  font-size: 1.4rem;
  transition: all 0.2s ease;
  height: 1.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-item span {
  font-size: 0.7rem;
  transition: all 0.2s ease;
  text-align: center;
  display: block;
  margin-top: 0.2rem;
}

.nav-item:hover, .nav-item.active {
  color: var(--apple-blue);
}

.nav-item:hover i, .nav-item.active i {
  transform: translateY(-2px);
}

.nav-item:hover span, .nav-item.active span {
  color: var(--apple-blue);
}

/* 页面内容区域 */
.content {
  max-width: 1000px;
  margin: 0 auto;
  padding: 2rem 1rem;
  padding-bottom: calc(2rem + var(--nav-height));
}

/* 标题样式 */
h1 {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--apple-dark-gray);
  margin-bottom: 1.5rem;
  letter-spacing: -0.025em;
}

/* 段落样式 */
p {
  font-size: 1.1rem;
  color: var(--apple-gray);
  margin-bottom: 1rem;
}

/* 警告框样式 */
.alert {
  padding: 1rem;
  margin-bottom: 1.5rem;
  border-radius: var(--border-radius);
  font-size: 1rem;
  display: flex;
  align-items: center;
}

.alert:before {
  margin-right: 0.8rem;
  font-size: 1.2rem;
}

.alert-success {
  background-color: rgba(76, 217, 100, 0.1);
  color: var(--apple-success);
  border: 1px solid var(--apple-success);
}

.alert-success:before {
  content: "✓";
}

.alert-danger, .alert-error {
  background-color: rgba(255, 59, 48, 0.1);
  color: var(--apple-error);
  border: 1px solid var(--apple-error);
}

.alert-danger:before, .alert-error:before {
  content: "!";
}

/* 按钮样式 */
button, input[type="submit"] {
  background-color: var(--apple-blue);
  color: white;
  font-size: 1rem;
  font-weight: 500;
  padding: 0.8rem 1.5rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  margin: 1rem 0;
  text-align: center;
  display: inline-block;
}

button:hover, input[type="submit"]:hover {
  background-color: var(--apple-blue-dark);
  transform: translateY(-1px);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

button:active, input[type="submit"]:active {
  transform: translateY(0);
  box-shadow: none;
}

/* 链接样式 */
a {
  color: var(--apple-blue);
  text-decoration: none;
  transition: all 0.2s ease;
  font-size: 1rem;
}

a:hover {
  text-decoration: underline;
}

/* 表单样式 */
form {
  width: 100%;
  max-width: 450px;
  margin: 1.5rem auto;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 1rem;
  color: var(--apple-dark-gray);
  font-weight: 500;
}

input, textarea, select {
  width: 100%;
  padding: 0.8rem 1rem;
  margin-bottom: 1.2rem;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  font-size: 1rem;
  font-family: var(--apple-font);
  transition: all 0.2s ease;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--apple-blue);
  box-shadow: 0 0 0 2px rgba(0, 113, 227, 0.2);
}

/* 卡片样式 */
.card {
  background: var(--apple-white);
  border-radius: var(--border-radius);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  padding: 1.5rem;
  margin-bottom: 2rem;
  transition: all 0.3s ease;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

/* 状态信息显示 */
.status-badge {
  display: inline-block;
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 500;
  margin-right: 0.5rem;
}

.status-active {
  background-color: rgba(76, 217, 100, 0.15);
  color: var(--apple-success);
}

/* 结果显示 */
pre {
  background-color: var(--apple-light-gray);
  padding: 1rem;
  border-radius: 8px;
  overflow-x: auto;
  font-family: monospace;
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

/* 特别定制的苹果风格元素 */
.apple-divider {
  height: 1px;
  background-color: rgba(0, 0, 0, 0.1);
  margin: 2rem 0;
}

.apple-btn-secondary {
  background-color: var(--apple-light-gray);
  color: var(--apple-dark-gray);
}

.apple-btn-secondary:hover {
  background-color: rgba(0, 0, 0, 0.05);
  color: var(--apple-black);
}