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

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-tertiary: #1a1a25;
    --bg-glass: rgba(18, 18, 26, 0.8);
    --text-primary: #ffffff;
    --text-secondary: #a0a0b0;
    --accent-cyan: #00f0ff;
    --accent-purple: #b000ff;
    --accent-pink: #ff00aa;
    --accent-blue: #0066ff;
    --border-glow: rgba(0, 240, 255, 0.3);
    --shadow-glow: 0 0 20px rgba(0, 240, 255, 0.2);
}

body {
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    background-image:
        radial-gradient(ellipse at 20% 20%, rgba(176, 0, 255, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(0, 240, 255, 0.1) 0%, transparent 50%);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    padding: 40px 20px;
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-glow);
    margin-bottom: 30px;
    position: relative;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-cyan), var(--accent-purple), transparent);
    animation: gradient-shift 3s ease-in-out infinite;
}

@keyframes gradient-shift {
    0%, 100% { transform: translateX(-100%); }
    50% { transform: translateX(100%); }
}

h1 {
    font-size: 2.5em;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
    text-shadow: 0 0 30px rgba(0, 240, 255, 0.3);
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1em;
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
    }
}

.panel {
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-glow);
    border-radius: 16px;
    padding: 25px;
    box-shadow: var(--shadow-glow);
    transition: all 0.3s ease;
}

.panel:hover {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 30px rgba(0, 240, 255, 0.3);
}

.panel-title {
    font-size: 1.3em;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-glow);
    display: flex;
    align-items: center;
    gap: 10px;
}

.panel-title::before {
    content: '';
    width: 4px;
    height: 20px;
    background: linear-gradient(180deg, var(--accent-cyan), var(--accent-purple));
    border-radius: 2px;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 0.9em;
    font-weight: 500;
}

input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
textarea,
select {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-glow);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1em;
    transition: all 0.3s ease;
    outline: none;
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
textarea:focus,
select:focus {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.2);
}

textarea {
    resize: vertical;
    min-height: 80px;
}

select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2300f0ff' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
}

.range-slider {
    width: 100%;
    margin: 10px 0;
}

.range-slider input[type="range"] {
    width: 100%;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.range-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
}

.range-value {
    text-align: center;
    color: var(--accent-cyan);
    font-weight: 600;
    margin-top: 5px;
}

.button {
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}

.button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.button:hover::before {
    left: 100%;
}

.button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 240, 255, 0.4);
}

.button:active {
    transform: translateY(0);
}

.button-secondary {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-glow);
}

.button-secondary:hover {
    background: var(--bg-secondary);
    border-color: var(--accent-cyan);
}

.button-danger {
    background: linear-gradient(135deg, #ff4444, #cc0000);
}

.button-danger:hover {
    box-shadow: 0 5px 20px rgba(255, 68, 68, 0.4);
}

.button-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.button-full {
    width: 100%;
    padding: 16px;
    font-size: 1.1em;
}

.upload-zone {
    border: 2px dashed var(--border-glow);
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--bg-tertiary);
    position: relative;
    overflow: hidden;
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--accent-cyan);
    background: rgba(0, 240, 255, 0.05);
}

.upload-zone input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.upload-icon {
    font-size: 3em;
    margin-bottom: 15px;
    color: var(--accent-cyan);
}

.upload-text {
    color: var(--text-secondary);
    font-size: 0.95em;
}

.upload-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.upload-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 1;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-glow);
}

.upload-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.upload-item .delete-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 28px;
    height: 28px;
    background: rgba(255, 68, 68, 0.9);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.3s ease;
}

.upload-item .delete-btn:hover {
    background: #cc0000;
    transform: scale(1.1);
}

.reference-slots {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-top: 20px;
}

@media (max-width: 768px) {
    .reference-slots {
        grid-template-columns: repeat(2, 1fr);
    }
}

.reference-slot {
    border: 2px dashed var(--border-glow);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--bg-tertiary);
    min-height: 150px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.reference-slot:hover {
    border-color: var(--accent-cyan);
    background: rgba(0, 240, 255, 0.05);
}

.reference-slot.filled {
    border-style: solid;
    border-color: var(--accent-purple);
}

.reference-slot-icon {
    font-size: 2em;
    margin-bottom: 10px;
    color: var(--accent-cyan);
}

.reference-slot-label {
    color: var(--text-secondary);
    font-size: 0.85em;
    font-weight: 500;
}

.reference-slot-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.prompt-output {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-glow);
    border-radius: 12px;
    padding: 20px;
    min-height: 200px;
    margin-bottom: 20px;
    position: relative;
}

.prompt-output textarea {
    width: 100%;
    min-height: 150px;
    background: transparent;
    border: none;
    resize: none;
    font-size: 1em;
    line-height: 1.6;
    color: var(--text-primary);
}

.prompt-output textarea:focus {
    outline: none;
    box-shadow: none;
}


.copy-btn1 {
    position: absolute;
    top: 0px;
    right: 68px;
    padding: 8px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-glow);
    border-radius: 6px;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.3s ease;
}


.copy-btn {
    padding: 6px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-glow);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 0.8em;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    min-width: 50px;
    text-align: center;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.copy-btn:hover {
    background: var(--accent-cyan);
    border-color: var(--accent-cyan);
    color: var(--bg-primary);
}

.prompt-copy-btn {
    position: absolute;
    top: 0px;
    right: 20px;
    padding: 8px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-glow);
    border-radius: 6px;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.3s ease;
}

.prompt-copy-btn:hover {
    background: var(--accent-cyan);
    border-color: var(--accent-cyan);
    color: var(--bg-primary);
}

.history-list {
    max-height: 400px;
    overflow-y: auto;
}

.history-item {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-glow);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.history-item:hover {
    border-color: var(--accent-cyan);
    background: rgba(0, 240, 255, 0.05);
}

.history-item-text {
    color: var(--text-primary);
    font-size: 0.95em;
    line-height: 1.5;
    margin-bottom: 8px;
}

.history-item-time {
    color: var(--text-secondary);
    font-size: 0.85em;
}

.cache-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    margin-bottom: 15px;
}

.cache-size {
    color: var(--accent-cyan);
    font-weight: 600;
}

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-glow);
    border-top-color: var(--accent-cyan);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    padding: 15px 25px;
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-glow);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.95em;
    z-index: 1000;
    animation: slideIn 0.3s ease;
    box-shadow: var(--shadow-glow);
}

.toast.success {
    border-color: var(--accent-cyan);
}

.toast.error {
    border-color: #ff4444;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

footer {
    text-align: center;
    padding: 30px 20px;
    color: var(--text-secondary);
    font-size: 0.9em;
    border-top: 1px solid var(--border-glow);
    margin-top: 30px;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

@media (max-width: 768px) {
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }
}

section {
    margin-bottom: 30px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-glow);
}

.section-title {
    font-size: 1.5em;
    font-weight: 600;
    color: var(--text-primary);
}

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

.badge {
    display: inline-block;
    padding: 4px 10px;
    background: var(--accent-purple);
    color: white;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 600;
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--accent-cyan);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-purple);
}

@media (max-width: 1200px) {
    .container {
        padding: 15px;
    }

    h1 {
        font-size: 2em;
    }

    .subtitle {
        font-size: 1em;
    }

    header {
        padding: 30px 15px;
    }

    .panel {
        padding: 20px;
    }

    .section-title {
        font-size: 1.3em;
    }
}

@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
    }

    .reference-slots {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    header {
        padding: 20px 10px;
        margin-bottom: 20px;
    }

    h1 {
        font-size: 1.8em;
    }

    .subtitle {
        font-size: 0.9em;
    }

    .panel {
        padding: 15px;
        margin-bottom: 20px;
    }

    .section-title {
        font-size: 1.2em;
    }

    .panel-title {
        font-size: 1.1em;
        margin-bottom: 15px;
    }

    .form-group {
        margin-bottom: 15px;
    }

    label {
        font-size: 0.85em;
        margin-bottom: 6px;
    }

    input[type="text"],
    input[type="number"],
    textarea,
    select {
        padding: 10px 12px;
        font-size: 0.95em;
    }

    select {
        padding-right: 35px;
        background-size: 10px 10px;
    }

    .button {
        padding: 10px 20px;
        font-size: 0.95em;
    }

    .button-full {
        padding: 14px;
        font-size: 1em;
    }

    .upload-zone {
        padding: 20px;
    }

    .upload-icon {
        font-size: 2.5em;
        margin-bottom: 10px;
    }

    .upload-text {
        font-size: 0.9em;
    }

    .reference-slots {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        margin-top: 15px;
    }

    .reference-slot {
        padding: 15px;
        min-height: 120px;
    }

    .reference-slot-icon {
        font-size: 1.8em;
        margin-bottom: 8px;
    }

    .reference-slot-label {
        font-size: 0.8em;
    }

    .prompt-output {
        padding: 15px;
        min-height: 150px;
    }

    .prompt-output textarea {
        min-height: 120px;
        font-size: 0.95em;
    }

    .prompt-copy-btn {
        padding: 6px 12px;
        font-size: 0.85em;
    }

    .history-list {
        max-height: 300px;
    }

    .history-item {
        padding: 12px;
    }

    .history-item-text {
        font-size: 0.9em;
    }

    .history-item-time {
        font-size: 0.8em;
    }

    .cache-info {
        padding: 12px;
        font-size: 0.9em;
    }

    .button-group {
        flex-direction: column;
    }

    .button-group .button {
        width: 100%;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .section-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .toast {
        left: 20px;
        right: 20px;
        bottom: 20px;
        padding: 12px 20px;
        font-size: 0.9em;
    }

    footer {
        padding: 20px 15px;
        font-size: 0.85em;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 8px;
    }

    header {
        padding: 15px 8px;
    }

    h1 {
        font-size: 1.5em;
    }

    .subtitle {
        font-size: 0.85em;
    }

    .panel {
        padding: 12px;
        border-radius: 12px;
    }

    .section-title {
        font-size: 1.1em;
    }

    .panel-title {
        font-size: 1em;
    }

    input[type="text"],
    input[type="number"],
    textarea,
    select {
        padding: 8px 10px;
        font-size: 0.9em;
    }

    .button {
        padding: 8px 16px;
        font-size: 0.9em;
    }

    .button-full {
        padding: 12px;
        font-size: 0.95em;
    }

    .upload-zone {
        padding: 15px;
    }

    .upload-icon {
        font-size: 2em;
    }

    .reference-slots {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .reference-slot {
        padding: 12px;
        min-height: 100px;
    }

    .reference-slot-icon {
        font-size: 1.5em;
    }

    .prompt-output {
        padding: 12px;
        min-height: 120px;
    }

    .prompt-output textarea {
        min-height: 100px;
        font-size: 0.9em;
    }

    .prompt-copy-btn {
        padding: 5px 10px;
        font-size: 0.8em;
    }

    .history-list {
        max-height: 250px;
    }

    .history-item {
        padding: 10px;
    }

    .toast {
        left: 10px;
        right: 10px;
        bottom: 10px;
        padding: 10px 15px;
        font-size: 0.85em;
    }

    .badge {
        font-size: 0.75em;
        padding: 3px 8px;
    }
}

@media (max-width: 360px) {
    h1 {
        font-size: 1.3em;
    }

    .subtitle {
        font-size: 0.8em;
    }

    .section-title {
        font-size: 1em;
    }

    .button {
        padding: 6px 12px;
        font-size: 0.85em;
    }

    .reference-slot-label {
        font-size: 0.75em;
    }
}

@media (min-width: 768px) and (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 25px;
    }

    .reference-slots {
        grid-template-columns: repeat(4, 1fr);
    }

    .grid-2 {
        grid-template-columns: 1fr 1fr;
    }

    .grid-3 {
        grid-template-columns: repeat(3, 1fr);
    }

    .grid-4 {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (hover: none) and (pointer: coarse) {
    .button:hover {
        transform: none;
        box-shadow: var(--shadow-glow);
    }

    .button:active {
        transform: scale(0.98);
    }

    .upload-zone:hover,
    .upload-zone.dragover {
        border-color: var(--border-glow);
        background: var(--bg-tertiary);
    }

    .reference-slot:hover {
        border-color: var(--border-glow);
        background: var(--bg-tertiary);
    }

    .history-item:hover {
        border-color: var(--border-glow);
        background: var(--bg-tertiary);
    }

    .prompt-copy-btn:hover {
        background: var(--bg-secondary);
        border-color: var(--border-glow);
        color: var(--text-primary);
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media (orientation: portrait) {
    .reference-slots {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (orientation: landscape) and (max-height: 500px) {
    header {
        padding: 15px 20px;
    }

    h1 {
        font-size: 1.8em;
    }

    .subtitle {
        font-size: 0.9em;
    }

    .container {
        padding: 10px 20px;
    }

    .panel {
        padding: 15px;
    }

    .main-content {
        gap: 15px;
    }

    section {
        margin-bottom: 20px;
    }
}

/* 用户系统样式 */
.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.logo {
    text-align: left;
}

.user-menu {
    display: flex;
    align-items: center;
}

.user-auth {
    display: flex;
    gap: 10px;
}

.user-profile {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
}

.username {
    color: var(--text-primary);
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 10px;
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-glow);
    border-radius: 8px;
    padding: 10px 0;
    min-width: 150px;
    box-shadow: var(--shadow-glow);
    z-index: 9999;
    display: none;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

@media (max-width: 768px) {
    .dropdown-menu {
        min-width: 180px;
        right: 50%;
        transform: translateX(50%) translateY(-10px);
        z-index: 9999;
        box-shadow: 0 10px 30px rgba(0, 240, 255, 0.3);
    }

    .dropdown-menu.active {
        transform: translateX(50%) translateY(0);
    }

    .user-profile {
        position: relative;
        z-index: 10000;
    }

    .username {
        font-size: 14px;
        white-space: nowrap;
    }
}

@media (max-width: 480px) {
    .dropdown-menu {
        min-width: 160px;
        left: 50%;
        right: auto;
        transform: translateX(-50%) translateY(-10px);
    }

    .dropdown-menu.active {
        transform: translateX(-50%) translateY(0);
    }

    .username {
        font-size: 13px;
    }
}

@media (max-width: 360px) {
    .dropdown-menu {
        min-width: 140px;
        padding: 8px 0;
    }

    .dropdown-menu a {
        padding: 8px 16px;
        font-size: 13px;
    }

    .username {
        font-size: 12px;
    }
}

.dropdown-menu.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.dropdown-menu a {
    display: block;
    padding: 10px 20px;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.3s ease;
}

.dropdown-menu a:hover {
    background: var(--accent-cyan);
    color: var(--bg-primary);
}

.button-small {
    padding: 8px 16px;
    font-size: 0.9em;
    letter-spacing: 0.5px;
}

.button-primary {
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink));
}

/* 模态框样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-glow);
    border-radius: 16px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

.modal-content.modal-lg {
    max-width: 800px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-glow);
}

.modal-header h3 {
    font-size: 1.3em;
    font-weight: 600;
    color: var(--text-primary);
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5em;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-btn:hover {
    color: var(--accent-cyan);
}

.modal-body {
    margin-bottom: 20px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 15px;
    border-top: 1px solid var(--border-glow);
}

.error-message {
    color: #ff4444;
    font-size: 0.85em;
    margin-top: 5px;
    min-height: 20px;
}

/* 收藏夹样式 */
.favorites-list {
    max-height: 500px;
    overflow-y: auto;
}

.favorite-item {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-glow);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.favorite-item:hover {
    border-color: var(--accent-cyan);
    background: rgba(0, 240, 255, 0.05);
}

.favorite-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.favorite-item-title {
    font-weight: 600;
    color: var(--accent-cyan);
}

.favorite-item-actions {
    display: flex;
    gap: 5px;
}

.favorite-item-text {
    color: var(--text-primary);
    font-size: 0.95em;
    line-height: 1.5;
    margin-bottom: 10px;
    word-break: break-all;
}

.favorite-item-time {
    color: var(--text-secondary);
    font-size: 0.85em;
}

/* 排序控件样式 */
.sort-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sort-controls label {
    margin: 0;
    font-size: 0.9em;
}

.sort-controls select {
    padding: 6px 12px;
    font-size: 0.9em;
}

/* 后台管理样式 */
.system-info {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-glow);
    border-radius: 8px;
    padding: 20px;
}

.system-info p {
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
}

.system-info span:last-child {
    color: var(--accent-cyan);
    font-weight: 600;
}

/* 历史记录项增强样式 */
.history-item {
    position: relative;
}

.history-item-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 10px;
    opacity: 0;
    transition: opacity 0.3s ease;
    align-items: center;
    flex-direction: column;
}

.history-item:hover .history-item-actions {
    opacity: 1;
}

.history-item-action-btn {
    padding: 6px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-glow);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 0.8em;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    min-width: 55px;
    text-align: center;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.history-item-action-btn:hover {
    background: var(--accent-cyan);
    border-color: var(--accent-cyan);
    color: var(--bg-primary);
}

/* 动画 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 响应式调整 */
@media (max-width: 768px) {
    .header-top {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }

    .logo {
        text-align: center;
    }

    .user-menu {
        width: 100%;
        justify-content: center;
    }

    .modal-content {
        padding: 20px;
        width: 95%;
    }

    .modal-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .sort-controls {
        width: 100%;
        margin-top: 10px;
    }

    .favorite-item-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .favorite-item-actions {
        align-self: flex-end;
        margin-top: -10px;
    }
}

/* 中文提示弹窗样式 */
.tooltip {
    position: relative;
    cursor: help;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-glow);
    border-radius: 8px;
    padding: 10px 15px;
    color: var(--text-primary);
    font-size: 0.9em;
    white-space: nowrap;
    z-index: 1500;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    margin-bottom: 10px;
    box-shadow: var(--shadow-glow);
}

.tooltip:hover::after {
    opacity: 1;
    visibility: visible;
}

.notification-badge {
    display: inline-block;
    background: #ff0055;
    color: white;
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 5px;
    font-weight: bold;
}

.notification-badge:empty {
    display: none;
}

.custom-tooltip {
    position: fixed;
    background: rgba(18, 18, 26, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 240, 255, 0.3);
    border-radius: 12px;
    padding: 16px 20px;
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.6;
    max-width: 400px;
    width: 90vw;
    z-index: 10000;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(0, 240, 255, 0.1), inset 0 0 20px rgba(0, 240, 255, 0.05);
    animation: tooltipFadeIn 0.3s ease;
    pointer-events: none;
}

@media (max-width: 768px) {
    .custom-tooltip {
        font-size: 13px;
        padding: 12px 16px;
        max-width: 85vw;
    }
}

@media (max-width: 480px) {
    .custom-tooltip {
        font-size: 12px;
        padding: 10px 14px;
        max-width: 80vw;
    }
}

@media (max-width: 360px) {
    .custom-tooltip {
        font-size: 11px;
        padding: 8px 12px;
        max-width: 75vw;
    }
}

.custom-tooltip::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid rgba(0, 240, 255, 0.3);
}

@keyframes tooltipFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.notifications-list {
    max-height: 400px;
    overflow-y: auto;
}

.notification-item {
    padding: 15px;
    border-bottom: 1px solid var(--border-glow);
    transition: all 0.3s ease;
    cursor: pointer;
}

.notification-item:hover {
    background: var(--bg-tertiary);
}

.notification-item.unread {
    background: rgba(0, 240, 255, 0.1);
    border-left: 3px solid var(--accent-cyan);
}

.notification-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.notification-item-title {
    font-weight: bold;
    color: var(--accent-cyan);
    font-size: 16px;
}

.notification-item-meta {
    display: flex;
    gap: 10px;
    align-items: center;
}

.notification-item-type {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 4px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.notification-item-priority {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: bold;
}

.notification-item-priority.low {
    background: #a0a0b0;
    color: #a0a0b0;
}

.notification-item-priority.normal {
    background: var(--accent-cyan);
    color: var(--bg-primary);
}

.notification-item-priority.high {
    background: #ffaa00;
    color: white;
}

.notification-item-priority.urgent {
    background: #ff0055;
    color: white;
}

.notification-item-content {
    color: var(--text-primary);
    margin-bottom: 10px;
    line-height: 1.6;
}

.notification-item-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--text-secondary);
}

.notification-item-time {
    font-size: 12px;
}

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

.notification-item-btn {
    padding: 5px 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-glow);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.notification-item-btn:hover {
    background: var(--accent-cyan);
    border-color: var(--accent-cyan);
    color: var(--bg-primary);
}

.notification-item-btn.delete:hover {
    background: #ff0055;
    border-color: #ff0055;
}

.notifications-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.notifications-empty-icon {
    font-size: 48px;
    margin-bottom: 15px;
}
