/* style.css —— 修复：1. 搜索框宽度；2. 字体微调 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }
  
  :root {
    --primary: #3498db;
    --primary-dark: #2980b9;
    --bg: #f8f9fa;
    --card-bg: #ffffff;
    --text: #333333;
    --text-light:#666;
    --gray: #95a5a6;
    --border: #e0e0e0;
  }
  
  body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #f0f7ff, #e3f2fd);
    color: var(--text);
    line-height: 1.6;
    padding: 20px;
  }
  
  header {
    text-align: center;
    margin-bottom: 20px;
  }
  
  header h1 {
    font-size: 2.2rem;
    color: var(--primary);
    margin-bottom: 8px;
  }
  
  header p {
    color: var(--gray);
    font-size: 1rem;
  }
  
  .controls {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
    align-items: center;
    justify-content: center;
    /* 关键修复：确保容器足够宽 */
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
  }
  
  #search {
    /* 关键修复：加宽 + 最小宽度保障 */
    padding: 12px 16px;
    font-size: 1rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    width: 100%;
    min-width: 360px; /* 保证 placeholder 能完整显示 */
    max-width: 500px;
    transition: border-color 0.3s, box-shadow 0.3s;
    /* 优化 placeholder 字体 */
    font-family: inherit;
  }
  
  #search::placeholder {
    color: #999;
    opacity: 1;
  }
  
  #search:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
  }
  
  #category {
    padding: 12px 16px;
    font-size: 1rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    background: white;
    cursor: pointer;
    min-width: 180px;
    max-width: 240px;
  }
  
  .char-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
    gap: 12px;
    margin-top: 10px;
  }
  
  .char-card {
    background: var(--card-bg);
    border: 2px solid var(--border);
    border-radius: 8px;
    padding: 14px 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s ease;
    user-select: none;
    position: relative;
  }
  
  .char-card:hover {
    border-color: var(--primary);
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  }
  
  .char-card span.char {
    font-size: 1.7rem;
    line-height: 1.2;
    display: block;
    margin-bottom: 6px;
    min-height: 1.8rem;
  }
  
  .char-card span.code {
    font-size: 0.72rem;
    color: #777;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    letter-spacing: -0.5px;
  }
  
  .char-card.copied {
    background-color: #eaf5fc;
    border-color: var(--primary);
  }
  
  .notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: white;
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
  }
  
  .notification.show {
    opacity: 1;
  }
  
  .hidden {
    display: none !important;
  }
  
  footer {
    text-align: center;
    margin-top: 20px;
    color: var(--text-light);
    font-size: 0.9rem;
  }

  footer a,
  footer a:visited,
  footer a:hover,
  footer a:active {
  color: var(--text-light);
  text-decoration: none;
  }
  
  /* 响应式优化 */
  @media (max-width: 768px) {
    .controls {
      gap: 12px;
    }
    #search {
      min-width: 300px;
      font-size: 0.95rem;
    }
    #category {
      min-width: 160px;
      font-size: 0.95rem;
    }
  }
  
  @media (max-width: 480px) {
    #search {
      min-width: 260px;
      padding: 10px 12px;
    }
    #category {
      min-width: 140px;
    }
  }