/* ==========================================================================
   Luxury Light Glassmorphism 亮色奢华毛玻璃设计系统
   ========================================================================== */
:root {
    --bg-light: #f8fafc;
    --panel-bg: rgba(255, 255, 255, 0.65);
    --panel-border: rgba(255, 255, 255, 0.8);
    --panel-border-hover: rgba(255, 255, 255, 1);
    --glow-color: rgba(59, 130, 246, 0.15);
    
    --text-primary: #0f172a;    /* Slate 900 */
    --text-secondary: #475569;  /* Slate 600 */
    --text-muted: #94a3b8;      /* Slate 400 */
    
    --accent-blue: #3b82f6;     /* 亮蓝 */
    --accent-purple: #8b5cf6;   /* 亮紫 */
    --accent-cyan: #06b6d4;     /* 亮青 */
    --accent-green: #10b981;    /* 亮绿 */
    --accent-red: #f43f5e;      /* 珊瑚红 */
    
    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-mono: 'JetBrains Mono', Consolas, Monaco, monospace;
    
    --transition-smooth: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    --transition-quick: all 0.15s ease;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-light);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* ==========================================================================
   马卡龙色系 弥散流光 + 科技感网格背景
   ========================================================================== */
.aurora-bg {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: -2;
    background-color: #f1f5f9;
    background-image: 
        radial-gradient(rgba(15, 23, 42, 0.04) 1px, transparent 1px);
    background-size: 24px 24px;
    overflow: hidden;
}

.aurora-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.55;
    pointer-events: none;
}

.orb-1 {
    top: -10%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, #e0f2fe 0%, transparent 80%);
    animation: orb-float 25s infinite alternate ease-in-out;
}

.orb-2 {
    bottom: -15%;
    right: -10%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, #fce7f3 0%, transparent 80%);
    animation: orb-float 30s infinite alternate-reverse ease-in-out;
}

.orb-3 {
    top: 25%;
    left: 35%;
    width: 45vw;
    height: 45vw;
    background: radial-gradient(circle, #ede9fe 0%, transparent 80%);
    animation: orb-float 20s infinite alternate ease-in-out;
}

@keyframes orb-float {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(3%, 6%) scale(1.05); }
    100% { transform: translate(-3%, -3%) scale(0.95); }
}

/* ==========================================================================
   牛奶高透毛玻璃卡片 (Luxury Light Glassmorphism)
   ========================================================================== */
.glass-card {
    background: var(--panel-bg);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--panel-border);
    border-radius: 24px;
    box-shadow: 
        0 15px 35px rgba(15, 23, 42, 0.05),
        0 5px 15px rgba(15, 23, 42, 0.02);
    transition: var(--transition-smooth);
}

.glass-panel {
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid var(--panel-border);
    box-shadow: 
        0 30px 60px rgba(15, 23, 42, 0.08),
        0 10px 20px rgba(15, 23, 42, 0.03);
}

/* ==========================================================================
   1. 隐形时钟/登录页样式 (Stealth UI)
   ========================================================================== */
#stealth-view {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    transition: var(--transition-smooth);
    opacity: 0;
    pointer-events: none;
}

#stealth-view.active {
    opacity: 1;
    pointer-events: auto;
}

/* 3D 翻转卡片容器 */
.flip-container {
    perspective: 1000px;
    width: 460px;
    height: 380px;
    max-width: 90vw;
}

.card-flipper {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
}

.card-flipper.flipped {
    transform: rotateY(180deg);
}

.card-front, .card-back {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    padding: 35px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.card-back {
    transform: rotateY(180deg);
}

/* 仪表盘时钟页 (正面) */
.system-status-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
    font-family: var(--font-mono);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    position: relative;
}

.pulse-dot.green { background-color: var(--accent-green); }
.pulse-dot.green::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    border-radius: 50%;
    background-color: var(--accent-green);
    animation: pulse 1.8s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(2.6); opacity: 0; }
}

.clock-content {
    text-align: center;
    margin: auto 0;
}

#time-display {
    font-size: 3.8rem;
    font-weight: 300;
    font-family: var(--font-sans);
    letter-spacing: -0.01em;
    color: var(--text-primary);
    text-shadow: 0 4px 10px rgba(15, 23, 42, 0.05);
    line-height: 1.1;
}

#date-display {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-top: 10px;
    font-weight: 400;
    letter-spacing: 0.03em;
}

.sensor-readings {
    display: flex;
    justify-content: space-between;
    border-top: 1px solid rgba(15, 23, 42, 0.05);
    padding-top: 20px;
}

.sensor-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sensor-item .label {
    font-size: 0.65rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
    letter-spacing: 0.03em;
}

.sensor-item .val {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-weight: 500;
}

/* 隐形触发区域 */
.stealth-trigger {
    position: absolute;
    bottom: 20px;
    right: 25px;
    background: none;
    border: none;
    cursor: pointer;
    outline: none;
    opacity: 0.25;
    transition: var(--transition-smooth);
}

.stealth-trigger:hover {
    opacity: 0.85;
    transform: scale(1.15);
}

.trigger-icon {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

/* 控制台登录页 (反面) */
.login-header {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--accent-blue);
    border-bottom: 1px solid rgba(15, 23, 42, 0.05);
    padding-bottom: 15px;
    margin-bottom: 15px;
}

.form-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 20px;
}

/* 输入框高端设计 */
.input-group {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 14px;
    padding: 0 15px;
    height: 52px;
    margin-bottom: 15px;
    transition: var(--transition-smooth);
    box-shadow: inset 0 2px 4px rgba(15, 23, 42, 0.02);
}

.input-group:focus-within {
    border-color: var(--accent-blue);
    box-shadow: 
        0 0 0 4px rgba(59, 130, 246, 0.1),
        inset 0 2px 4px rgba(15, 23, 42, 0.02);
}

.input-prefix {
    color: var(--accent-blue);
    font-family: var(--font-mono);
    font-weight: bold;
    margin-right: 10px;
    font-size: 1.1rem;
}

.input-group input {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1rem;
    width: 100%;
    outline: none;
    font-family: var(--font-mono);
}

.input-group input::placeholder {
    color: var(--text-muted);
}

.error-msg {
    color: var(--accent-red);
    font-size: 0.75rem;
    min-height: 18px;
    margin-bottom: 10px;
    font-family: var(--font-mono);
}

/* 按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 500;
    height: 48px;
    padding: 0 24px;
    cursor: pointer;
    transition: var(--transition-smooth);
    border: none;
    outline: none;
    font-family: var(--font-sans);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    color: white;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.25);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.35);
}

.btn-secondary {
    background: rgba(15, 23, 42, 0.03);
    color: var(--text-secondary);
    border: 1px solid rgba(15, 23, 42, 0.06);
}

.btn-secondary:hover {
    background: rgba(15, 23, 42, 0.06);
    color: var(--text-primary);
}

.btn-outline {
    background: transparent;
    border: 1px solid rgba(15, 23, 42, 0.08);
    color: var(--text-secondary);
}

.btn-outline:hover {
    border-color: var(--text-secondary);
    color: var(--text-primary);
}

.btn-block {
    width: 100%;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: auto;
}

.form-actions .btn {
    flex: 1;
}

/* 认证加载遮罩 */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(248, 250, 252, 0.95);
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition-smooth);
    z-index: 10;
}

.loading-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 2px solid rgba(15, 23, 42, 0.06);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

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

.loading-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-family: var(--font-mono);
}

/* ==========================================================================
   2. 密码主控面板样式 (Vault View)
   ========================================================================== */
#vault-view {
    width: 100vw;
    height: 100vh;
    padding: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition-smooth);
}

#vault-view.active {
    opacity: 1;
    pointer-events: auto;
}

.app-container {
    width: 100%;
    height: 100%;
    max-width: 1400px;
    border-radius: 28px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* 顶部 Header */
.app-header {
    height: 70px;
    min-height: 70px;
    padding: 0 30px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.25);
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-text {
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.08em;
}

.logo-text .divider {
    color: var(--text-muted);
    font-weight: 300;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.session-timer {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.4);
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid rgba(15, 23, 42, 0.06);
}

.btn-icon {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 10px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(15, 23, 42, 0.06);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.85);
    color: var(--text-primary);
}

.btn-icon svg {
    width: 18px;
    height: 18px;
}

.btn-icon.btn-danger:hover {
    background: rgba(244, 63, 94, 0.08);
    border-color: rgba(244, 63, 94, 0.2);
    color: var(--accent-red);
}

/* 主工作区布局 (Sidebar, List, Detail) */
.app-body {
    flex: 1;
    display: flex;
    overflow: hidden;
}

/* 导航侧边栏 (Sidebar) */
.sidebar {
    width: 260px;
    border-right: 1px solid rgba(15, 23, 42, 0.06);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    background: rgba(255, 255, 255, 0.15);
}

.category-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition-smooth);
    border: 1px solid transparent;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.4);
    color: var(--text-primary);
}

.nav-item.active {
    background: rgba(255, 255, 255, 0.8);
    color: var(--accent-blue);
    border: 1px solid rgba(59, 130, 246, 0.12);
    box-shadow: 0 4px 10px rgba(59, 130, 246, 0.02);
}

.nav-item svg {
    width: 18px;
    height: 18px;
}

.nav-item .badge {
    margin-left: auto;
    font-size: 0.75rem;
    font-family: var(--font-mono);
    background: rgba(15, 23, 42, 0.04);
    padding: 2px 8px;
    border-radius: 20px;
    color: var(--text-secondary);
}

.nav-item.active .badge {
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-blue);
}

.sidebar-footer {
    border-top: 1px solid rgba(15, 23, 42, 0.05);
    padding-top: 20px;
}

/* 列表栏 (List Section) */
.list-section {
    width: 360px;
    border-right: 1px solid rgba(15, 23, 42, 0.06);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.08);
}

.search-bar-container {
    padding: 20px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: 12px;
    padding: 0 12px;
    height: 44px;
    position: relative;
}

.search-icon {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    margin-right: 10px;
}

.search-input-wrapper input {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 0.9rem;
    width: 100%;
    outline: none;
}

.search-input-wrapper input::placeholder {
    color: var(--text-muted);
}

.clear-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
}

.clear-btn:hover {
    color: var(--text-primary);
}

.clear-btn svg {
    width: 14px;
    height: 14px;
}

.item-list-container {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* 列表项密码卡片 */
.list-item-card {
    padding: 16px;
    border-radius: 14px;
    border: 1px solid rgba(15, 23, 42, 0.04);
    background: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: var(--transition-smooth);
}

.list-item-card:hover {
    background: rgba(255, 255, 255, 0.7);
    border-color: rgba(15, 23, 42, 0.08);
    transform: translateY(-1px);
}

.list-item-card.selected {
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(59, 130, 246, 0.25);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.02);
}

.item-icon-box {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.03);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: var(--transition-smooth);
}

.list-item-card:hover .item-icon-box {
    background: rgba(15, 23, 42, 0.05);
    color: var(--text-primary);
}

.list-item-card.selected .item-icon-box {
    background: rgba(59, 130, 246, 0.08);
    color: var(--accent-blue);
}

.list-item-card.type-ssh .item-icon-box { color: var(--accent-cyan); }
.list-item-card.type-web .item-icon-box { color: var(--accent-blue); }
.list-item-card.type-app .item-icon-box { color: var(--accent-purple); }
.list-item-card.type-note .item-icon-box { color: var(--text-secondary); }

.item-meta {
    flex: 1;
    min-width: 0;
}

.item-title-text {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.item-subtitle-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    color: var(--text-muted);
    gap: 15px;
    margin: auto;
}

.empty-icon {
    width: 48px;
    height: 48px;
    stroke-width: 1.5;
}

/* 详情栏 (Detail Section) */
.detail-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.02);
}

.detail-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    text-align: center;
    color: var(--text-muted);
    gap: 15px;
    margin: auto;
}

.placeholder-icon {
    width: 60px;
    height: 60px;
    stroke-width: 1.2;
    color: var(--text-muted);
}

.detail-placeholder h3 {
    color: var(--text-secondary);
    font-weight: 500;
    margin-top: 10px;
}

.detail-placeholder p {
    font-size: 0.85rem;
}

/* 详情面板实际内容 */
.detail-wrapper {
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.detail-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 1px solid rgba(15, 23, 42, 0.05);
    padding-bottom: 24px;
}

.detail-info-block {
    display: flex;
    align-items: center;
    gap: 20px;
}

.detail-info-box {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.03);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    border: 1px solid rgba(15, 23, 42, 0.05);
}

.detail-info-box.ssh { color: var(--accent-cyan); background: rgba(6, 182, 212, 0.08); border-color: rgba(6, 182, 212, 0.12); }
.detail-info-box.web { color: var(--accent-blue); background: rgba(59, 130, 246, 0.08); border-color: rgba(59, 130, 246, 0.12); }
.detail-info-box.app { color: var(--accent-purple); background: rgba(139, 92, 246, 0.08); border-color: rgba(139, 92, 246, 0.12); }
.detail-info-box.note { color: var(--text-secondary); background: rgba(15, 23, 42, 0.03); }

.detail-title-group h2 {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.detail-tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-family: var(--font-mono);
    font-weight: 500;
    text-transform: uppercase;
}

.detail-tag.ssh { background: rgba(6, 182, 212, 0.08); color: var(--accent-cyan); }
.detail-tag.web { background: rgba(59, 130, 246, 0.08); color: var(--accent-blue); }
.detail-tag.app { background: rgba(139, 92, 246, 0.08); color: var(--accent-purple); }
.detail-tag.note { background: rgba(15, 23, 42, 0.05); color: var(--text-secondary); }

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

.detail-body {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.detail-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.detail-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* 详情值交互展示组件 */
.detail-value-wrapper {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: 12px;
    padding: 0 16px;
    height: 50px;
    transition: var(--transition-smooth);
}

.detail-value-wrapper:hover {
    border-color: rgba(15, 23, 42, 0.12);
    background: rgba(255, 255, 255, 0.85);
}

.detail-value {
    flex: 1;
    font-size: 0.95rem;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: var(--font-sans);
}

.detail-value.mono {
    font-family: var(--font-mono);
    font-size: 0.9rem;
}

.btn-inline-action {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: var(--transition-smooth);
    margin-left: 6px;
}

.btn-inline-action:hover {
    background: rgba(15, 23, 42, 0.04);
    color: var(--text-primary);
}

.btn-inline-action svg {
    width: 16px;
    height: 16px;
}

/* 专门针对 SSH 链接模块的卡片 */
.ssh-command-box {
    background: rgba(255, 255, 255, 0.8) !important;
    border: 1px dashed rgba(6, 182, 212, 0.3) !important;
}

.ssh-command-box:hover {
    border-color: var(--accent-cyan) !important;
}

.ssh-command-box .detail-value {
    color: var(--accent-cyan);
    font-weight: 500;
}

/* 备注展示框 */
.note-display-area {
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: 12px;
    padding: 16px;
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-primary);
    white-space: pre-wrap;
    min-height: 120px;
    word-break: break-all;
}

/* ==========================================================================
   3. 模态对话框 (Modal Overlay & Container)
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.18);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 150;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition-smooth);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-container {
    width: 500px;
    max-width: 90vw;
    padding: 24px;
    position: relative;
    transform: translateY(20px);
    transition: var(--transition-smooth);
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid var(--panel-border);
    box-shadow: 
        0 25px 50px -12px rgba(15, 23, 42, 0.1),
        0 10px 20px -5px rgba(15, 23, 42, 0.04);
}

.modal-overlay.active .modal-container {
    transform: translateY(0);
}

.max-w-sm {
    width: 400px;
}

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

.modal-close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
}

.modal-close-btn:hover {
    color: var(--text-primary);
}

.modal-close-btn svg {
    width: 18px;
    height: 18px;
}

.form-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.form-row label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.form-control {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 0.9rem;
    height: 44px;
    padding: 0 12px;
    outline: none;
    width: 100%;
    font-family: var(--font-sans);
    transition: var(--transition-smooth);
}

.form-control:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'></polyline></svg>");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 36px;
}

.text-area {
    height: auto;
    padding: 12px;
    resize: vertical;
}

.form-row-group {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.form-row-group .form-row {
    margin-bottom: 0;
}

.flex-1 { flex: 1; }
.flex-port { width: 100px; }

.input-action-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-action-wrapper .form-control {
    padding-right: 76px;
}

.btn-input-action {
    position: absolute;
    right: 6px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: var(--transition-smooth);
}

.btn-input-action:hover {
    background: rgba(15, 23, 42, 0.04);
    color: var(--text-primary);
}

.btn-input-action svg {
    width: 16px;
    height: 16px;
}

#modal-pwd-generate-btn {
    right: 38px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    border-top: 1px solid rgba(15, 23, 42, 0.05);
    padding-top: 20px;
    margin-top: 24px;
}

/* ==========================================================================
   4. 密码生成器控制模块
   ========================================================================== */
.generator-result {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
    justify-content: space-between;
}

.generated-pwd-text {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    color: var(--accent-purple);
    word-break: break-all;
    overflow-x: auto;
}

.strength-bar-wrapper {
    height: 6px;
    background: rgba(15, 23, 42, 0.04);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
}

.strength-bar {
    height: 100%;
    width: 0;
    transition: var(--transition-smooth);
    border-radius: 3px;
}

.strength-bar.weak { background-color: var(--accent-red); width: 33%; }
.strength-bar.medium { background-color: #f59e0b; width: 66%; }
.strength-bar.strong { background-color: var(--accent-green); width: 100%; }

.strength-text {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    text-align: right;
    margin-bottom: 20px;
}

.slider-control {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    background: rgba(15, 23, 42, 0.04);
    border-radius: 3px;
    outline: none;
}

.slider-control::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent-blue);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.3);
    transition: var(--transition-quick);
}

.slider-control::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.flex-between {
    display: flex;
    justify-content: space-between;
    width: 100%;
}

.options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 20px;
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.checkbox-wrapper input[type="checkbox"] {
    appearance: none;
    width: 16px;
    height: 16px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 4px;
    outline: none;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-quick);
}

.checkbox-wrapper input[type="checkbox"]:checked {
    background-color: var(--accent-blue);
    border-color: var(--accent-blue);
}

.checkbox-wrapper input[type="checkbox"]:checked::after {
    content: "✓";
    font-size: 0.65rem;
    color: white;
    font-weight: bold;
}

/* ==========================================================================
   工具样式辅助类
   ========================================================================== */
.hidden { display: none !important; }
.mt-4 { margin-top: 1.5rem !important; }
.px-0 { padding-left: 0 !important; padding-right: 0 !important; }
.pb-0 { padding-bottom: 0 !important; }
.flex-1 { flex: 1; }

/* ==========================================================================
   移动端响应式布局适配 (Mobile & Tablet)
   ========================================================================== */
@media (max-width: 992px) {
    .app-container {
        border-radius: 0;
    }
    
    #vault-view {
        padding: 0;
    }

    .list-section {
        width: 320px;
    }
}

@media (max-width: 768px) {
    .flip-container {
        width: 100%;
        padding: 0 15px;
    }

    .app-body {
        position: relative;
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        border-right: none;
        border-top: 1px solid rgba(15, 23, 42, 0.06);
        padding: 10px 15px;
        flex-direction: row;
        gap: 0;
        justify-content: space-around;
        background: rgba(255, 255, 255, 0.95);
        order: 2;
    }

    .sidebar-add-btn {
        display: none !important;
    }

    .category-nav {
        flex-direction: row;
        width: 100%;
        justify-content: space-around;
        gap: 0;
    }

    .nav-item {
        flex-direction: column;
        gap: 4px;
        padding: 8px 10px;
        font-size: 0.65rem;
        flex: 1;
        align-items: center;
        text-align: center;
    }

    .nav-item svg {
        width: 20px;
        height: 20px;
    }

    .nav-item span:not(.badge) {
        display: block;
    }

    .nav-item .badge {
        position: absolute;
        top: 2px;
        right: 4px;
        font-size: 0.6rem;
        padding: 1px 4px;
    }

    .sidebar-footer {
        display: none !important;
    }

    .list-section {
        width: 100%;
        height: 100%;
        border-right: none;
        flex: 1;
        order: 1;
    }

    .mobile-fab {
        position: fixed;
        right: 20px;
        bottom: 80px;
        width: 56px;
        height: 56px;
        border-radius: 50%;
        background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
        box-shadow: 0 4px 20px rgba(59, 130, 246, 0.3);
        display: flex;
        align-items: center;
        justify-content: center;
        border: none;
        color: white;
        z-index: 90;
        cursor: pointer;
        transition: var(--transition-smooth);
    }
    
    .mobile-fab:active {
        transform: scale(0.9) translateY(2px);
    }

    .detail-section {
        position: absolute;
        top: 0;
        left: 100%;
        width: 100%;
        height: 100%;
        background: #f8fafc;
        z-index: 95;
        transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
        border: none;
    }

    .detail-section.active {
        transform: translateX(-100%);
    }

    .mobile-detail-nav {
        display: flex;
        align-items: center;
        height: 60px;
        padding: 0 15px;
        border-bottom: 1px solid rgba(15, 23, 42, 0.05);
        background: rgba(255, 255, 255, 0.65);
    }

    .mobile-detail-back-btn {
        background: none;
        border: none;
        color: var(--text-secondary);
        display: flex;
        align-items: center;
        gap: 6px;
        font-size: 0.9rem;
        cursor: pointer;
    }

    .detail-wrapper {
        padding: 20px;
    }

    .detail-card-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }

    .detail-actions {
        justify-content: flex-end;
    }
}
