* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #1e1e2e;
    color: #cdd6f4;
    padding: 16px;
    padding-bottom: 80px;
}

.app-container {
    max-width: 800px;
    margin: 0 auto;
}

/* 头部 */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 24px 20px;
    border-radius: 16px;
    margin-bottom: 20px;
    text-align: center;
}

.header h1 {
    font-size: 28px;
    margin-bottom: 8px;
}

.header p {
    font-size: 14px;
    opacity: 0.9;
}

/* 表单区域 */
.add-section, .search-section, .snippets-section {
    background: #313244;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 16px;
}

.add-section h3, .section-header h3 {
    font-size: 18px;
    margin-bottom: 16px;
    color: #f5c2e7;
}

.input-field, .select-field, .textarea-field {
    width: 100%;
    padding: 12px;
    margin-bottom: 12px;
    background: #45475a;
    border: none;
    border-radius: 10px;
    color: #cdd6f4;
    font-size: 14px;
    font-family: inherit;
}

.textarea-field {
    font-family: 'Courier New', monospace;
    resize: vertical;
}

.input-field:focus, .select-field:focus, .textarea-field:focus {
    outline: none;
    border: 1px solid #89b4fa;
}

.btn-primary {
    width: 100%;
    padding: 14px;
    background: #89b4fa;
    color: #1e1e2e;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.1s;
}

.btn-primary:active {
    transform: scale(0.98);
}

/* 搜索和过滤 */
.filter-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.filter-btn {
    padding: 6px 12px;
    background: #45475a;
    border: none;
    border-radius: 20px;
    color: #cdd6f4;
    font-size: 12px;
    cursor: pointer;
}

.filter-btn.active {
    background: #89b4fa;
    color: #1e1e2e;
}

/* 片段列表 */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 10px;
}

.actions {
    display: flex;
    gap: 8px;
}

.btn-small {
    padding: 6px 12px;
    background: #45475a;
    border: none;
    border-radius: 8px;
    color: #cdd6f4;
    font-size: 12px;
    cursor: pointer;
}

.btn-small.danger {
    background: #f38ba8;
    color: #1e1e2e;
}

.snippets-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.snippet-card {
    background: #181825;
    border-radius: 12px;
    padding: 16px;
    border-left: 3px solid #89b4fa;
}

.snippet-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
    flex-wrap: wrap;
    gap: 8px;
}

.snippet-name {
    font-size: 16px;
    font-weight: bold;
    color: #89b4fa;
}

.snippet-category {
    background: #45475a;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
}

.snippet-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.snippet-tag {
    background: #313244;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
    color: #a6adc8;
}

.snippet-code {
    background: #11111b;
    padding: 12px;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
    margin-bottom: 12px;
    max-height: 150px;
    overflow-y: auto;
}

.snippet-actions {
    display: flex;
    gap: 10px;
}

.copy-btn, .delete-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
}

.copy-btn {
    background: #94e2d5;
    color: #1e1e2e;
}

.delete-btn {
    background: #f38ba8;
    color: #1e1e2e;
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: #6c7086;
}

.stats-section {
    text-align: center;
    padding: 12px;
    color: #6c7086;
    font-size: 14px;
}

/* 提示浮层 */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: #1e1e2e;
    color: #cdd6f4;
    padding: 10px 20px;
    border-radius: 30px;
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    z-index: 1000;
    border: 1px solid #89b4fa;
}

.toast.show {
    opacity: 1;
}
