/* shared/app.css - 主页样式 */
* { margin:0; padding:0; box-sizing:border-box; font-family:system-ui,-apple-system,'Segoe UI',Roboto,sans-serif; }
body { min-height:100vh; display:flex; align-items:flex-start; justify-content:center; background:#fff; padding:16px; padding-top:80px; padding-bottom:60px; }

.search-container { width:100%; max-width:680px; display:flex; flex-direction:column; align-items:center; position:relative; }

/* 顶部工具栏 */
.top-bar { width:100%; display:flex; justify-content:flex-end; gap:12px; margin-bottom:8px; }
.top-btn { background:#f5f5f7; border:1px solid #e0e0e5; color:#1e1e2f; padding:6px 14px; border-radius:40px; font-size:13px; font-weight:500; cursor:pointer; transition:background .2s; display:flex; align-items:center; gap:6px; }
.top-btn:hover { background:#ebebf0; }
.top-btn:active { transform:scale(.96); }

/* 分类标签 */
.nav-tabs { display:flex; flex-wrap:wrap; justify-content:center; gap:20px; margin-bottom:18px; font-weight:500; font-size:14px; }
.tab-item { cursor:pointer; padding:4px 0; color:#8a8f9e; border-bottom:2px solid transparent; transition:color .2s; }
.tab-item:hover { color:#1e1e2f; }
.tab-item.active { color:#1e1e2f; border-bottom-color:#1e1e2f; font-weight:600; }

/* 搜索框 */
.search-box-wrapper { width:100%; background:#fff; border-radius:28px; border:1.5px solid #e8e8ee; box-shadow:0 2px 10px rgba(0,0,0,.04); display:flex; align-items:center; padding:4px 4px 4px 20px; transition:border-color .2s, box-shadow .2s; position:relative; }
.search-box-wrapper:focus-within { border-color:#ff5e4a; box-shadow:0 4px 18px rgba(255,94,74,.12), 0 0 0 3px rgba(255,94,74,.08); }

.search-input { flex:1; border:none; outline:none; font-size:16px; padding:10px 6px 10px 0; background:transparent; color:#1e1e2f; min-width:0; }
.search-input::placeholder { color:#b0b4c0; font-size:15px; }

.icon-btn { width:44px; height:44px; border:none; border-radius:50%; background:transparent; cursor:pointer; display:flex; align-items:center; justify-content:center; font-size:20px; transition:background .15s; flex-shrink:0; }
.icon-btn:hover { background:#f5f5f7; }

.search-btn { width:48px; height:48px; border:none; border-radius:50%; background:#ff5e4a; color:#fff; cursor:pointer; display:flex; align-items:center; justify-content:center; box-shadow:0 3px 10px rgba(255,94,74,.3); transition:background .2s, transform .15s; flex-shrink:0; margin-left:4px; }
.search-btn:hover { background:#ff4432; transform:scale(1.03); }
.search-btn:active { transform:scale(.95); }
.search-btn svg { width:20px; height:20px; }

/* 简码下拉 */
.shortcut-dropdown { width:100%; background:#fff; border-radius:16px; border:1px solid #eee; box-shadow:0 12px 28px rgba(0,0,0,.08); margin-top:10px; max-height:280px; overflow-y:auto; padding:6px 0; display:none; }
.shortcut-dropdown.show { display:block; }
.shortcut-item { display:flex; align-items:center; justify-content:space-between; padding:9px 18px; cursor:pointer; border-bottom:1px solid #f0f0f5; font-size:14px; color:#1e1e2f; transition:background .1s; }
.shortcut-item:last-child { border-bottom:none; }
.shortcut-item:hover { background:#f7f7fc; }
.shortcut-code { font-weight:700; color:#ff5e4a; background:#fff0ee; padding:3px 9px; border-radius:40px; font-size:13px; letter-spacing:.5px; }
.shortcut-name { font-weight:500; }
.shortcut-url { color:#8a8f9e; font-size:12px; max-width:280px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; margin-left:12px; text-align:right; }

/* 引擎行 */
.engine-row { display:flex; flex-wrap:wrap; align-items:center; justify-content:center; gap:12px; margin-top:18px; font-size:14px; font-weight:500; }
.engine-item { cursor:pointer; padding:4px 10px; border-radius:40px; color:#6b7280; background:transparent; border:1px solid transparent; font-size:13px; transition:color .15s, background .15s; }
.engine-item:hover { color:#1e1e2f; background:#f5f5f7; }
.engine-item.active { color:#1e1e2f; font-weight:700; background:#f0f0f5; border-color:#e0e0e5; }

/* 提示 */
.hint { margin-top:18px; font-size:13px; color:#b0b4c0; }

/* ========== 工具面板（Tab 版） ========== */
.tool-panel { display:none; width:100%; background:#fff; border-radius:16px; border:1px solid #eee; box-shadow:0 8px 28px rgba(0,0,0,.06); margin-top:20px; padding:16px; }
.tool-panel.show { display:block; }
.tool-panel-title { font-size:12px; color:#b0b4c0; padding:0 4px 12px; font-weight:600; letter-spacing:.5px; }

.tool-tabs { display:flex; gap:6px; flex-wrap:wrap; padding-bottom:12px; border-bottom:1px solid #f0f0f5; margin-bottom:16px; }
.tool-tab { background:transparent; border:1px solid #f0f0f5; color:#666; padding:6px 14px; border-radius:40px; font-size:13px; font-weight:500; cursor:pointer; transition:all .15s; font-family:inherit; }
.tool-tab:hover { background:#fff8f6; border-color:#ffc8bf; color:#ff5e4a; }
.tool-tab.active { background:#ff5e4a; border-color:#ff5e4a; color:#fff; font-weight:600; }

.tool-grid { display:grid; grid-template-columns:repeat(4, 1fr); gap:10px; }
.tool-option { display:flex; flex-direction:column; align-items:flex-start; gap:8px; padding:14px; border-radius:12px; cursor:pointer; transition:all .15s; color:#1e1e2f; border:1px solid #f0f0f5; text-decoration:none; background:#fff; min-height:88px; }
.tool-option:hover { background:#fff8f6; border-color:#ffc8bf; transform:translateY(-1px); }
.tool-option .opt-icon { font-size:20px; line-height:1; }
.tool-option .opt-name { font-size:13px; font-weight:600; color:#1a1a1a; line-height:1.3; }
.tool-option .opt-desc { font-size:11px; color:#999; line-height:1.3; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; width:100%; }

/* 常见问题 */
.about-section { width:100%; max-width:680px; margin-top:56px; padding-bottom:40px; }
.about-card { background:#fafafa; border:1px solid #eee; border-radius:20px; padding:24px 28px; text-align:left; }
.about-card h3 { font-size:16px; font-weight:700; color:#1e1e2f; margin-bottom:16px; }
.about-card details { border-bottom:1px solid #eee; padding:12px 0; }
.about-card details:last-child { border-bottom:none; padding-bottom:0; }
.about-card summary { font-size:14px; font-weight:600; color:#1e1e2f; cursor:pointer; list-style:none; display:flex; align-items:center; justify-content:space-between; }
.about-card summary::after { content:'＋'; color:#b0b4c0; font-weight:400; font-size:16px; }
.about-card details[open] summary::after { content:'－'; }
.about-card summary::-webkit-details-marker { display:none; }
.about-card p { font-size:13px; color:#6b7280; line-height:1.7; margin-top:10px; }
.about-card code { background:#fff0ee; color:#ff5e4a; padding:1px 6px; border-radius:4px; font-size:12px; font-family:ui-monospace,monospace; }
.about-card a { color:#ff5e4a; text-decoration:none; }
.about-footer { display:flex; flex-wrap:wrap; justify-content:space-between; gap:8px; margin-top:24px; font-size:12px; color:#b0b4c0; }

/* 模态窗口 */
.modal-overlay { position:fixed; top:0; left:0; width:100%; height:100%; background:rgba(0,0,0,.3); backdrop-filter:blur(4px); display:none; align-items:center; justify-content:center; z-index:1000; padding:20px; }
.modal-overlay.show { display:flex; }
.modal-content { background:#fff; border-radius:24px; width:100%; max-width:720px; max-height:90vh; overflow:hidden; display:flex; flex-direction:column; box-shadow:0 30px 60px rgba(0,0,0,.15); animation:modalIn .2s ease; }
@keyframes modalIn { from { opacity:0; transform:scale(.96) translateY(10px); } to { opacity:1; transform:scale(1) translateY(0); } }
.modal-header { display:flex; align-items:center; justify-content:space-between; padding:16px 22px; border-bottom:1px solid #eee; flex-shrink:0; }
.modal-header h2 { font-size:17px; font-weight:700; color:#1e1e2f; }
.modal-close { background:none; border:none; font-size:24px; color:#999; cursor:pointer; line-height:1; padding:0 6px; }
.modal-close:hover { color:#333; }
.modal-body { padding:18px 22px; overflow-y:auto; flex:1; }
.modal-section { margin-bottom:24px; }
.modal-section:last-child { margin-bottom:0; }
.modal-section h3 { font-size:14px; font-weight:600; color:#1e1e2f; margin-bottom:10px; display:flex; align-items:center; justify-content:space-between; }
.modal-section h3 .sub { font-size:12px; color:#999; font-weight:400; }
.form-row { display:flex; gap:8px; margin-bottom:8px; flex-wrap:wrap; }
.form-row input { flex:1; min-width:110px; padding:8px 12px; border:1px solid #ddd; border-radius:10px; font-size:13px; outline:none; background:#fafafa; color:#1e1e2f; }
.form-row input:focus { border-color:#ff5e4a; background:#fff; }
.btn-primary { background:#ff5e4a; border:none; color:#fff; padding:8px 18px; border-radius:10px; font-size:13px; font-weight:600; cursor:pointer; white-space:nowrap; }
.btn-primary:hover { background:#ff4432; }
.btn-secondary { background:#f0f0f5; border:none; color:#1e1e2f; padding:8px 16px; border-radius:10px; font-size:13px; font-weight:500; cursor:pointer; white-space:nowrap; }
.btn-secondary:hover { background:#e4e4ec; }
.btn-danger { background:#fee; border:none; color:#e74c3c; padding:8px 16px; border-radius:10px; font-size:13px; font-weight:500; cursor:pointer; white-space:nowrap; }
.btn-danger:hover { background:#fdd; }
.item-list { max-height:200px; overflow-y:auto; border:1px solid #eee; border-radius:12px; background:#fafafa; }
.list-item { display:flex; align-items:center; justify-content:space-between; padding:8px 14px; border-bottom:1px solid #eee; font-size:13px; }
.list-item:last-child { border-bottom:none; }
.list-item .info { display:flex; align-items:center; gap:8px; flex:1; min-width:0; }
.list-item .info .code-badge { font-weight:700; color:#ff5e4a; background:#fff0ee; padding:2px 8px; border-radius:20px; font-size:12px; flex-shrink:0; }
.list-item .info .name { font-weight:500; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.list-item .info .url { color:#999; font-size:11px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:160px; }
.list-item .actions { display:flex; gap:4px; flex-shrink:0; margin-left:8px; }
.btn-small { background:none; border:none; color:#999; cursor:pointer; padding:3px 6px; border-radius:6px; font-size:12px; }
.btn-small:hover { background:#f0f0f5; color:#1e1e2f; }
.btn-small.danger:hover { background:#fee; color:#e74c3c; }
.io-group { display:flex; gap:8px; flex-wrap:wrap; }
.file-input { display:none; }
.empty-state { text-align:center; color:#aaa; padding:16px; font-size:13px; }

.toast { position:fixed; bottom:24px; left:50%; transform:translateX(-50%) translateY(20px); background:#1e1e2f; color:#fff; padding:10px 20px; border-radius:40px; font-size:13px; font-weight:500; box-shadow:0 10px 30px rgba(0,0,0,.15); opacity:0; transition:opacity .3s, transform .3s; pointer-events:none; z-index:2000; max-width:90%; text-align:center; }
.toast.show { opacity:1; transform:translateX(-50%) translateY(0); }

/* 移动端 */
@media (max-width:700px) {
  body { padding-top:40px; padding-bottom:40px; }
  .nav-tabs { gap:12px; font-size:13px; margin-bottom:14px; }
  .search-box-wrapper { padding:3px 3px 3px 16px; }
  .search-btn { width:42px; height:42px; }
  .search-btn svg { width:18px; height:18px; }
  .search-input { font-size:15px; padding:9px 4px 9px 0; }
  .engine-row { gap:8px; font-size:12px; margin-top:14px; }
  .engine-item { padding:3px 8px; font-size:12px; }
  .shortcut-item { padding:8px 14px; font-size:13px; flex-wrap:wrap; gap:4px; }
  .shortcut-url { max-width:100%; margin-left:0; text-align:left; font-size:11px; }
  .tool-tab { padding:5px 12px; font-size:12px; }
  .tool-grid { grid-template-columns:repeat(2, 1fr); }
  .about-card { padding:18px 18px; }
  .about-footer { flex-direction:column; gap:4px; }
  .modal-content { border-radius:20px; }
  .form-row input { min-width:80px; font-size:12px; padding:7px 10px; }
}