@charset "UTF-8";
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --primary: #5b79e4; --primary-hover: #4663c9; --primary-light: #eff3ff;   
    --danger: #e74c3c; 
    --text-main: #1e293b; --text-muted: #64748b;
    --radius-lg: 1rem;     /* 16px */
    --radius-md: 0.625rem; /* 10px */
    --glass-bg: rgba(255, 255, 255, 0.65);
    --glass-border: 1px solid rgba(255, 255, 255, 0.8);
    --glass-shadow: 0 0.5rem 2rem 0 rgba(31, 38, 135, 0.05); /* 0 8px 32px */
}

body { 
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin: 0; display: flex; flex-direction: row; height: 100vh; color: var(--text-main); overflow: hidden;
    background-color: #e4eeff;
    background-image: 
        radial-gradient(at 80% 0%, hsla(189,100%,56%,0.15) 0, transparent 50%),
        radial-gradient(at 0% 50%, hsla(340,100%,76%,0.15) 0, transparent 50%),
        radial-gradient(at 80% 100%, hsla(242,100%,70%,0.15) 0, transparent 50%),
        radial-gradient(at 0% 0%, hsla(343,100%,76%,0.15) 0, transparent 50%);
    background-attachment: fixed;
}

.glass-panel { background: var(--glass-bg); backdrop-filter: blur(1.25rem); -webkit-backdrop-filter: blur(1.25rem); border: var(--glass-border); box-shadow: var(--glass-shadow); }

/* --- 登录界面 --- */
.login-screen { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(243, 246, 252, 0.5); backdrop-filter: blur(1.875rem); -webkit-backdrop-filter: blur(1.875rem); z-index: 99998; display: flex; flex-direction: column; justify-content: center; align-items: center; transition: opacity 0.3s ease; }
.login-box { padding: 2.5rem; border-radius: 1.5rem; width: 26.25rem; text-align: center; } /* 40px, 24px, 420px */
.login-box h2 { margin-top: 0; color: var(--text-main); font-size: 1.6rem; margin-bottom: 1.5625rem;} /* 25px */
.user-grid { display: flex; flex-wrap: wrap; gap: 1.25rem; justify-content: center; margin-bottom: 1.25rem; } /* 20px */
.user-avatar-btn { width: 4rem; height: 4rem; border-radius: 50%; background: var(--primary-light); color: var(--primary); font-size: 1.6rem; font-weight: bold; display: flex; justify-content: center; align-items: center; cursor: pointer; border: 2px solid transparent; transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1); position: relative; box-shadow: 0 0.25rem 0.9375rem rgba(0,0,0,0.05);} /* 64px, 4px 15px */
.user-avatar-btn:hover { transform: translateY(-0.3125rem) scale(1.05); box-shadow: 0 0.5rem 1.5625rem rgba(0,0,0,0.1); border-color: currentColor; } /* -5px, 8px 25px */
.delete-user-btn { position: absolute; top: -0.25rem; right: -0.25rem; background: var(--danger); color: #fff; border-radius: 50%; width: 1.375rem; height: 1.375rem; font-size: 0.875rem; font-weight: 800; display: flex; align-items: center; justify-content: center; opacity: 0; transition: 0.2s; box-shadow: 0 0.125rem 0.3125rem rgba(0,0,0,0.2); } /* -4px, 22px, 14px, 2px 5px */
.user-avatar-btn:hover .delete-user-btn { opacity: 1; }
.delete-user-btn:hover { transform: scale(1.15); }
.user-avatar-btn.new-user { background: rgba(255,255,255,0.5); color: var(--text-muted); border: 2px dashed rgba(100,116,139,0.3); }
.user-avatar-btn.new-user:hover { color: var(--primary); border-color: var(--primary); background: rgba(255,255,255,0.9);}
.user-name-label { position: absolute; bottom: -1.75rem; font-size: 0.85rem; color: var(--text-main); white-space: nowrap; font-weight: 600;} /* -28px */

/* --- 全局导航 --- */
.global-nav { width: 5.25rem; background: rgba(15,23,42,0.95); display: flex; flex-direction: column; align-items: center; padding: 1.875rem 0; z-index: 50; flex-shrink: 0; box-shadow: 0.25rem 0 1.25rem rgba(0,0,0,0.1);} /* 84px, 30px, 4px 20px */
.global-brand { color: #fff; margin-bottom: 2.5rem; display: flex; justify-content: center; width: 100%;} /* 40px */
.nav-icon { color: rgba(255,255,255,0.4); margin-bottom: 2.1875rem; cursor: pointer; transition: all 0.3s; display:flex; flex-direction:column; align-items:center; gap: 0.5rem; font-weight:600; font-size: 0.75rem; width: 100%; position: relative;} /* 35px, 8px */
.nav-icon:hover { color: rgba(255,255,255,0.8); }
.nav-icon.active { color: #fff; }
.nav-icon.active::before { content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 0.25rem; height: 1.875rem; background: var(--primary); border-radius: 0 0.25rem 0.25rem 0; } /* 4px, 30px */
.nav-icon svg { width: 1.625rem; height: 1.625rem; } /* 26px */

.view-container { flex: 1; display: flex; overflow: hidden; width: 100%; }

/* --- 侧边栏 --- */
.sidebar { width: 17.5rem; padding: 1.5rem 1.25rem; display: flex; flex-direction: column; box-sizing: border-box; border-right: var(--glass-border); z-index: 10;} /* 280px, 24px 20px */
.nav-label { font-size: 0.75rem; font-weight: 700; color: var(--text-muted); margin-bottom: 0.75rem; margin-top: 0.625rem; text-transform: uppercase; letter-spacing: 1px; padding-left: 0.625rem; } /* 12px, 10px */
.project-list { flex: 1; overflow-y: auto; list-style: none; padding: 0; margin: 0; }
.project-item { padding: 0.75rem 0.9375rem; margin-bottom: 0.375rem; border-radius: var(--radius-md); cursor: pointer; transition: all 0.2s; display: flex; justify-content: space-between; align-items: center; font-size: 0.95rem; font-weight: 500; color: var(--text-muted); border: 1px solid transparent;} /* 12px 15px, 6px */
.project-item:hover { background: rgba(255,255,255,0.7); color: var(--text-main); border-color: rgba(255,255,255,0.9); }
.project-item.active { background: var(--primary-light); color: var(--primary); font-weight: 700; border-color: rgba(255,255,255,0.9); box-shadow: 0 0.125rem 0.625rem rgba(0,0,0,0.02);} /* 2px 10px */

.project-actions { display: flex; gap: 0.25rem; opacity: 0; transition: all 0.2s; flex-shrink: 0;} /* 4px */
.project-item:hover .project-actions { opacity: 1; }
.dl-btn, .del-btn { background: #fff; padding: 0.3125rem; border-radius: 0.375rem; display: flex; align-items: center; justify-content: center; color: var(--text-muted); transition: 0.2s;} /* 5px, 6px */
.dl-btn:hover { color: var(--primary); background: var(--primary-light); }
.del-btn:hover { color: var(--danger); background: #fef2f2; }

/* --- 通用按钮库 --- */
button { background: var(--primary); color: white; border: none; padding: 0.5rem 0.875rem; border-radius: var(--radius-md); cursor: pointer; font-size: 0.85rem; font-weight: 600; transition: all 0.2s; display: inline-flex; align-items: center; justify-content: center; gap: 0.375rem; box-shadow: 0 0.125rem 0.625rem rgba(0,0,0,0.08); white-space: nowrap !important; flex-shrink: 0 !important; } /* 8px 14px, 6px, 2px 10px */
button:hover { filter: brightness(1.05); transform: translateY(-0.125rem); box-shadow: 0 0.25rem 0.9375rem rgba(0,0,0,0.12);} /* -2px, 4px 15px */
button:active { transform: translateY(0); box-shadow: 0 0.125rem 0.3125rem rgba(0,0,0,0.08);} /* 2px 5px */
button:disabled { background: #cbd5e1 !important; cursor: not-allowed; transform: none; box-shadow: none; color: #fff;}
.btn-danger { background: rgba(255,255,255,0.8); color: var(--danger); border: 1px solid #fecaca; box-shadow: none;}
.btn-danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-outline { background: rgba(255,255,255,0.5); border: 1px solid rgba(255,255,255,0.8); color: var(--text-main); box-shadow: none; backdrop-filter: blur(0.625rem);} /* 10px */
.btn-outline:hover { background: rgba(255,255,255,0.9); }
.btn-create { width: 100%; padding: 0.875rem; box-shadow: 0 0.25rem 0.9375rem rgba(0,0,0,0.05); border: 1px solid rgba(255,255,255,0.5); margin-bottom: 0.9375rem; font-size: 0.95rem;} /* 14px, 4px 15px, 15px */

/* --- 顶部栏与头像 --- */
.topbar { height: 4.375rem; border-bottom: var(--glass-border); display: flex; align-items: center; justify-content: flex-end; padding: 0 2.5rem; gap: 0.9375rem; flex-shrink: 0;} /* 70px, 40px, 15px */
.user-greeting { font-size: 0.95rem; font-weight: 600; color: var(--text-main); }
.avatar-container { position: relative; display: flex; justify-content: center; } 
.avatar { width: 2.5rem; height: 2.5rem; background: var(--primary); color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: bold; cursor: pointer; transition: 0.2s; font-size: 1.2rem; box-shadow: 0 0.25rem 0.625rem rgba(0,0,0,0.1); border: 2px solid rgba(255,255,255,0.8);} /* 40px, 4px 10px */
.avatar:hover { transform: scale(1.08); }
.avatar-tip { position: absolute; top: 3.4375rem; background: rgba(30,41,59,0.95); color: #fff; font-size: 0.75rem; padding: 0.375rem 0.75rem; border-radius: 0.375rem; opacity: 0; pointer-events: none; transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1); z-index: 100; backdrop-filter: blur(0.625rem); white-space: nowrap !important; width: max-content; box-shadow: 0 0.25rem 0.9375rem rgba(0,0,0,0.1);} /* 55px, 6px 12px, 6px, 10px, 4px 15px */
.avatar-container:hover .avatar-tip { opacity: 1; top: 3.125rem;} /* 50px */

/* 🚀 全局就地编辑框无缝伪装样式 */
.inplace-edit {
    background-color: transparent !important;
    border: 1px solid transparent !important;
    border-radius: 0.375rem; /* 6px */
    font-family: inherit;
    color: inherit;
    outline: none;
    transition: all 0.2s;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
    padding: 0.25rem 0.5rem; /* 4px 8px */
    margin: -0.25rem -0.5rem;
    box-sizing: border-box;
}
.inplace-edit:hover { background-color: rgba(255, 255, 255, 0.6) !important; border-color: rgba(0,0,0,0.1) !important; }
.inplace-edit:focus { background-color: #fff !important; border-color: var(--primary) !important; box-shadow: 0 0 0 0.125rem var(--primary-light) !important; text-overflow: clip; cursor: text; }

/* 🚀 右键菜单样式 */
.context-menu {
    position: fixed;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(0.625rem);
    -webkit-backdrop-filter: blur(0.625rem);
    border: var(--glass-border);
    box-shadow: 0 0.5rem 1.5625rem rgba(0,0,0,0.15); /* 8px 25px */
    border-radius: 0.5rem;
    padding: 0.375rem 0; /* 6px */
    min-width: 8.75rem;
    z-index: 999999;
    display: none;
    opacity: 0;
    transition: opacity 0.2s;
}
.context-menu-item {
    padding: 0.625rem 1rem; /* 10px 16px */
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem; /* 8px */
}
.context-menu-item:hover { background: var(--primary-light); color: var(--primary); }
.renameable { cursor: context-menu; border-bottom: 1px dashed transparent; transition: 0.2s; }
.renameable:hover { border-bottom: 1px dashed var(--primary); color: var(--primary); }

/* --- 工作区四宫格完美布局 --- */
.main-wrapper { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.main-content { flex: 1; padding: 1.5625rem 2.5rem; display: none; flex-direction: column; overflow-y: auto !important; overflow-x: hidden !important; box-sizing: border-box;}
.main-content.active { display: flex; }
.header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.25rem; flex-shrink: 0; height: 2.5rem;} /* 20px, 40px */

.workspace { display: flex; flex-direction: column; gap: 1.25rem; flex: 1; }

/* 💡 核心排版修复：不妥协的高度撑起滚动条 */
.workspace-row-top { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5625rem; flex: none; min-height: 32rem; }
.workspace-row-bottom { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5625rem; flex: none; min-height: 22rem; border-top: 2px dashed rgba(0,0,0,0.08); padding-top: 1.25rem;}
.workspace-row-footer { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5625rem; flex: none; padding-bottom: 2.5rem; }

.panel { display: flex; flex-direction: column; padding: 1.5625rem; border-radius: var(--radius-lg); min-height: 0; box-sizing: border-box; width: 100%;} /* 25px */
.panel-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.9375rem; flex-shrink: 0;} /* 15px */
.panel h3 { margin: 0; font-size: 1.1rem; font-weight: 700; display: flex; align-items: center; gap: 0.5rem;} /* 8px */

/* --- 音频轨道 --- */
.audio-editor-container { flex: 1; overflow-y: auto; padding-right: 0.625rem; margin-right: -0.625rem; } /* 10px */
.track-row { background: rgba(255,255,255,0.4); padding: 0.9375rem; border-radius: var(--radius-md); border: var(--glass-border); margin-bottom: 0.9375rem; flex-shrink:0; position: relative; overflow: hidden; transition: all 0.2s;} /* 15px */
.track-row.dragover { border: 2px dashed var(--primary); box-shadow: 0 0 1.25rem rgba(91,121,228,0.2); } /* 20px */
.track-drag-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(255, 255, 255, 0.85); backdrop-filter: blur(0.375rem); display: flex; flex-direction: column; justify-content: center; align-items: center; color: var(--primary); font-weight: 800; font-size: 1.1rem; opacity: 0; pointer-events: none; transition: opacity 0.2s; z-index: 50; } /* 6px */
.track-row.dragover .track-drag-overlay { opacity: 1; pointer-events: all; }
.track-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.625rem;} /* 10px */

.file-upload-wrapper { position: relative; display: inline-block; overflow: hidden; flex-shrink: 0;}
.file-upload-wrapper input[type="file"] { position: absolute; left: 0; top: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; z-index: 10;}
.upload-btn { background: #fff; color: var(--primary); border: 1px dashed var(--primary); padding: 0.25rem 0.75rem; border-radius: 1.25rem; font-size: 0.75rem; font-weight: 600; cursor: pointer; transition: 0.2s; white-space: nowrap; box-shadow: 0 0.125rem 0.3125rem rgba(0,0,0,0.02);} /* 4px 12px, 20px, 2px 5px */
.file-upload-wrapper:hover .upload-btn { background: var(--primary-light); transform: translateY(-0.0625rem);} /* -1px */

.waveform-container { width: 100%; height: 3.75rem; background: transparent; cursor: pointer;} /* 60px */
.waveform-container:hover { filter: brightness(0.95); }
.play-btn-round { border-radius: 50%; width: 2rem; height: 2rem; padding: 0; display: flex; justify-content: center; align-items: center; font-size: 1rem; background: rgba(255,255,255,0.9); color: var(--text-main); border: var(--glass-border); box-shadow: 0 0.125rem 0.625rem rgba(0,0,0,0.05); transition: 0.2s;} /* 32px, 2px 10px */
.play-btn-round:hover { background: #fff; color: var(--primary); transform: scale(1.05);}
.audio-time-display { font-size:0.8rem; color:var(--text-main); font-weight:600; font-variant-numeric: tabular-nums; }

.tab-switcher { display: flex; gap: 0.625rem; background: rgba(0,0,0,0.04); padding: 0.3125rem; border-radius: 0.625rem; width: max-content;} /* 10px, 5px, 10px */
.tab-btn { background: transparent; color: var(--text-muted); box-shadow: none; padding: 0.375rem 0.875rem; font-size: 0.85rem; border-radius: 0.375rem;} /* 6px 14px, 6px */
.tab-btn.active { background: #fff; color: var(--primary); box-shadow: 0 0.125rem 0.625rem rgba(0,0,0,0.05);} /* 2px 10px */

/* --- 作词区与沉浸式全屏 --- */
.lyrics-actions { margin-bottom: 0.9375rem; display: flex; gap: 0.625rem; align-items: center; flex-wrap: wrap; flex-shrink: 0;} /* 15px, 10px */

.lyrics-editor-wrap { position: relative; display: flex; flex: 1; min-height: 0; width: 100%; height: 100%; transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); }
.lyrics-editor-wrap textarea { width: 100%; height: 100%; padding: 0.9375rem; padding-bottom: 3.125rem; border: var(--glass-border); border-radius: var(--radius-md); resize: none; background: rgba(255,255,255,0.5); backdrop-filter: blur(0.625rem); font-family: inherit; font-size: 0.95rem; line-height: 1.7; box-sizing: border-box; transition: all 0.3s; outline: none; color: var(--text-main); box-shadow: 0 0.25rem 0.9375rem rgba(0,0,0,0.02);} /* 15px, 50px, 10px, 4px 15px */
.lyrics-editor-wrap textarea:focus { background: rgba(255,255,255,0.9); box-shadow: 0 0 0 0.1875rem var(--primary-light), 0 0.25rem 1.25rem rgba(0,0,0,0.05); border-color: transparent; } /* 3px, 4px 20px */

.fullscreen-toggle-btn { position: absolute; bottom: 0.9375rem; right: 0.9375rem; width: 2.25rem; height: 2.25rem; background: rgba(255,255,255,0.8); border: var(--glass-border); border-radius: 0.625rem; display: flex; align-items: center; justify-content: center; color: var(--text-muted); cursor: pointer; padding: 0; box-shadow: 0 0.25rem 0.9375rem rgba(0,0,0,0.05); transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1); z-index: 10;} /* 15px, 36px, 10px, 4px 15px */
.fullscreen-toggle-btn:hover { background: #fff; color: var(--primary); transform: scale(1.1); box-shadow: 0 0.5rem 1.25rem rgba(91,121,228,0.2); } /* 8px 20px */

.lyrics-editor-wrap.is-fullscreen { 
    position: fixed !important; top: 5vh !important; left: 15vw !important; width: 70vw !important; height: 90vh !important; z-index: 999999 !important; margin: 0 !important; padding: 0 !important; display: block !important; animation: popInFs 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
.lyrics-editor-wrap.is-fullscreen textarea { 
    width: 100% !important; height: 100% !important; background: rgba(255,255,255,0.98) !important; font-size: 1.15rem !important; box-shadow: 0 1.5625rem 3.125rem rgba(0,0,0,0.2) !important; /* 25px 50px */
    padding: 2.5rem !important; /* 40px */
    padding-bottom: 5rem !important; /* 80px */
    border-radius: 1rem !important; /* 16px */
}
.lyrics-editor-wrap.is-fullscreen .fullscreen-toggle-btn { 
    background: var(--danger) !important; color: #fff !important; border: none !important; bottom: 1.5625rem !important; /* 25px */
    right: 1.5625rem !important; width: 2.75rem !important; /* 44px */
    height: 2.75rem !important; 
}
.lyrics-editor-wrap.is-fullscreen .fullscreen-toggle-btn:hover { background: #dc2626 !important; transform: scale(1.1) rotate(90deg) !important; }

body::after { content: ''; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(15,23,42,0.6); backdrop-filter: blur(0.5rem); -webkit-backdrop-filter: blur(0.5rem); z-index: 999998; opacity: 0; pointer-events: none; transition: opacity 0.3s; } /* 8px */
body.lyrics-fs-active::after { opacity: 1; pointer-events: all; }

@keyframes popInFs { 0% { transform: scale(0.9); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }

/* --- 历史库 --- */
.archive-scroll { flex: 1; overflow-y: auto; padding-right: 0.625rem; margin-right: -0.625rem; margin-top: 0.9375rem; } /* 10px, 15px */
.archive-title-fancy { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.85rem; font-weight: 800; color: var(--text-main); text-transform: uppercase; letter-spacing: 1px; padding: 0.5rem 1rem; background: rgba(255,255,255,0.6); border-radius: 1.25rem; border: var(--glass-border); box-shadow: 0 0.125rem 0.625rem rgba(0,0,0,0.02);} /* 8px, 8px 16px, 20px, 2px 10px */
.archive-item { padding: 0.75rem 0.875rem; background: rgba(255,255,255,0.5); border-radius: var(--radius-md); margin-bottom: 0.5rem; border: var(--glass-border); transition: all 0.2s; box-shadow: 0 0.125rem 0.625rem rgba(0,0,0,0.02);} /* 12px 14px, 8px, 2px 10px */
.archive-item:hover { background: rgba(255,255,255,0.8); transform: translateX(0.125rem); box-shadow: 0 0.25rem 0.9375rem rgba(0,0,0,0.05);} /* 2px, 4px 15px */
.archive-item.viewing-active { background: var(--primary-light); border: 1px solid rgba(91,121,228,0.3); }

.archive-grid-item { display: grid; grid-template-columns: 2.8125rem minmax(6.25rem, 1fr) 5.625rem 5.625rem 11.875rem; align-items: center; gap: 0.625rem; width: 100%; } /* 45px, 100px, 90px, 190px, 10px */
.grid-ver { font-weight: 800; color: var(--text-main); font-size: 0.9rem;}
.grid-name { font-size: 0.85rem; color: var(--text-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; display:flex; align-items:center; gap: 0.3125rem;} /* 5px */
.edit-icon { display: none; } 
.grid-user { justify-self: center; font-size: 0.7rem; font-weight: 700; padding: 0.125rem 0.625rem; border-radius: 1.25rem; white-space: nowrap; border: 1px solid currentColor;} /* 2px 10px, 20px */
.deleted-user { text-decoration: line-through; opacity: 0.6; }
.grid-time { font-size: 0.75rem; color: var(--text-muted); font-weight: 500; }
.grid-actions { display: flex; justify-content: flex-end; gap: 0.375rem; } /* 6px */

/* --- 总览大盘表格 --- */
#overviewView { display: none; flex-direction: column; padding: 1.5625rem 2.5rem; flex: 1; overflow-y: auto !important; overflow-x: hidden !important; box-sizing: border-box; gap: 1.25rem;}
.overview-table-wrapper { flex: 0 0 auto !important; overflow: auto; background: var(--glass-bg); border-radius: var(--radius-lg); border: var(--glass-border); box-shadow: var(--glass-shadow); backdrop-filter: blur(1.25rem); max-height: 40rem;}
.overview-table { width: 100%; min-width: 85rem; border-collapse: separate; border-spacing: 0; text-align: left; }
.overview-table th { position: sticky; top: 0; background: rgba(255,255,255,0.95); padding: 0.875rem 1rem; font-size: 0.8rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; border-bottom: 2px solid rgba(0,0,0,0.05); z-index: 10; cursor: pointer; transition: background 0.2s; white-space: nowrap;} /* 14px 16px */
.overview-table th:hover { background: #f8fafc; color: var(--text-main); }
.overview-table td { padding: 0.75rem 1rem; border-bottom: 1px solid rgba(0,0,0,0.03); font-size: 0.9rem; font-weight: 500; color: var(--text-main); white-space: nowrap; transition: background 0.2s;} /* 12px 16px */
.overview-table tr:hover td { background: rgba(255,255,255,0.6); }

.editable-input { width: 100%; background: transparent; border: 1px solid transparent; padding: 0.25rem 0.5rem; border-radius: 0.375rem; font-family: inherit; font-size: inherit; font-weight: 600; color: inherit; outline: none; transition: 0.2s; box-sizing: border-box;} /* 4px 8px, 6px */
.editable-input:hover { background: rgba(255,255,255,0.8); border-color: rgba(0,0,0,0.1);}
.editable-input:focus { background: #fff; border-color: var(--primary); box-shadow: 0 0 0 0.125rem var(--primary-light);} /* 2px */
select.editable-input { cursor: pointer; appearance: none; -webkit-appearance: none; padding-right: 1.25rem; background-image: url('data:image/svg+xml;utf8,<svg fill="%2364748b" viewBox="0 0 24 24" width="16" height="16" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>'); background-repeat: no-repeat; background-position: right 0.25rem center; } /* 20px, 4px */

.tag-input { border-radius: 1.25rem; padding: 0.25rem 0.625rem; font-size: 0.75rem; font-weight: 700; text-align: center; width: 5rem; transition: all 0.2s; border: 1px solid currentColor;} /* 20px, 4px 10px, 80px */
.tag-input:focus { background: #fff !important; border-color: var(--primary) !important; box-shadow: 0 0 0 0.125rem var(--primary-light) !important; color: var(--text-main) !important;} /* 2px */

/* 表格内文件上传与拖拽 */
.upload-contract-btn { position:relative; display:inline-block; font-size:0.75rem; font-weight:600; cursor:pointer; background:#fff; padding: 0.25rem 0.625rem; border-radius: 0.375rem; box-shadow:0 0.125rem 0.3125rem rgba(0,0,0,0.05); transition: all 0.2s; overflow: hidden; border: 1px solid transparent;} /* 4px 10px, 6px, 2px 5px */
.upload-contract-btn:hover { transform: translateY(-0.0625rem); box-shadow: 0 0.25rem 0.625rem rgba(0,0,0,0.1); background: var(--primary-light); color: var(--primary) !important; border-color: var(--primary-light) !important; } /* -1px, 4px 10px */
.upload-contract-btn input[type="file"] { position: absolute; left: 0; top: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer;}

.view-contract-link { font-weight: 600; font-size: 0.8rem; text-decoration: none; border: 1px solid currentColor; padding: 0.25rem 0.5rem; border-radius: 0.25rem; transition: 0.2s; display: inline-flex; align-items:center; gap: 0.25rem; background: rgba(255,255,255,0.5);} /* 4px 8px, 4px, 4px */
.view-contract-link:hover { background: currentColor; color: #fff !important; }

.table-drag-wrap { position: relative; display: inline-block; border-radius: 0.375rem;} /* 6px */
.table-drag-overlay { position: absolute; top: -0.375rem; left: -0.375rem; right: -0.375rem; bottom: -0.375rem; color: #fff; font-size: 0.75rem; font-weight: 700; display: flex; justify-content: center; align-items: center; border-radius: 0.5rem; opacity: 0; pointer-events: none; transition: 0.2s; z-index: 20; white-space: nowrap; box-shadow: 0 0.25rem 0.9375rem rgba(0,0,0,0.15);} /* -6px, 8px, 4px 15px */
.table-drag-wrap.dragover .table-drag-overlay { opacity: 1; pointer-events: all; }
.table-drag-wrap.dragover .upload-contract-btn, .table-drag-wrap.dragover .view-contract-link { opacity: 0; }

/* --- 底部数据图表 --- */
.dashboard-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; flex: 0 0 auto !important; margin-top: 0.625rem; height: 16.25rem; }
.chart-card { background: var(--glass-bg); border: var(--glass-border); box-shadow: var(--glass-shadow); backdrop-filter: blur(1.25rem); border-radius: var(--radius-lg); padding: 0.9375rem 1.25rem; display: flex; flex-direction: column; overflow: hidden; } /* 20px, 15px 20px */
.chart-title { font-size: 0.9rem; font-weight: 800; color: var(--text-main); margin-bottom: 0.625rem; display:flex; justify-content:space-between; align-items:center; flex-shrink:0;} /* 10px */
.chart-container { flex: 1; position: relative; width: 100%; min-height: 0; } 

.calendar-wrapper { display: flex; flex-direction: column; height: 100%; width: 100%;}
.calendar-header { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; font-size: 0.75rem; font-weight: 800; color: var(--text-muted); margin-bottom: 0.375rem; flex-shrink: 0;} /* 6px */
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); grid-template-rows: repeat(5, 1fr); gap: 0.25rem; flex: 1; min-height: 0; } /* 4px */
.cal-cell { width: 100%; height: 100%; background: rgba(255,255,255,0.4); border-radius: 0.375rem; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 1px solid rgba(0,0,0,0.05); transition: 0.3s; cursor: default; } /* 6px */
.cal-cell.empty { background: transparent; border: none; }
.cal-cell:not(.empty):hover { transform: scale(1.15); box-shadow: 0 0.25rem 0.9375rem rgba(0,0,0,0.1); z-index: 10; } /* 4px 15px */
.cal-cell .date-num { font-size: 0.85rem; font-weight: 700; color: var(--text-main); }

.cal-cell[data-level="1"] { background: #e0e7ff; border-color: #c7d2fe; }
.cal-cell[data-level="2"] { background: #93c5fd; border-color: #60a5fa; }
.cal-cell[data-level="3"] { background: #3b82f6; border-color: #2563eb; }
.cal-cell[data-level="3"] .date-num { color: #fff; }
.cal-cell[data-level="4"] { background: #1d4ed8; border-color: #1e40af; }
.cal-cell[data-level="4"] .date-num { color: #fff; }

.cal-nav-btn { background: rgba(0,0,0,0.03); color: var(--text-muted); border: none; padding: 0; border-radius: 0.375rem; cursor: pointer; font-size: 0.7rem; box-shadow: none; transition: 0.2s; flex-shrink: 0; min-width: 1.5rem; height: 1.5rem; display: inline-flex; align-items: center; justify-content: center; font-family: monospace;} /* 6px, 24px */
.cal-nav-btn:hover { background: rgba(0,0,0,0.08); color: var(--text-main); transform: scale(1.05); box-shadow: none;}
.cal-month-btn { cursor: pointer; transition: 0.2s; }
.cal-month-btn:hover { background: var(--primary) !important; color: #fff !important; transform: scale(1.05); }

.month-picker-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.25rem; font-weight: 800; font-size: 1.2rem; color: var(--text-main); } /* 20px */
.month-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.625rem; } /* 10px */
.month-btn { padding: 0.75rem 0; border-radius: 0.5rem; border: none; background: rgba(0,0,0,0.04); color: var(--text-main); font-weight: 600; cursor: pointer; transition: 0.2s; box-shadow: none; font-size: 0.9rem;} /* 12px, 8px */
.month-btn:hover { background: rgba(0,0,0,0.08); transform: translateY(-0.125rem); box-shadow: none;} /* -2px */
.month-btn.active { background: var(--primary); color: #fff; box-shadow: 0 0.25rem 0.9375rem rgba(91,121,228,0.3); } /* 4px 15px */

/* --- 动画 --- */
@keyframes springDrop { 0% { opacity: 0; transform: translateY(-0.9375rem) scale(0.8); } /* -15px */ 60% { opacity: 1; transform: translateY(0.1875rem) scale(1.03); } /* 3px */ 80% { transform: translateY(-0.0625rem) scale(0.99); } /* -1px */ 100% { opacity: 1; transform: translateY(0) scale(1); } }

/* --- 弹窗体系 --- */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(15, 23, 42, 0.3); backdrop-filter: blur(0.5rem); display: none; justify-content: center; align-items: center; z-index: 999990; opacity: 0; transition: opacity 0.3s ease;} /* 8px */
.modal-overlay.active { display: flex; opacity: 1; }
#customModal { z-index: 9999999 !important; }
.modal-box { padding: 2.1875rem; border-radius: 1.25rem; width: 25rem; transform: translateY(-1.25rem); transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);} /* 35px, 20px, 400px, -20px */
.modal-overlay.active .modal-box { transform: translateY(0); }
.modal-box h3 { margin-top: 0; margin-bottom: 0.9375rem; color: var(--text-main); font-size: 1.4rem; font-weight: 800;} /* 15px */
.modal-input { width: 100%; padding: 0.875rem 1rem; border: 1px solid rgba(0,0,0,0.1); border-radius: var(--radius-md); font-size: 1rem; box-sizing: border-box; margin-bottom: 1.5rem; outline: none; transition: all 0.2s; font-family: inherit; background: rgba(255,255,255,0.8);} /* 14px 16px, 24px */
.modal-input:focus { border-color: transparent; box-shadow: 0 0 0 0.25rem var(--primary-light), 0 0.25rem 0.9375rem rgba(0,0,0,0.05); background: #fff;} /* 4px, 4px 15px */
.modal-btns { display: flex; justify-content: flex-end; gap: 0.75rem; } /* 12px */

#recycleModal .modal-box { width: 42.5rem; max-height: 85vh; display: flex; flex-direction: column; } /* 680px */
.recycle-item { display: flex; justify-content: space-between; align-items: center; padding: 0.9375rem 0; border-bottom: 1px solid rgba(0,0,0,0.05); font-size: 0.95rem; gap: 0.9375rem;} /* 15px */
.recycle-item-left { flex: 1; min-width: 0; display: flex; align-items: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recycle-item-right { display: flex; align-items: center; gap: 0.625rem; flex-shrink: 0; } /* 10px */
.recycle-type { display: inline-block; padding: 0.25rem 0.625rem; border-radius: 0.375rem; background: rgba(0,0,0,0.05); font-weight: 700; font-size: 0.75rem; color: var(--text-muted); margin-right: 0.75rem; flex-shrink: 0;} /* 4px 10px, 6px, 12px */

.badge { background: var(--primary-light); color: var(--primary); padding: 0.25rem 0.625rem; border-radius: 0.375rem; font-size: 0.75rem; margin-left: 0.5rem; font-weight: 700; border: 1px solid currentColor;} /* 4px 10px, 6px, 8px */
.badge.mma { background: #fffbeb; color: #d97706; border-color: #d97706;}
.uploader-badge { font-size: 0.75rem; font-weight: 700; padding: 0.25rem 0.625rem; border-radius: 1.25rem; margin-left: 0.625rem; border: 1px solid currentColor; display: inline-flex; align-items: center;} /* 4px 10px, 20px, 10px */

::-webkit-scrollbar { width: 0.5rem; height: 0.5rem; } /* 8px */
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(100,116,139,0.3); border-radius: 0.25rem; border: 2px solid transparent; background-clip: padding-box;} /* 4px */
::-webkit-scrollbar-thumb:hover { background-color: rgba(100,116,139,0.5); }

/* 💡 新增：自适应弹性文本框、Prompt 弹窗与星级评分样式 */
.auto-expand-textarea {
    width: 100%;
    min-height: 5rem;
    overflow: hidden;
    resize: none;
    padding: 0.9375rem;
    border: var(--glass-border);
    border-radius: var(--radius-md);
    background: rgba(255,255,255,0.5);
    backdrop-filter: blur(0.625rem);
    font-family: inherit;
    font-size: 0.95rem;
    line-height: 1.7;
    box-sizing: border-box;
    transition: background 0.3s, box-shadow 0.3s;
    outline: none;
    color: var(--text-main);
    box-shadow: 0 0.25rem 0.9375rem rgba(0,0,0,0.02);
}
.auto-expand-textarea:focus {
    background: rgba(255,255,255,0.9);
    box-shadow: 0 0 0 0.1875rem var(--primary-light), 0 0.25rem 1.25rem rgba(0,0,0,0.05);
    border-color: transparent;
}

.prompt-history-item {
    background: rgba(255,255,255,0.6);
    border-radius: var(--radius-md);
    padding: 1rem;
    border: var(--glass-border);
    cursor: pointer;
    transition: all 0.2s;
}
.prompt-history-item:hover {
    background: rgba(255,255,255,0.9);
    transform: translateY(-2px);
    box-shadow: 0 0.25rem 0.9375rem rgba(0,0,0,0.05);
}

.prompt-history-text {
    display: -webkit-box;
    -webkit-line-clamp: 2; /* 默认显示前2行 */
    -webkit-box-orient: vertical;
    overflow: hidden;
    white-space: pre-wrap;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-main);
    margin-top: 0.5rem;
}
.prompt-history-text.expanded {
    -webkit-line-clamp: unset;
    display: block; /* 展开显示完整内容 */
}

.star-rating {
    display: inline-flex;
    gap: 4px;
    align-items: center;
    cursor: pointer;
}
.star-rating .star {
    color: #cbd5e1;
    font-size: 1.1rem;
    transition: 0.2s;
    user-select: none;
}
.star-rating .star:hover, .star-rating .star.active {
    color: #f59e0b; /* 亮起为橘黄色 */
}