/* ============ Reset & Base ============ */
* { margin:0; padding:0; box-sizing:border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", Arial, sans-serif;
    background: #f5f5f5; color: #333; min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ============ Login Overlay ============ */
.login-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000;
}
.login-overlay.hidden { display: none; }
.login-overlay-content {
    text-align: center; color: #fff; padding: 40px;
}
.login-overlay-content .logo-icon {
    font-size: 64px; margin-bottom: 16px;
}
.login-overlay-content h2 {
    font-size: 32px; margin-bottom: 8px; font-weight: 600;
}
.login-overlay-content p {
    font-size: 16px; opacity: 0.8; margin-bottom: 32px;
}
.login-buttons {
    display: flex; gap: 12px; justify-content: center;
}
.login-buttons .btn-submit {
    background: #fff; color: #667eea; border: none;
    padding: 12px 32px; border-radius: 8px; font-size: 16px;
    cursor: pointer; font-weight: 600;
}
.login-buttons .btn-submit:hover { background: #f0f0f0; }
.login-buttons .btn-cancel {
    background: rgba(255,255,255,0.2); color: #fff;
    border: 1px solid rgba(255,255,255,0.3);
    padding: 12px 32px; border-radius: 8px; font-size: 16px;
    cursor: pointer;
}
.login-buttons .btn-cancel:hover { background: rgba(255,255,255,0.3); }

/* ============ Header ============ */
.header {
    position: sticky; top:0; z-index:100;
    background: #fff; border-bottom: 1px solid #f0f0f0;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.header-inner {
    max-width: 1200px; margin:0 auto;
    display: flex; justify-content: space-between; align-items: center;
    padding: 0 24px; height: 56px;
}
.logo {
    display: flex; align-items: center; gap: 8px;
    font-size: 18px; font-weight: 700;
    cursor: pointer;
    user-select: none;
}
.logo:hover { opacity: 0.8; }
.logo svg { border-radius: 6px; }
.logo span { font-size: 16px; color: #333; font-weight: 600; }

.header-actions { display: flex; align-items: center; gap: 12px; }
.btn-link {
    background: none; border: none; color: #666; font-size: 14px;
    cursor: pointer; padding: 6px 12px; border-radius: 6px; transition: background 0.2s;
}
.btn-link:hover { background: #f5f5f5; }

.upload-btn {
    display: flex; align-items: center; gap: 6px;
    background: #90CAF9; color: #fff; border: none; border-radius: 20px;
    padding: 8px 20px; font-size: 14px; font-weight: 600;
    cursor: pointer; transition: all 0.2s;
}
.upload-btn:hover { opacity: 0.85; transform: scale(1.02); }
.upload-btn:active { transform: scale(0.98); }

.guest-actions, .user-actions { display: flex; align-items: center; gap: 8px; }
.username { font-size: 14px; color: #333; font-weight: 500; }

/* ============ Auth Modal ============ */
.auth-modal { max-width: 380px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; color: #666; margin-bottom: 6px; font-weight: 500; }
.form-group input {
    width: 100%; padding: 10px 14px; border: 1px solid #e0e0e0; border-radius: 8px;
    font-size: 14px; transition: border-color 0.2s; outline: none;
    font-family: inherit;
}
.form-group input:focus { border-color: #ff2442; }
.form-group textarea {
    width: 100%; padding: 10px 14px; border: 1px solid #e0e0e0; border-radius: 8px;
    font-size: 14px; transition: border-color 0.2s; outline: none;
    font-family: inherit; resize: vertical; min-height: 90px;
}
.form-group textarea:focus { border-color: #ff2442; }
.auth-error { color: #ff2442; font-size: 13px; min-height: 18px; margin: 0; }
.auth-switch { font-size: 13px; color: #999; }
.auth-switch a { color: #ff2442; text-decoration: none; font-weight: 500; }
.auth-switch a:hover { text-decoration: underline; }

/* ============ Main Content ============ */
.main-content { max-width: 1200px; margin: 24px auto; padding: 0 16px; }

/* ============ Masonry ============ */
.masonry { column-count: 4; column-gap: 16px; }
@media (max-width: 1100px) { .masonry { column-count: 3; } }
@media (max-width: 768px)  { .masonry { column-count: 2; column-gap: 12px; } }
@media (max-width: 480px)  { .masonry { column-count: 1; max-width: 400px; margin:0 auto; } }

/* ============ Batch Bar ============ */
.batch-bar {
    position: fixed; top: 56px; left: 0; right: 0;
    background: #fff; border-bottom: 1px solid #f0f0f0;
    padding: 12px 24px; z-index: 90;
    display: flex; justify-content: space-between; align-items: center;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.batch-bar.active { transform: translateY(0); }
.batch-info { display: flex; align-items: center; gap: 16px; }
.batch-info span { font-size: 14px; color: #333; }
#selected-count { color: #ff2442; font-weight: 600; }
.batch-actions { display: flex; gap: 10px; align-items: center; }
.batch-group-select {
    padding: 6px 12px; border: 1px solid #e5e5e5; border-radius: 6px;
    font-size: 14px; background: #fff; cursor: pointer; outline: none;
    min-width: 120px;
}
.batch-group-select:focus { border-color: #ff2442; }

/* ============ Photo Card ============ */
.photo-card {
    break-inside: avoid; background: #fff; border-radius: 8px;
    overflow: hidden; margin-bottom: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    position: relative; cursor: pointer;
    animation: fadeUp 0.4s ease both;
}
.photo-card.selected {
    box-shadow: 0 0 0 3px #ff2442, 0 4px 16px rgba(255,36,66,0.2);
}
@keyframes fadeUp {
    from { opacity:0; transform: translateY(16px); }
    to   { opacity:1; transform: translateY(0); }
}
.photo-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,0.1); }
.photo-card img { width: 100%; display: block; background: #fafafa; }
.photo-info { padding: 12px 14px; }
.photo-text {
    font-size: 14px; line-height: 1.5; color: #333; margin-bottom: 8px;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
    overflow: hidden; word-break: break-word;
}
.photo-meta { display: flex; justify-content: space-between; align-items: center; }
.photo-date { font-size: 12px; color: #999; }
.photo-user { font-size: 12px; color: #ff2442; font-weight: 500; }

.delete-btn {
    position: absolute; top: 8px; right: 8px;
    width: 28px; height: 28px; border-radius: 50%;
    background: rgba(0,0,0,0.55); border: none; color: #fff; font-size: 16px;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: opacity 0.2s, background 0.2s; backdrop-filter: blur(4px);
}
.delete-btn:hover { background: rgba(255,36,66,0.9); }
.photo-card:hover .delete-btn, .photo-card.selected .delete-btn { opacity: 1; }

.edit-btn {
    position: absolute; top: 8px; right: 44px;
    width: 28px; height: 28px; border-radius: 50%;
    background: rgba(0,0,0,0.55); border: none; color: #fff; font-size: 14px;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: opacity 0.2s, background 0.2s; backdrop-filter: blur(4px);
}
.edit-btn:hover { background: rgba(255,36,66,0.9); }
.photo-card:hover .edit-btn { opacity: 1; }

.caption-input {
    width: 100%;
    padding: 4px 6px;
    font-size: 14px;
    border: 1px solid #ff2442;
    border-radius: 4px;
    outline: none;
    box-sizing: border-box;
}

/* ============ 分组 ============ */
.group-tabs-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 0 40px 16px;
}
.group-tabs {
    display: flex; gap: 10px;
    overflow-x: auto; white-space: nowrap;
    flex-grow: 1; margin-right: 16px;
}
.group-tabs:empty { display: none; }
.group-manage-btn {
    padding: 6px 12px; border-radius: 8px;
    background: #fff; border: 1px solid #ddd;
    color: #666; font-size: 12px; cursor: pointer;
    flex-shrink: 0; transition: all 0.2s;
}
.group-manage-btn:hover { background: #f5f5f5; border-color: #ff2442; color: #ff2442; }
.group-tab {
    padding: 6px 16px; border-radius: 18px; background: #f5f5f5;
    color: #666; font-size: 14px; cursor: pointer; transition: all 0.2s;
    flex-shrink: 0;
}
.group-tab:hover { background: #ffe8ec; color: #ff2442; }
.group-tab.active { background: #ff2442; color: #fff; }

.group-select-group { margin: 12px 0; }
.group-select-group label { display: block; font-size: 13px; color: #666; margin-bottom: 6px; }
.group-select-row {
    display: flex; gap: 8px;
}
.group-select {
    flex: 1; padding: 8px 12px; border: 1px solid #e5e5e5; border-radius: 6px;
    font-size: 14px; background: #fff; cursor: pointer; outline: none;
    transition: border-color 0.2s;
}
.group-select:focus { border-color: #ff2442; }
.btn-create-group {
    padding: 8px 14px; background: #fff; color: #ff2442; border: 1px solid #ff2442;
    border-radius: 6px; cursor: pointer; font-size: 14px;
    white-space: nowrap;
}
.btn-create-group:hover { background: #ffe8ec; }

.group-add-row {
    display: flex; gap: 8px; margin-bottom: 16px;
}
.group-add-row input {
    flex: 1; padding: 8px 12px; border: 1px solid #e5e5e5; border-radius: 6px;
    font-size: 14px; outline: none;
}
.group-add-row input:focus { border-color: #ff2442; }
.group-add-row button {
    padding: 8px 20px; background: #ff2442; color: #fff; border: none;
    border-radius: 6px; cursor: pointer; font-size: 14px;
}
.group-add-row button:hover { background: #e0203a; }

.group-list { max-height: 400px; overflow-y: auto; }
.group-empty { text-align: center; color: #999; padding: 20px 0; font-size: 14px; }
.group-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 12px; border: 1px solid #f0f0f0; border-radius: 6px;
    margin-bottom: 8px;
}
.group-item-name { font-size: 14px; color: #333; flex-grow: 1; }
.group-item-input {
    flex-grow: 1; font-size: 14px; padding: 4px 8px;
    border: 1px solid #ff2442; border-radius: 4px;
    outline: none; background: #fff;
}
.group-item-actions { display: flex; gap: 6px; }
.group-item-up, .group-item-down {
    background: #fff; color: #666; border: 1px solid #ddd;
    padding: 4px 8px; border-radius: 4px; cursor: pointer; font-size: 11px;
    width: 28px; height: 28px; display: flex; align-items: center; justify-content: center;
}
.group-item-up:hover, .group-item-down:hover { background: #f5f5f5; border-color: #ff2442; color: #ff2442; }
.group-item-up:disabled, .group-item-down:disabled {
    opacity: 0.3; cursor: not-allowed;
}
.group-item-up:disabled:hover, .group-item-down:disabled:hover {
    background: #fff; border-color: #ddd; color: #666;
}
.group-item-edit {
    background: #fff; color: #666; border: 1px solid #ddd;
    padding: 4px 10px; border-radius: 4px; cursor: pointer; font-size: 12px;
}
.group-item-edit:hover { background: #f5f5f5; border-color: #ff2442; color: #ff2442; }
.group-item-save {
    background: #fff; color: #4CAF50; border: 1px solid #4CAF50;
    padding: 4px 10px; border-radius: 4px; cursor: pointer; font-size: 12px;
}
.group-item-save:hover { background: #4CAF50; color: #fff; }
.group-item-cancel {
    background: #fff; color: #999; border: 1px solid #ddd;
    padding: 4px 10px; border-radius: 4px; cursor: pointer; font-size: 12px;
}
.group-item-cancel:hover { background: #f5f5f5; border-color: #999; }
.group-item-del {
    background: #fff; color: #ff2442; border: 1px solid #ff2442;
    padding: 4px 10px; border-radius: 4px; cursor: pointer; font-size: 12px;
}
.group-item-del:hover { background: #ff2442; color: #fff; }

.photo-group-tag {
    display: inline-block; font-size: 12px; color: #ff2442;
    background: #fff3f4; padding: 2px 8px; border-radius: 10px;
    margin-bottom: 6px;
}

.group-btn {
    position: absolute; top: 8px; right: 80px;
    width: 28px; height: 28px; border-radius: 50%;
    background: rgba(0,0,0,0.55); border: none; color: #fff; font-size: 14px;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: opacity 0.2s, background 0.2s; backdrop-filter: blur(4px);
}
.group-btn:hover { background: rgba(255,36,66,0.9); }
.photo-card:hover .group-btn { opacity: 1; }

.select-checkbox {
    position: absolute; top: 8px; left: 8px;
    width: 20px; height: 20px; opacity: 0;
    transition: opacity 0.2s; cursor: pointer;
}
.photo-card:hover .select-checkbox, .photo-card.selected .select-checkbox {
    opacity: 1;
}
.select-checkbox input {
    width: 100%; height: 100%;
    cursor: pointer;
    accent-color: #ff2442;
}

/* ============ Empty State ============ */
.empty-state {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; padding: 80px 20px; color: #999; gap: 16px;
}
.empty-state p { font-size: 15px; }
.empty-state.hidden { display: none; }

/* ============ Modals ============ */
.modal-overlay {
    display: none; position: fixed; top:0; left:0;
    width:100%; height:100%; background: rgba(0,0,0,0.45);
    z-index: 1000; justify-content: center; align-items: center;
    animation: fadeIn 0.2s ease;
}
.modal-overlay.active { display: flex; }
@keyframes fadeIn { from{opacity:0} to{opacity:1} }

.modal {
    background: #fff; border-radius: 12px;
    width: 480px; max-width: 92vw; max-height: 85vh;
    overflow: hidden; display: flex; flex-direction: column;
    box-shadow: 0 16px 48px rgba(0,0,0,0.2);
    animation: slideUp 0.25s ease;
}
@keyframes slideUp {
    from { transform: translateY(30px); opacity:0; }
    to   { transform: translateY(0); opacity:1; }
}
.modal-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 16px 20px; border-bottom: 1px solid #f0f0f0;
}
.modal-header h2 { font-size: 16px; font-weight: 600; }
.modal-close {
    width: 32px; height: 32px; border-radius: 50%; border: none;
    background: #f5f5f5; font-size: 18px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: #666; transition: background 0.2s;
}
.modal-close:hover { background: #eee; }
.modal-body { padding: 20px; overflow-y: auto; flex:1; }
.modal-footer {
    display: flex; justify-content: flex-end; gap: 12px;
    padding: 16px 20px; border-top: 1px solid #f0f0f0;
}

/* Dropzone */
.upload-dropzone {
    border: 2px dashed #e0e0e0; border-radius: 8px; padding: 24px;
    text-align: center; cursor: pointer; transition: border-color 0.2s, background 0.2s;
    margin-bottom: 16px; position: relative;
}
.upload-dropzone.drag-over { border-color: #ff2442; background: rgba(255,36,66,0.04); }
.dropzone-content p { font-size: 14px; color: #666; margin-top: 8px; }
.dropzone-hint { font-size: 12px; color: #bbb; margin-top: 4px; display: block; }
.preview-list { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.preview-item {
    position: relative; width: 72px; height: 72px; border-radius: 6px;
    overflow: hidden; border: 1px solid #eee;
}
.preview-item img { width:100%; height:100%; object-fit:cover; }
.preview-item .remove-preview {
    position: absolute; top: 2px; right: 2px; width: 18px; height: 18px;
    border-radius: 50%; background: rgba(0,0,0,0.6); border: none; color: #fff;
    font-size: 12px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}

/* Caption */
.caption-input-wrap { position: relative; }
.caption-input-wrap textarea {
    width: 100%; min-height: 80px; max-height: 150px;
    border: 1px solid #e8e8e8; border-radius: 8px; padding: 12px;
    font-size: 14px; line-height: 1.6; resize: vertical; font-family: inherit;
    transition: border-color 0.2s;
}
.caption-input-wrap textarea:focus { outline: none; border-color: #ff2442; }
.caption-input-wrap textarea::placeholder { color: #bbb; }
.caption-count { position: absolute; bottom: 8px; right: 12px; font-size: 12px; color: #bbb; }

/* Buttons */
.btn-cancel {
    background: #f5f5f5; color: #666; border: none; padding: 8px 24px;
    border-radius: 20px; font-size: 14px; cursor: pointer; transition: background 0.2s;
}
.btn-cancel:hover { background: #eee; }
.btn-submit {
    background: #ff2442; color: #fff; border: none; padding: 8px 24px;
    border-radius: 20px; font-size: 14px; font-weight: 600;
    cursor: pointer; transition: all 0.2s;
}
.btn-submit:hover:not(:disabled) { background: #e0203a; }
.btn-submit:disabled { opacity:0.4; cursor:not-allowed; }

/* ============ Lightbox ============ */
.lightbox {
    display: none; position: fixed; top:0; left:0; width:100%; height:100%;
    background: rgba(0,0,0,0.92); z-index: 2000;
    justify-content: center; align-items: center; flex-direction: column;
    animation: fadeIn 0.2s;
}
.lightbox.active { display: flex; }
.lightbox img { max-width: 88%; max-height: 78vh; border-radius: 4px; object-fit: contain; }
.lightbox-info { color: #fff; margin-top: 20px; max-width: 600px; padding: 0 20px; text-align: center; }
.lightbox-info p { font-size: 15px; line-height: 1.6; margin-bottom: 6px; }
.lightbox-info span { font-size: 12px; color: rgba(255,255,255,0.5); }
.lightbox-close {
    position: absolute; top: 20px; right: 24px; width: 40px; height: 40px;
    border-radius: 50%; background: rgba(255,255,255,0.1); border: none;
    color: #fff; font-size: 24px; cursor: pointer;
    display: flex; align-items: center; justify-content: center; transition: background 0.2s;
}
.lightbox-close:hover { background: rgba(255,255,255,0.2); }

/* ============ Confirm Dialog ============ */
.confirm-overlay {
    display: none; position: fixed; top:0; left:0; width:100%; height:100%;
    background: rgba(0,0,0,0.4); z-index: 3000;
    justify-content: center; align-items: center;
}
.confirm-overlay.active { display: flex; }
.confirm-box {
    background: #fff; border-radius: 12px; padding: 28px;
    text-align: center; min-width: 300px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.15);
}
.confirm-msg { font-size: 15px; color: #333; margin-bottom: 24px; }
.confirm-actions { display: flex; gap: 12px; justify-content: center; }
.btn-delete {
    background: #ff2442; color: #fff; border: none; padding: 8px 28px;
    border-radius: 20px; font-size: 14px; font-weight: 600;
    cursor: pointer; transition: background 0.2s;
}
.btn-delete:hover { background: #e0203a; }

/* ============ Toast ============ */
.toast {
    position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%);
    background: rgba(0,0,0,0.78); color: #fff; padding: 10px 24px;
    border-radius: 20px; font-size: 14px; z-index: 9999;
    opacity: 0; transition: opacity 0.3s; pointer-events: none;
}
.toast.show { opacity: 1; }

/* ============ Spinner ============ */
.spinner {
    display: inline-block; width: 16px; height: 16px;
    border: 2px solid rgba(255,255,255,0.3); border-top-color: #fff;
    border-radius: 50%; animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ Content Tabs ============ */
.content-tabs {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 16px 0 0;
    background: #f5f5f5;
}
.content-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 20px;
    border-radius: 20px 20px 0 0;
    background: #e8e8e8;
    color: #666;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}
.content-tab:hover {
    background: #ddd;
    color: #333;
}
.content-tab.active {
    background: #fff;
    color: #ff2442;
}

/* ============ Notes Masonry ============ */
.notes-masonry {
    column-count: 4;
    column-gap: 16px;
}
@media (max-width: 1100px) { .notes-masonry { column-count: 3; } }
@media (max-width: 768px)  { .notes-masonry { column-count: 2; column-gap: 12px; } }
@media (max-width: 480px)  { .notes-masonry { column-count: 1; max-width: 400px; margin:0 auto; } }

/* ============ Note Card ============ */
.note-card {
    break-inside: avoid;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    position: relative;
    animation: fadeUp 0.4s ease both;
    min-height: 100px;
}
.note-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}
.note-content {
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    white-space: pre-wrap;
    word-break: break-word;
    margin-bottom: 12px;
}
.note-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 8px;
    border-top: 1px solid rgba(0,0,0,0.08);
}
.note-date {
    font-size: 12px;
    color: rgba(0,0,0,0.5);
}
.note-group-tag {
    font-size: 11px;
    color: #ff2442;
    background: rgba(255,36,66,0.1);
    padding: 1px 6px;
    border-radius: 8px;
}
.note-user {
    font-size: 12px;
    color: #ff2442;
    font-weight: 500;
}
.note-edit-btn, .note-delete-btn {
    position: absolute;
    top: 8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(0,0,0,0.55);
    border: none;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s, background 0.2s;
    backdrop-filter: blur(4px);
}
.note-edit-btn {
    right: 44px;
}
.note-delete-btn {
    right: 8px;
    font-size: 16px;
}
.note-edit-btn:hover, .note-delete-btn:hover {
    background: rgba(255,36,66,0.9);
}
.note-card:hover .note-edit-btn,
.note-card:hover .note-delete-btn {
    opacity: 1;
}

/* ============ Note Modal ============ */
.note-color-picker {
    margin-bottom: 16px;
}
.note-color-label {
    display: block;
    font-size: 13px;
    color: #666;
    margin-bottom: 8px;
    font-weight: 500;
}
.note-color-options {
    display: flex;
    gap: 10px;
}
.note-color-option {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}
.note-color-option:hover {
    transform: scale(1.1);
}
.note-color-option.active {
    border-color: #ff2442;
    box-shadow: 0 0 0 2px rgba(255,36,66,0.2);
}
.note-textarea-wrap {
    position: relative;
}
.note-textarea-wrap textarea {
    width: 100%;
    min-height: 160px;
    max-height: 300px;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    padding: 12px;
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
    font-family: inherit;
    transition: border-color 0.2s;
    background: #fffef8;
}
.note-textarea-wrap textarea:focus {
    outline: none;
    border-color: #ff2442;
    background: #fff;
}
.note-textarea-wrap textarea::placeholder {
    color: #bbb;
}
.note-count {
    position: absolute;
    bottom: 8px;
    right: 12px;
    font-size: 12px;
    color: #bbb;
}

/* ============ Note Publish Button ============ */
.note-publish-btn { background: #F4A7B9; }
.upload-btn.goal-add-btn { background: #A5D6A7; }
.upload-btn.check-add-btn { background: #FFCC80; }
.upload-btn.article-add-btn { background: #CE93D8; }

/* ============ 移动端适配 ============ */
@media (max-width: 768px) {
    /* Header */
    .header-inner { padding: 0 12px; }
    .logo span { font-size: 14px; }
    .header-actions { gap: 6px; }
    .btn-link { padding: 6px 8px; font-size: 13px; }
    .upload-btn { padding: 6px 14px; font-size: 13px; }
    .username { font-size: 13px; }
    
    /* 分组标签栏 */
    .group-tabs-header { padding: 0 12px 12px; }
    .group-manage-btn { padding: 5px 10px; font-size: 11px; }
    .group-tab { padding: 5px 12px; font-size: 13px; }
    
    /* 内容区域 */
    .main-content { padding: 0 12px; margin: 16px auto; }
    .content-tabs { gap: 6px; }
    .content-tab { padding: 6px 16px; font-size: 13px; }
    
    /* 弹窗 */
    .modal { width: 96vw; max-height: 90vh; border-radius: 12px 12px 0 0; }
    .modal-header { padding: 12px 16px; }
    .modal-body { padding: 16px; }
    .modal-footer { padding: 12px 16px; }
    .auth-modal { max-width: 96vw; }
    
    /* 上传区域 */
    .upload-dropzone { padding: 16px; }
    .preview-item { width: 60px; height: 60px; }
    
    /* 照片卡片按钮 - 手机上始终显示 */
    .delete-btn, .edit-btn, .group-btn { opacity: 1; width: 32px; height: 32px; }
    .select-checkbox { opacity: 1; width: 24px; height: 24px; }
    
    /* 便签卡片按钮 - 手机上始终显示 */
    .note-edit-btn, .note-delete-btn { opacity: 1; width: 32px; height: 32px; }
    
    /* Lightbox */
    .lightbox img { max-width: 95%; max-height: 85vh; }
    .lightbox-close { top: 12px; right: 12px; width: 36px; height: 36px; }
    
    /* 确认框 */
    .confirm-box { min-width: 280px; padding: 24px; }
    
    /* Toast */
    .toast { bottom: 20px; padding: 8px 20px; font-size: 13px; }
    
    /* 批量操作栏 */
    .batch-bar { padding: 10px 12px; }
    .batch-group-select { min-width: 100px; font-size: 13px; }
    
    /* 分组管理弹窗 */
    .group-list { max-height: 300px; }
    .group-item { padding: 8px 10px; }
    .group-item-up, .group-item-down { width: 32px; height: 32px; }
    .group-item-edit, .group-item-save, .group-item-cancel, .group-item-del {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    /* 登录遮罩 */
    .login-overlay-content { padding: 24px; }
    .login-overlay-content .logo-icon { font-size: 48px; }
    .login-overlay-content h2 { font-size: 24px; }
    .login-buttons { flex-direction: column; gap: 10px; }
    .login-buttons .btn-submit, .login-buttons .btn-cancel { padding: 10px 24px; width: 100%; }
}

@media (max-width: 480px) {
    /* Header 进一步简化 */
    .logo svg { width: 28px; height: 28px; }
    .btn-link { padding: 4px 6px; }
    .upload-btn { padding: 5px 12px; gap: 4px; }
    .upload-btn svg { width: 14px; height: 14px; }
    
    /* 分组标签 */
    .group-tabs { gap: 6px; }
    .group-tab { padding: 4px 10px; font-size: 12px; }
    
    /* 内容标签 */
    .content-tab { padding: 5px 14px; font-size: 12px; gap: 4px; }
    
    /* 按钮 */
    .btn-submit, .btn-cancel { padding: 6px 18px; font-size: 13px; }
    .btn-delete { padding: 6px 20px; }
}

/* ============ 目标墙 ============ */
#goals-view { padding: 20px 24px; }

.goals-stats {
    display: flex; align-items: center; gap: 24px;
    margin-bottom: 24px; padding: 16px 20px;
    background: #fff; border-radius: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.goals-stat {
    display: flex; flex-direction: column; align-items: center;
    min-width: 60px;
}
.goals-stat-num {
    font-size: 22px; font-weight: 700; color: #333; line-height: 1.2;
}
.goals-stat-label {
    font-size: 12px; color: #999; margin-top: 2px;
}

.goals-progress-wrap {
    display: flex; align-items: center; gap: 10px; margin-left: auto;
    flex: 1; max-width: 300px;
}
.goals-progress-bar {
    flex: 1; height: 8px; background: #eee; border-radius: 4px; overflow: hidden;
}
.goals-progress-fill {
    height: 100%; background: linear-gradient(90deg, #ff2442, #ff6b81);
    border-radius: 4px; transition: width 0.4s ease;
}
.goals-progress-text {
    font-size: 14px; font-weight: 600; color: #ff2442; min-width: 38px; text-align: right;
}

.goals-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    align-items: start;
}

.goal-column {
    background: #fff; border-radius: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    overflow: hidden;
}

.goal-column-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 18px 12px;
    border-bottom: 1px solid #f0f0f0;
}
.goal-column-title {
    font-size: 14px; font-weight: 600; color: #333;
}
.goal-column-count {
    background: #f5f5f5; color: #999; font-size: 12px;
    padding: 2px 8px; border-radius: 10px;
}

.goal-column-body {
    padding: 12px;
    display: flex; flex-direction: column; gap: 10px;
    min-height: 80px;
}

/* 目标卡片 */
.goal-card {
    background: #fafafa; border-radius: 10px; padding: 14px;
    border: 1px solid #f0f0f0;
    position: relative; cursor: default;
    transition: box-shadow 0.2s, transform 0.2s;
}
.goal-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}
.goal-card.priority-high {
    border-left: 3px solid #ff2442;
}
.goal-card.priority-low {
    border-left: 3px solid #52c41a;
}

.goal-priority-badge {
    font-size: 11px; font-weight: 600; color: #fff;
    background: #ff2442; padding: 1px 6px; border-radius: 4px;
    display: inline-block; margin-bottom: 6px;
}

.goal-card-title {
    font-size: 14px; font-weight: 600; color: #222;
    line-height: 1.4; margin-bottom: 6px;
    word-break: break-word;
}

.goal-card-desc {
    font-size: 12px; color: #888; line-height: 1.5;
    margin-bottom: 8px; display: -webkit-box;
    -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden; word-break: break-word;
}

.goal-card-progress {
    display: flex; align-items: center; gap: 8px; margin-bottom: 6px;
}
.goal-card-progress-bar {
    flex: 1; height: 6px; background: #eee; border-radius: 3px; overflow: hidden;
}
.goal-card-progress-fill {
    height: 100%; background: linear-gradient(90deg, #1890ff, #69c0ff);
    border-radius: 3px; transition: width 0.3s;
}
.goal-card-progress-text {
    font-size: 11px; color: #999; min-width: 28px; text-align: right;
}

.goal-card-due {
    font-size: 11px; color: #aaa; margin-top: 4px;
}
.goal-card-due.overdue { color: #ff4d4f; font-weight: 600; }

.goal-card-actions {
    display: flex; gap: 4px; margin-top: 10px;
    justify-content: flex-end;
}
.goal-action-btn {
    width: 26px; height: 26px; border-radius: 6px; border: none;
    cursor: pointer; font-size: 13px; display: flex; align-items: center;
    justify-content: center; transition: background 0.15s;
}
.goal-action-btn.edit { background: #e6f7ff; color: #1890ff; }
.goal-action-btn.edit:hover { background: #bae7ff; }
.goal-action-btn.status { background: #f6ffed; color: #52c41a; }
.goal-action-btn.status:hover { background: #d9f7be; }
.goal-action-btn.delete { background: #fff1f0; color: #ff4d4f; }
.goal-action-btn.delete:hover { background: #ffccc7; }

/* 目标弹窗 */
.goal-meta-row {
    display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
#goal-title, #goal-description, #goal-priority, #goal-due-date, #goal-status {
    width: 100%; padding: 8px 12px; border: 1px solid #e8e8e8;
    border-radius: 8px; font-size: 14px; outline: none;
    transition: border-color 0.2s; background: #fff;
}
#goal-title:focus, #goal-description:focus, #goal-priority:focus,
#goal-due-date:focus, #goal-status:focus {
    border-color: #ff2442;
}
#goal-description { resize: vertical; min-height: 72px; }
#goal-progress {
    width: 100%; accent-color: #ff2442; cursor: pointer;
}

/* ============ 打卡墙 ============ */
#checks-view { padding: 20px 24px; }

.checks-stats {
    display: flex; align-items: center; gap: 24px;
    margin-bottom: 24px; padding: 16px 20px;
    background: #fff; border-radius: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.check-stat {
    display: flex; flex-direction: column; align-items: center;
    min-width: 60px;
}
.check-stat-num {
    font-size: 22px; font-weight: 700; color: #333; line-height: 1.2;
}
.check-stat-label {
    font-size: 12px; color: #999; margin-top: 2px;
}

.checks-timeline {
    display: flex; flex-direction: column; gap: 6px;
}

.check-card {
    background: #fff; border-radius: 8px; padding: 8px 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    position: relative;
    transition: box-shadow 0.2s, transform 0.2s;
}
.check-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}
.check-card.today {
    border-left: 3px solid #ff2442;
}

.check-card-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 0;
    gap: 8px;
}
.check-card-date {
    font-size: 13px; font-weight: 600; color: #666; flex-shrink: 0;
}
.check-card-mood {
    font-size: 24px; line-height: 1;
}
.check-card-task-tag {
    --task-color: #ff2442;
    font-size: 12px; font-weight: 600; color: var(--task-color);
    background: color-mix(in srgb, var(--task-color) 10%, white);
    padding: 2px 8px; border-radius: 4px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    max-width: 200px;
}

.check-card-content {
    font-size: 14px; line-height: 1.6; color: #333;
    word-break: break-word;
}

.check-card-actions {
    display: flex; gap: 4px; margin-top: 10px;
    justify-content: flex-end;
}
.check-action-btn {
    width: 26px; height: 26px; border-radius: 6px; border: none;
    cursor: pointer; font-size: 13px; display: flex; align-items: center;
    justify-content: center; transition: background 0.15s;
}
.check-action-btn.edit { background: #e6f7ff; color: #1890ff; }
.check-action-btn.edit:hover { background: #bae7ff; }
.check-action-btn.delete { background: #fff1f0; color: #ff4d4f; }
.check-action-btn.delete:hover { background: #ffccc7; }

/* 心情选择器 */
.mood-picker {
    display: flex; gap: 6px; flex-wrap: wrap;
}
.mood-option {
    width: 38px; height: 38px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.15s;
    background: #f5f5f5;
}
.mood-option:hover { background: #eee; transform: scale(1.1); }
.mood-option.selected {
    border-color: #ff2442;
    background: #fff0f0;
    transform: scale(1.15);
}

/* 任务区块 */
.check-tasks-header,
.check-records-header {
    display: flex; align-items: center; justify-content: space-between;
    margin: 24px 0 12px;
}
.check-tasks-title {
    font-size: 15px; font-weight: 600; color: #333; margin: 0;
}
.check-add-task-btn {
    background: #ff2442; color: #fff; border: none;
    padding: 6px 14px; border-radius: 6px; font-size: 13px;
    cursor: pointer; transition: background 0.15s;
}
.check-add-task-btn:hover { background: #e51e3a; }

.check-tasks-grid {
    display: grid; gap: 12px;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.check-tasks-empty {
    grid-column: 1 / -1;
    text-align: center; padding: 24px; color: #999;
    background: #fff; border-radius: 10px;
    border: 1px dashed #e0e0e0;
}

.check-task-card {
    --task-color: #ff2442;
    background: #fff; border-radius: 10px; padding: 10px 14px 24px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    display: flex; align-items: center; gap: 10px;
    position: relative; transition: box-shadow 0.2s, transform 0.2s;
    border-left: 3px solid var(--task-color);
}
.check-task-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.1); transform: translateY(-1px); }
.check-task-card.done { background: #fafafa; }
.check-task-card.done .check-task-icon { filter: grayscale(0.3); }

.check-task-icon {
    font-size: 24px; line-height: 1; flex-shrink: 0;
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    background: color-mix(in srgb, var(--task-color) 10%, white);
    border-radius: 50%;
}
.check-task-card.done .check-task-icon {
    background: var(--task-color);
    color: #fff;
}

.check-task-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.check-task-name {
    font-size: 14px; font-weight: 600; color: #333;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.check-task-desc {
    font-size: 11px; color: #999;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.check-task-meta {
    display: flex; gap: 10px; margin-top: 2px;
    font-size: 11px; color: #999; align-items: center;
    white-space: nowrap;
}
.check-task-meta b { color: var(--task-color); font-weight: 600; font-size: 12px; }
.check-task-meta .dot { color: #ddd; }

.check-task-btn {
    flex-shrink: 0; padding: 5px 12px; border-radius: 6px;
    border: 1px solid var(--task-color); background: #fff;
    color: var(--task-color); font-size: 12px; font-weight: 500;
    cursor: pointer; transition: all 0.15s;
    white-space: nowrap;
}
.check-task-btn:hover { background: var(--task-color); color: #fff; }
.check-task-btn.done {
    background: var(--task-color); color: #fff;
}

.check-task-card-actions {
    position: absolute; bottom: 4px; right: 8px;
    display: flex; gap: 3px;
}
.check-task-action {
    width: 20px; height: 20px; border-radius: 4px; border: none;
    cursor: pointer; font-size: 11px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,0.04); color: #888;
    transition: all 0.15s;
}
.check-task-action:hover { background: rgba(0,0,0,0.1); color: #333; }
.check-task-action.edit:hover { background: rgba(24,144,255,0.15); color: #1890ff; }
.check-task-action.danger:hover { background: rgba(255,77,79,0.15); color: #ff4d4f; }
.check-task-card.hidden { opacity: 0.5; }
.check-task-card.hidden .check-task-name { text-decoration: line-through; }
.check-task-btn:disabled { background: #ccc !important; cursor: not-allowed; }

/* 任务详情弹窗 */
.task-detail-summary {
    margin-bottom: 16px;
}
.task-detail-summary-inner {
    display: flex; gap: 20px;
    padding: 12px 16px;
    background: #fafafa; border-radius: 8px;
}
.task-detail-stat {
    font-size: 12px; color: #999;
}
.task-detail-stat b {
    font-size: 15px; color: #333;
    font-weight: 600;
}

.task-detail-empty {
    text-align: center; padding: 32px; color: #999;
}

.task-detail-month + .task-detail-month {
    margin-top: 16px;
}
.task-detail-month-header {
    font-size: 13px; font-weight: 600; color: #666;
    margin-bottom: 8px; padding-bottom: 6px;
    border-bottom: 1px solid #f0f0f0;
}

.task-detail-row {
    display: grid; grid-template-columns: auto auto 28px 1fr 28px;
    align-items: center; gap: 8px;
    padding: 8px 10px; margin: 0 -8px 4px; border-radius: 6px;
    background: #fafafa;
    font-size: 13px;
    transition: background 0.15s;
}
.task-detail-row:hover { background: #f0f0f0; }
.task-detail-row:last-child { border-bottom: none; }
.task-detail-row.today { background: #fff8f8; }
.task-detail-row-date {
    font-weight: 600; color: #333;
    font-variant-numeric: tabular-nums;
}
.task-detail-row-weekday {
    color: #999; font-size: 11px;
}
.task-detail-row-mood {
    font-size: 16px; text-align: center;
}
.task-detail-row-note {
    color: #666; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.task-detail-row-edit {
    background: none; border: none; cursor: pointer;
    font-size: 15px; padding: 2px; opacity: 0.5;
    transition: opacity 0.15s;
}
.task-detail-row-edit:hover { opacity: 1; }

/* 图标/颜色选择器 */
.icon-picker {
    display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px;
}
.icon-option {
    width: 38px; height: 38px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; cursor: pointer;
    background: #f5f5f5; border: 2px solid transparent;
    transition: all 0.15s;
}
.icon-option:hover { background: #eee; }
.icon-option.selected {
    border-color: #ff2442; background: #fff0f0;
}

.color-picker { display: flex; gap: 8px; flex-wrap: wrap; }
.color-option {
    width: 28px; height: 28px; border-radius: 50%;
    cursor: pointer; border: 2px solid transparent;
    transition: transform 0.15s;
}
.color-option:hover { transform: scale(1.15); }
.color-option.selected {
    border-color: #fff; box-shadow: 0 0 0 2px #333;
}

@media (max-width: 768px) {
    #goals-view { padding: 12px; }
    .goals-stats { flex-wrap: wrap; gap: 12px; padding: 12px; }
    .goals-progress-wrap { max-width: 100%; margin-left: 0; width: 100%; }
    .goals-board { grid-template-columns: 1fr; gap: 12px; }
    .goal-meta-row { grid-template-columns: 1fr; }
    #checks-view { padding: 12px; }
    .checks-stats { flex-wrap: wrap; gap: 12px; padding: 12px; }
    .checks-timeline { max-width: 100%; }
    .check-tasks-grid { grid-template-columns: 1fr; }
    .icon-picker { grid-template-columns: repeat(6, 1fr); }
    .icon-option { width: 36px; height: 36px; font-size: 18px; }
}
/* ============ 笔记墙 ============ */
.articles-list {
    display: flex; flex-direction: column; gap: 16px;
}
.article-card {
    background: #fff; border-radius: 12px; padding: 20px 24px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    cursor: pointer; transition: all 0.2s ease;
    position: relative;
    animation: fadeUp 0.4s ease both;
}
.article-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}
.article-card-header {
    display: flex; justify-content: space-between;
    align-items: flex-start; gap: 12px;
    margin-bottom: 10px;
}
.article-card-title {
    font-size: 18px; font-weight: 600; color: #222;
    line-height: 1.4; flex: 1;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden;
}
.article-card-actions {
    display: flex; gap: 4px; flex-shrink: 0;
    opacity: 0; transition: opacity 0.2s;
}
.article-card:hover .article-card-actions { opacity: 1; }
.article-action-btn {
    width: 30px; height: 30px; border-radius: 8px;
    border: 1px solid #eee; cursor: pointer; font-size: 14px;
    display: flex; align-items: center; justify-content: center;
    background: #fff; color: #999; transition: all 0.2s;
}
.article-action-btn.edit:hover { background: #e3f2fd; color: #2196f3; border-color: #bbdefb; }
.article-action-btn.delete:hover { background: #ffe8ec; color: #ff2442; border-color: #ef9a9a; }
.article-card-excerpt {
    font-size: 14px; color: #666; line-height: 1.7;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
    overflow: hidden; margin-bottom: 12px;
}
.article-card-meta {
    display: flex; justify-content: space-between;
    align-items: center; padding-top: 12px;
    border-top: 1px solid #f5f5f5;
}
.article-card-date { font-size: 12px; color: #aaa; }
.article-group-tag {
    display: inline-block; padding: 2px 10px;
    background: #f3e5f5; color: #9c27b0;
    border-radius: 12px; font-size: 11px; font-weight: 500;
}

/* 笔记详情弹窗 */
.article-detail-modal { width: 960px; max-width: 96vw; }
.article-detail-title {
    font-size: 22px; font-weight: 700; color: #222;
    margin-bottom: 16px; line-height: 1.4;
}
.article-detail-content {
    font-size: 15px; color: #444; line-height: 1.9;
    white-space: pre-wrap; word-break: break-word;
    margin-bottom: 16px;
}
.article-detail-meta {
    display: flex; justify-content: space-between;
    align-items: center; margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 12px; color: #999;
}

/* 笔记发布/编辑弹窗 */
.modal.article-modal { width: 960px; max-width: 96vw; }
.article-editor { margin-bottom: 12px; }
.article-editor textarea {
    width: 100%; min-height: 280px; padding: 14px;
    border: 1px solid #e5e5e5; border-radius: 8px;
    font-size: 15px; line-height: 1.8; resize: vertical;
    outline: none; font-family: inherit;
    transition: border-color 0.2s;
}
.article-editor textarea:focus { border-color: #ff2442; }
.article-toolbar {
    display: flex; gap: 6px; margin-top: 8px;
}
.article-tool-btn {
    width: 32px; height: 32px; border-radius: 6px;
    border: 1px solid #e5e5e5; cursor: pointer;
    background: #fff; color: #666; font-size: 14px;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
}
.article-tool-btn:hover { background: #f5f5f5; border-color: #ccc; }
.article-count {
    font-size: 12px; color: #999; text-align: right;
    margin-bottom: 8px;
}

/* 笔记分组标签 */
#articles-group-tabs {
    display: flex; gap: 10px;
    overflow-x: auto; white-space: nowrap;
    flex-grow: 1;
}

/* 手机适配 */
@media (max-width: 768px) {
    .articles-list { gap: 10px; }
    .article-card { padding: 16px; }
    .article-card-title { font-size: 16px; }
    .article-card-excerpt { font-size: 13px; -webkit-line-clamp: 2; }
    .article-card-actions { opacity: 1; }
    .article-detail-modal { max-width: 94vw; }
    .article-modal { max-width: 94vw; }
    .article-editor textarea { min-height: 200px; }
    .article-toolbar { flex-wrap: wrap; }
    .article-detail-title { font-size: 18px; }
    .article-detail-content { font-size: 14px; }
}

/* ============ 工具箱 ============ */
.tools-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.tool-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
    cursor: default;
}
.tool-card.dragging {
    opacity: 0.5;
    transform: scale(0.98);
}
.tool-card.drag-over {
    box-shadow: 0 0 0 2px #ff2442, 0 4px 16px rgba(255,36,66,0.15);
}
.tool-drag-handle {
    cursor: grab;
    font-size: 16px;
    color: #ccc;
    letter-spacing: -4px;
    user-select: none;
    padding: 2px 6px;
    margin-right: 6px;
    border-radius: 4px;
    transition: color 0.2s, background 0.2s;
    line-height: 1;
}
.tool-drag-handle:hover {
    color: #ff2442;
    background: #fff0f0;
}
.tool-drag-handle:active {
    cursor: grabbing;
}
.tool-card-header {
    display: flex;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid #f0f0f0;
}
.tool-card-header h3 {
    font-size: 15px;
    flex: 1;
    font-weight: 600;
    color: #333;
    margin: 0;
}
.tool-card-actions {
    display: flex;
    gap: 6px;
}
.tool-action-btn {
    padding: 4px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: #fafafa;
    color: #555;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}
.tool-action-btn:hover {
    background: #ff2442;
    color: #fff;
    border-color: #ff2442;
}
.tool-card-body {
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.tool-card-body.tool-row {
    flex-direction: row;
    gap: 20px;
}
.tool-card-body.tool-row .tool-input-group {
    flex: 1;
}
.tool-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    font-size: 13px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    resize: vertical;
    outline: none;
    transition: border-color 0.2s;
    line-height: 1.5;
}
.tool-textarea:focus {
    border-color: #ff2442;
}
.tool-textarea.tool-output {
    background: #f9f9f9;
    color: #555;
}
.tool-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    font-size: 13px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    outline: none;
    transition: border-color 0.2s;
}
.tool-input:focus {
    border-color: #ff2442;
}
.tool-input-group {
    flex: 1;
}
.tool-input-group label {
    display: block;
    font-size: 12px;
    color: #999;
    margin-bottom: 4px;
}
.tool-error {
    font-size: 12px;
    color: #ff2442;
    padding: 0 18px 12px;
    margin: 0;
    min-height: 18px;
}
.text-stats-result {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}
.text-stats-result span {
    font-size: 13px;
    color: #666;
}
.text-stats-result strong {
    color: #ff2442;
}

/* ============ 利润计算器 ============ */
.profit-calc .tool-card-body {
    padding: 16px 18px 20px;
}
.profit-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.profit-row {
    display: flex;
    gap: 14px;
}
.profit-field {
    flex: 1;
    position: relative;
}
.profit-field label {
    display: block;
    font-size: 12px;
    color: #999;
    margin-bottom: 4px;
}
.profit-unit {
    font-size: 11px;
    color: #bbb;
    margin-left: 2px;
}
.profit-result {
    display: flex;
    gap: 24px;
    margin-top: 4px;
    padding-top: 12px;
    border-top: 1px dashed #e5e5e5;
}
.profit-item {
    display: flex;
    align-items: center;
    gap: 8px;
}
.profit-item span {
    font-size: 13px;
    color: #666;
}
.profit-item strong {
    font-size: 18px;
    font-weight: 700;
}

@media (max-width: 768px) {
    .tools-grid {
        grid-template-columns: 1fr;
    }
    .tool-card-body.tool-row {
        flex-direction: column;
    }
    .profit-row {
        flex-direction: column;
    }
}
