body {
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; /* Modern font stack */
    margin: 0;
    background-color: #F7F8FA; /* Lighter page BG */
    color: #1A202C; /* Darker text */
}

header {
    background-color: #FFFFFF; /* Header BG */
    color: #1A202C; /* Dark text */
    padding: 1rem 1rem 0.5rem 1rem;
    display: block;
    border-bottom: 1px solid #E2E8F0; /* Lighter border */
    position: sticky;
    top: 0;
    z-index: 1100; /* 高于主内容和返回顶部按钮 */
    box-shadow: 0 2px 8px rgba(0,0,0,0.04); /* 可选：微弱阴影 */
}

header h1 {
    margin: 0;
    text-align: center;
    font-size: 2em;
    font-weight: bold;
    width: 100%;
    display: block;
}

.controls-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 1rem;
    margin: 1.5rem 0 1rem 0;
    flex-wrap: wrap;
}

#tag-list-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    flex: 1;
}

.tag-filter-btn {
    background: #F1F3F5; /* Light grey BG */
    color: #4A5568; /* Darker grey text */
    border: none;
    border-radius: 16px; /* Pill shape */
    padding: 0.4em 1em; /* Adjust padding for pill */
    font-size: 0.95em;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}
.tag-filter-btn.selected {
    background: #4A90E2; /* Primary blue accent */
    color: #fff; /* White text */
    font-weight: bold;
}
.tag-filter-btn:hover:not(.selected) {
    background: #E2E8F0; /* Slightly darker grey on hover */
}

#add-prompt-btn {
    padding: 10px 1.2rem; /* Slightly larger padding */
    background-color: #4A90E2; /* Primary blue accent */
    color: white;
    border: none;
    border-radius: 21px;
    cursor: pointer;
    margin-left: 1rem;
    flex-shrink: 0;
    font-size: 1em;
    font-weight: bold; /* Make it stand out */
}

#add-prompt-btn:hover {
    background-color: #357ABD; /* Darker blue on hover */
}

#prompt-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
    padding: 1rem;
}

.prompt-card {
    height: 400px;
    background-color: #FFFFFF; /* Card BG */
    border: 1px solid #E2E8F0; /* Lighter Card Border */
    border-radius: 8px; /* Softer corners */
    padding: 1.25rem; /* Increased padding */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06); /* Subtle shadow */
    display: flex;
    flex-direction: column;
    position: relative;
    transition: box-shadow 0.5s;
    cursor: grab; /* Indicate draggable */
}

.prompt-card:hover {
    box-shadow: 0 0 10px 10px rgba(0, 0, 0, 0.3); 
    transition: box-shadow 0.5s;
}

/* Styles for SortableJS drag operations */
.sortable-ghost {
    opacity: 0.4;
    background: #c8ebfb;
    border: 2px dashed #007bff;
}

.sortable-chosen {
    /* Styles for the item being actively dragged (optional) */
    /* Example: slightly larger shadow or border */
    box-shadow: 0 6px 12px rgba(0,0,0,0.2);
    transform: scale(1.02); /* Slightly scale up the chosen item */
}

.sortable-drag {
    /* Styles for the clone of the item being dragged (optional) */
    opacity: 0.9;
    transform: rotate(2deg); /* Slightly rotate the dragged item */
}

.prompt-card h3 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0;
    margin-bottom: 0.75rem; /* Increased spacing */
    font-size: 1.15em; /* Slightly smaller */
    font-weight: 600; /* Semi-bold */
    gap: 0.5em;
    color: #2D3748; /* Slightly softer title color */
}

.prompt-tags {
    margin-bottom: 0.75rem; /* Increased spacing */
    font-size: 0.85em; /* Slightly smaller */
    color: #718096; /* Lighter grey for secondary info */
}

.prompt-tags .tag {
    display: inline-block;
    background-color: #F1F3F5; /* Unified light grey BG */
    color: #4A5568; /* Darker grey text */
    padding: 0.25em 0.8em; /* Adjust padding */
    border-radius: 6px; /* Consistent radius */
    margin-right: 0.4em;
    margin-bottom: 0.4em; /* Handle wrapping */
}

.prompt-body-container {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    max-height: 350px; /* Limit height and enable scroll */
    border: 1px solid #E2E8F0; /* Lighter border */
    padding: 0.75rem; /* Increased padding */
    white-space: pre-wrap;
    word-wrap: break-word;
    background-color: #F7F8FA; /* Match page background */
    position: relative;
    font-size: 0.95em; /* Adjust body font size */
    line-height: 1.6; /* Improved readability */
    color: #4A5568; /* Softer text color */
    margin-bottom: 0; /* Fixed space below body */
}

/* Custom Scrollbar for Webkit browsers */
.prompt-body-container::-webkit-scrollbar {
    width: 6px; /* Slimmer scrollbar */
}

.prompt-body-container::-webkit-scrollbar-track {
    background: #F7F8FA; /* Match container background */
    border-radius: 3px;
}

.prompt-body-container::-webkit-scrollbar-thumb {
    background-color: #CBD5E0; /* Grey scrollbar handle */
    border-radius: 3px;
    border: 1px solid #F7F8FA; /* Add border to match track */
}

.prompt-body-container::-webkit-scrollbar-thumb:hover {
    background-color: #A0AEC0; /* Darker grey on hover */
}

/* Modal Styles */
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1000; /* 提高优先级，确保在所有内容之上 */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
}

.modal-content {
    background-color: #FFFFFF;
    margin: 10% auto;
    padding: 25px; /* Increased padding */
    border: 1px solid #E2E8F0; /* Lighter border */
    width: 80%;
    max-width: 600px;
    border-radius: 8px; /* Consistent radius */
    position: relative;
    box-shadow: 0 5px 15px rgba(0,0,0,0.15); /* Add shadow */
}

.modal-content h2 {
    text-align: center;
}

/* Confirmation Modal Specific Styles */
.confirm-modal-content {
    max-width: 400px; /* Smaller width for confirmation */
    text-align: center;
    padding: 2rem;
}

#confirm-message {
    margin-bottom: 1.5rem;
    font-size: 1.1em;
}

.confirm-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

/* General button styles (can be reused) */
.btn {
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 6px; /* Consistent radius */
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.2s, box-shadow 0.2s;
    font-weight: 500; /* Medium weight */
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}
.btn-danger:hover {
    background-color: #c82333;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.btn-secondary {
    background-color: #E2E8F0; /* Lighter grey */
    color: #2D3748; /* Dark text */
}
.btn-secondary:hover {
    background-color: #CBD5E0; /* Darker grey */
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.close-btn {
    color: #A0AEC0; /* Lighter close button */
    position: absolute;
    top: 15px; /* Adjust position */
    right: 15px; /* Adjust position */
    font-size: 24px; /* Slightly smaller */
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.close-btn:hover,
.close-btn:focus {
    color: #4A5568; /* Darker grey on hover */
    text-decoration: none;
    cursor: pointer;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.4rem; /* Adjust spacing */
    font-weight: 500; /* Medium weight labels */
    color: #4A5568;
}

/* Reset input/textarea styles for consistency */
.form-group input[type="text"],
.form-group textarea,
.form-group .tag-input-container { /* Apply common styles */
    width: 100%; /* Use 100% and box-sizing */
    padding: 0.6rem 0.8rem; /* Consistent padding */
    border: 1px solid #CBD5E0; /* Lighter border */
    background-color: #FFFFFF;
    border-radius: 6px; /* Consistent radius */
    box-sizing: border-box;
    font-size: 1em;
    color: #2D3748;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px; /* Set a minimum height */
    line-height: 1.6; /* Improve readability */
}

#prompt-form button[type="submit"] {
    padding: 0.7rem 1.5rem;
    background-color: #4A90E2; /* Blue accent */
    color: white;
    border: none;
    border-radius: 6px; /* Consistent radius */
    cursor: pointer;
    font-weight: bold; /* Bold submit text */
}

#prompt-form button[type="submit"]:hover {
    background-color: #357ABD; /* Darker blue */
}

.icon-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    display: inline-flex; /* Use inline-flex */
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    width: 32px; /* Slightly larger touch target */
    height: 32px; /* Slightly larger touch target */
    transition: background-color 0.2s, color 0.2s;
    color: #718096; /* Medium grey for icons */
    vertical-align: middle; /* Align better with text if needed */
}

.icon-btn img {
    width: 18px; /* Adjust icon size */
    height: 18px; /* Adjust icon size */
}

/* Specific hover colors if needed, otherwise remove */
.copy-btn:hover {
     background-color: #38A169; /* Lighter green background */
     opacity: 0.8; /* Slightly transparent */
}

.edit-btn:hover {
     background-color: #D69E2E; /* Lighter yellow background */
     opacity: 0.8; /* Slightly transparent */
}

.delete-btn:hover {
     background-color: #E53E3E; /* Lighter red background */
     opacity: 0.8; /* Slightly transparent */
}

/* 多标签输入组件样式 */
.tag-input-container {
    /* Styles moved to .form-group common styles */
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    /* border, radius, padding, background, min-height, box-sizing inherited */
    position: relative; /* Keep for suggestions positioning */
    margin-bottom: 0; /* Override form-group margin if needed */
}

.selected-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-right: 4px; /* Space before input */
}

.tag-selected-item {
    background: #E0E8F0; /* Consistent light grey-blue BG */
    color: #4A5568; /* Darker grey text */
    border-radius: 4px; /* Slightly smaller radius */
    padding: 3px 8px;
    display: flex;
    align-items: center;
    font-size: 0.9em; /* Slightly smaller */
    /* margin-right removed, using gap */
}

.remove-tag-btn {
    margin-left: 5px; /* Increased space */
    color: #718096; /* Match icon color */
    cursor: pointer;
    font-weight: bold;
    font-size: 1.2em; /* Slightly larger */
    opacity: 0.7;
    line-height: 1; /* Ensure proper alignment */
}

.remove-tag-btn:hover {
    color: #2D3748; /* Darker grey */
    opacity: 1;
}

#tag-input {
    border: none;
    outline: none;
    flex: 1;
    min-width: 80px;
    font-size: 1em;
    padding: 4px 0; /* Adjust padding */
    background: transparent;
    color: #2D3748;
}

.tag-suggestions, .all-tags-dropdown {
    position: absolute;
    left: -1px; /* Align with border */
    top: calc(100% + 2px); /* Position below input */
    z-index: 10;
    background: #fff;
    border: 1px solid #CBD5E0; /* Match input border */
    border-top: none; /* Remove top border */
    width: calc(100% + 2px); /* Match input width including borders */
    max-height: 180px;
    overflow-y: auto;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08); /* Softer shadow */
    display: none; /* Keep hidden by default */
    border-radius: 0 0 6px 6px; /* Round bottom corners */
}

.tag-suggestion-item {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 0.95em;
    color: #4A5568; /* Standard text color */
    transition: background 0.15s;
}

.tag-suggestion-item:hover {
    background: #F1F3F5; /* Light grey hover */
    color: #1A202C; /* Darker text */
}

/* 标签全量下拉 */
.all-tags-dropdown {
    position: absolute;
    left: 0;
    top: 100%;
    z-index: 10;
    background: #fff;
    border: 1px solid #A0C4FF; /* Lighter blue border */
    width: 100%;
    max-height: 200px;
    overflow-y: auto;
    box-shadow: 0 2px 8px rgba(44, 62, 80, 0.12);
}

.tag-suggestion-item.selected {
    background: #E0E8F0; /* Light blue for selected in dropdown */
    color: #2D3748; /* Darker text */
    font-weight: 500;
}

.tag-suggestion-item.selected:hover {
    background: #CBD5E0; /* Slightly darker blue */
    color: #1A202C;
}

/* Notification Styles */
.notification {
    position: fixed;
    top: 20px;
    left: 50%;
    padding: 0.8rem 1.5rem; /* Adjust padding */
    border-radius: 6px; /* Consistent radius */
    color: #fff;
    font-size: 1em;
    z-index: 2000;
    opacity: 0;
    transform: translate(-50%, -20px);
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); /* Softer shadow */
    border-left: 4px solid transparent; /* Use border for accent */
    display: flex; /* Align icon and text */
    align-items: center;
}

.notification.show {
    opacity: 1;
    transform: translate(-50%, 0); /* Adjust final transform for centering */
}

.notification.success {
    background-color: #E6FFFA; /* Lighter green */
    color: #2F855A; /* Darker green text */
    border-left-color: #38A169; /* Green accent border */
}

.notification.error {
    background-color: #FFF5F5; /* Lighter red */
    color: #C53030; /* Darker red text */
    border-left-color: #E53E3E; /* Red accent border */
}

/* 密码弹窗样式 */
.password-modal {
  display: none;
  position: fixed;
  z-index: 3000;
  left: 0; top: 0; width: 100vw; height: 100vh;
  background: rgba(0,0,0,0.35);
  align-items: center;
  justify-content: center;
}
.password-modal[style*="display: flex"] {
  display: flex !important;
}
.password-container {
  background: #fff;
  border-radius: 10px;
  padding: 2.5rem 2rem 2rem 2rem;
  box-shadow: 0 6px 32px rgba(0,0,0,0.18);
  min-width: 320px;
  max-width: 90vw;
  text-align: center;
  position: relative;
}
.password-container h3 {
  margin-top: 0;
  font-size: 24px;
  color: var(--heo-fontcolor);
}
.password-input {
  width: 80%;
  margin: 20px 0;
  border-radius: 20px;
  height: 40px;
  font-size: 18px;
  text-align: center;
}
.password-input:focus {
  border-color: #4A90E2;
}
.password-error {
  color: #e53e3e;
  font-size: 0.98em;
  margin-bottom: 0.5em;
}
.login-btn {
  padding: 10px 24px;
  margin: 0 10px;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 8px #425aef22;
}
.login-once {
  background: #57bd6a;
  color: #fff;
}
.login-once:hover {
  background: #4cae4c;
}
.login-always {
  background: #cd34b4;
  color: #fff;
}
.login-always:hover {
  background: #a81e8a;
}
#login-options {
  display: flex;
  justify-content: center;
  gap: 16px;
}
body.password-locked > *:not(.password-modal) {
  filter: blur(2px) grayscale(0.2);
  pointer-events: none;
  user-select: none;
}

/* Back to top button styles */
#back-to-top {
    position: fixed;
    right: 32px;
    bottom: 32px;
    width: 56px;
    height: 56px;
    border: none;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 10px 10px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: 0.8s;
    pointer-events: none;
}

#back-to-top:hover {
    box-shadow: 0 0 20px 20px rgba(0, 0, 0, 0.3);
    transform: scale(1.05);
    transition: 0.8s;
}

/* 站内搜索组件 */
.prompt-search-container {
    position: fixed;
    bottom: 25px;
    width: 100%;
    max-width: 30%;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(255, 255, 255, 0.98);
    background: linear-gradient(90deg, #5ab1eb 0%, #cd34b4 100%);
    padding: 10px 0;
    border-radius: 40px;
    box-shadow: 0 0 10px 10px rgba(0, 0, 0, 0.3);
    z-index: 999;
    box-sizing: border-box;
    overflow: visible;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: 1s;
}

.prompt-search-container:hover {
    box-shadow: 0 0 20px 20px rgba(0, 0, 0, 0.3);
    transition: 1s;
}

/* 站内搜索框包装器样式 */
.site-search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.site-search-clear-btn {
    position: absolute;
    right: 20px;
    background: none;
    border: none;
    font-size: 35px;
    color: #000000;
    cursor: pointer;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.site-search-clear-btn:hover {
    background-color: rgba(255, 255, 255, 0.8);
}

.prompt-search-input {
    flex-grow: 1;
    text-align: center;
    height: 50px;
    font-size: 18px;
    border: transparent;
    border-radius: 25px;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.2s;
    background-color: transparent;
}

.prompt-search-input::placeholder {
  color: #b6eb4c;
  opacity: 1;
}

.prompt-search-results {
    position: absolute;
    top: 60px;
    left: 0;
    width: 100%;
    background: #fff;
    border-radius: 0 0 20px 20px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    max-height: 320px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}
.prompt-search-results.active {
    display: block;
}
.prompt-search-result-item {
    padding: 12px 20px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    color: #333;
    font-size: 1em;
    background: #fff;
    transition: background 0.2s;
}
.prompt-search-result-item:last-child {
    border-bottom: none;
}
.prompt-search-result-item:hover {
    background: #f7f8fa;
}
.prompt-search-highlight {
    background: #ffe066;
    color: #d7263d;
    font-weight: bold;
    padding: 0 2px;
    border-radius: 2px;
}

@media (max-width: 600px) {
  header {
    position: sticky;
    top: 0;
    z-index: 1100;
  }
}