/* ========== 全局移动优先设计系统 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    background: #f4f6fa;
    color: #1e1e2f;
    line-height: 1.5;
    padding-bottom: 24px;
    -webkit-font-smoothing: antialiased;
}

/* 容器 */
.app-container {
    max-width: 780px;
    margin: 0 auto;
    padding: 16px 16px 32px;
}

/* 卡片 */
.card {
    background: #ffffff;
    border-radius: 20px;
    padding: 20px 18px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.02), 0 2px 6px rgba(0,0,0,0.03);
    border: 1px solid #f0f2f7;
    transition: box-shadow 0.15s;
}
.card + .card { margin-top: 20px; }

h2 {
    font-size: 1.8rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: 1.2rem;
    color: #0b1e33;
}

/* 导航栏 (横滑) */
.nav-top {
    display: flex;
    overflow-x: auto;
    background: #ffffffdd;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid #e9ecf2;
    padding: 6px 12px;
    position: sticky;
    top: 0;
    z-index: 10;
    white-space: nowrap;
    scrollbar-width: none;
}
.nav-top::-webkit-scrollbar { display: none; }
.nav-item {
    display: inline-block;
    padding: 10px 18px;
    font-size: 1rem;
    font-weight: 500;
    color: #3a4a5c;
    background: transparent;
    border-radius: 40px;
    text-decoration: none;
    transition: all 0.15s;
    border: 1px solid transparent;
}
.nav-item:hover { background: #eef3fc; }
.nav-item.active {
    background: #1a5cff;
    color: white;
    box-shadow: 0 4px 10px rgba(26,92,255,0.2);
}

/* 按钮 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: 60px;
    font-weight: 500;
    font-size: 0.95rem;
    border: none;
    background: #f0f4fe;
    color: #1a5cff;
    cursor: pointer;
    transition: 0.15s;
    text-decoration: none;
    border: 1px solid transparent;
    gap: 6px;
    white-space: nowrap;
}
.btn-primary {
    background: #1a5cff;
    color: white;
    box-shadow: 0 6px 14px rgba(26,92,255,0.2);
}
.btn-primary:hover { background: #0e4ad0; }
.btn-outline {
    background: white;
    border: 1px solid #d0dae8;
    color: #1e2f44;
}
.btn-danger {
    background: #fff3f0;
    color: #c23b2b;
    border-color: #ffdad6;
}
.btn-sm { padding: 6px 14px; font-size: 0.85rem; }

/* 表单 */
.input-field {
    width: 100%;
    padding: 14px 18px;
    font-size: 1rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 20px;
    background: white;
    transition: border 0.15s, box-shadow 0.15s;
    margin: 8px 0 4px;
}
.input-field:focus {
    outline: none;
    border-color: #1a5cff;
    box-shadow: 0 0 0 4px rgba(26,92,255,0.1);
}
label {
    font-weight: 500;
    color: #334155;
    margin-top: 16px;
    display: block;
    font-size: 0.95rem;
}
select.input-field {
    appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%234b5563" stroke-width="2"><polyline points="6 9 12 15 18 9"/></svg>');
    background-repeat: no-repeat;
    background-position: right 18px center;
    background-size: 18px;
}

/* 分类标签 (chips) */
.chip-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 18px 0 10px;
}
.chip {
    background: #edf2f9;
    color: #1e293b;
    padding: 8px 18px;
    border-radius: 40px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.1s;
    border: 1px solid transparent;
    user-select: none;
}
.chip.active {
    background: #1a5cff;
    color: white;
    box-shadow: 0 4px 10px rgba(26,92,255,0.25);
}
.chip-all { background: #eef2ff; }

/* 搜索条 */
.search-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}
.search-wrapper {
    display: flex;
    gap: 10px;
    align-items: center;
}
.search-input {
    flex: 1;
    padding: 14px 18px;
    border-radius: 40px;
    border: 1.5px solid #e2e8f0;
    background: white;
    font-size: 1rem;
}

/* 笔记卡片 */
.note-card {
    background: white;
    border-radius: 24px;
    padding: 18px 18px 14px;
    margin-top: 16px;
    box-shadow: 0 5px 18px rgba(0,0,0,0.02), 0 0 0 1px #f0f3f9;
    border: 1px solid #ffffff50;
}
.note-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}
.note-check {
    margin-top: 5px;
    transform: scale(1.2);
    accent-color: #1a5cff;
    width: 20px;
    height: 20px;
    cursor: pointer;
}
.note-title {
    font-size: 1.3rem;
    font-weight: 650;
    color: #0b1e33;
    line-height: 1.3;
    margin-bottom: 6px;
}
.note-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 16px;
    font-size: 0.8rem;
    color: #5f6c80;
    margin-bottom: 10px;
}
.category-badge {
    background: #e9f0fd;
    padding: 4px 14px;
    border-radius: 40px;
    font-weight: 500;
    color: #1a5cff;
}
.summary-text {
    color: #2d3a4a;
    margin: 12px 0 14px;
    line-height: 1.6;
    word-break: break-word;
}
.note-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.action-group {
    display: flex;
    gap: 8px;
}

/* 详情展开块 */
.detail-box {
    margin-top: 18px;
    padding: 18px;
    background: #fafcff;
    border-radius: 20px;
    border-left: 4px solid #1a5cff;
    white-space: pre-wrap;
    font-family: 'SF Mono', 'Menlo', monospace;
    font-size: 0.9rem;
    color: #1e293b;
    border: 1px solid #eef2f9;
}
.hidden { display: none !important; }

/* 表格 */
.table-wrapper {
    background: white;
    border-radius: 24px;
    padding: 6px 0;
    box-shadow: 0 5px 20px rgba(0,0,0,0.02);
    border: 1px solid #edf2f9;
    overflow-x: auto;
}
table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}
th {
    padding: 16px 18px;
    background: #fafcff;
    font-weight: 600;
    color: #1f3a6b;
    border-bottom: 2px solid #e4eaf2;
}
td {
    padding: 14px 18px;
    border-bottom: 1px solid #eff3f8;
}

/* 合并内容区域 */
.merged-content {
    background: white;
    border-radius: 24px;
    padding: 24px;
    white-space: pre-wrap;
    font-family: monospace;
    border: 1px solid #e2eaf5;
    margin: 20px 0;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: #1e2f44;
    color: white;
    padding: 12px 26px;
    border-radius: 60px;
    font-weight: 500;
    box-shadow: 0 12px 30px rgba(0,0,0,0.2);
    z-index: 1000;
}

/* 工具类 */
.flex-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}
.mt-4 { margin-top: 20px; }
.w-100 { width: 100%; }
.text-right { text-align: right; }

/* 移动端微调 */
@media (max-width: 480px) {
    .app-container { padding: 12px 12px 24px; }
    h2 { font-size: 1.8rem; }
    .btn { padding: 10px 16px; }
}