@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;500;600&display=swap');

:root {
    --font-family: 'Noto Sans SC', sans-serif;
    --bg-main: #f8f9fa;
    --bg-card: #ffffff;
    --bg-input: #f1f3f5;
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --accent: #0d6efd;
    --accent-hover: #0b5ed7;
    --danger: #dc3545;
    --border-color: #dee2e6;
    --shadow: 0 8px 30px rgba(0,0,0,0.06);
    --strength-weak: #dc3545;
    --strength-medium: #ffc107;
    --strength-strong: #198754;
    --strength-very-strong: #0d6efd;
}

body { font-family: var(--font-family); margin: 0; background-color: var(--bg-main); color: var(--text-primary); }
.hidden { display: none !important; }

/* Lock Screen */
.lock-screen-container { display: flex; justify-content: center; align-items: center; height: 100vh; }
.lock-box { background-color: var(--bg-card); padding: 40px; border-radius: 12px; text-align: center; max-width: 400px; box-shadow: var(--shadow); border: 1px solid var(--border-color); }
#lock-title { margin: 0 0 10px; }
#lock-subtitle { margin: 0 0 30px; color: var(--text-secondary); }
#master-password-input, #master-password-confirm { width: 100%; padding: 12px; margin-bottom: 15px; background: var(--bg-input); border: 1px solid var(--border-color); border-radius: 8px; color: var(--text-primary); font-size: 16px; box-sizing: border-box; }
#master-password-submit { width: 100%; padding: 12px; background: var(--accent); border: none; border-radius: 8px; color: #fff; font-weight: 600; cursor: pointer; transition: background-color 0.2s; }
#master-password-submit:hover { background-color: var(--accent-hover); }
.error-message { color: var(--danger); min-height: 20px; font-size: 14px; }
.security-note { font-size: 12px; color: var(--text-secondary); margin-top: 20px; }

/* App Layout */
.app-container { max-width: 1200px; margin: 0 auto; padding: 30px; }
.app-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; }
.app-header h1 { margin: 0; }
.header-btn { background: var(--bg-card); border: 1px solid var(--border-color); color: var(--text-secondary); padding: 8px 15px; border-radius: 6px; cursor: pointer; margin-left: 10px; transition: all 0.2s; }
.header-btn:hover { background-color: #f1f3f5; color: var(--text-primary); }
.header-btn.danger { border-color: var(--danger); color: var(--danger); }
.main-content { display: grid; grid-template-columns: 1fr 1.5fr; gap: 30px; }
.card { background: var(--bg-card); padding: 25px; border-radius: 12px; box-shadow: var(--shadow); border: 1px solid var(--border-color); }
.card h2 { margin-top: 0; }

/* Generator Section */
.generated-password-wrapper { display: flex; margin-bottom: 10px; }
#generated-password-output { flex-grow: 1; padding: 12px; background: var(--bg-input); border: 1px solid var(--border-color); color: var(--text-primary); font-size: 18px; border-radius: 8px 0 0 8px; }
#copy-password-btn, #regenerate-btn { width: 45px; border: none; background-color: var(--bg-input); background-repeat: no-repeat; background-position: center; cursor: pointer; border-top: 1px solid var(--border-color); border-bottom: 1px solid var(--border-color); }
#copy-password-btn { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%236c757d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='9' y='9' width='13' height='13' rx='2' ry='2'%3E%3C/rect%3E%3Cpath d='M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1'%3E%3C/path%3E%3C/svg%3E"); }
#regenerate-btn { border-right: 1px solid var(--border-color); border-radius: 0 8px 8px 0; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%236c757d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='23 4 23 10 17 10'%3E%3C/polyline%3E%3Cpath d='M20.49 15a9 9 0 1 1-2.12-9.36L23 10'%3E%3C/path%3E%3C/svg%3E"); }

.strength-meter { background: var(--bg-input); height: 5px; border-radius: 5px; margin-bottom: 25px; overflow: hidden; }
.strength-bar { height: 100%; border-radius: 5px; width: 0%; transition: width 0.3s, background-color 0.3s; }
.options .option { margin-bottom: 20px; }
.options label { color: var(--text-secondary); }
#length-slider { width: 100%; cursor: pointer; }
.option-group { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.checkbox-label { display: flex; align-items: center; cursor: pointer; color: var(--text-secondary); }
.checkbox-label input { margin-right: 8px; }

.save-entry-form { margin-top: 20px; border-top: 1px solid var(--border-color); padding-top: 20px; }
#entry-website, #entry-username { width: 100%; padding: 10px; background: var(--bg-input); border: 1px solid var(--border-color); border-radius: 6px; margin-bottom: 10px; box-sizing: border-box; }
#save-entry-btn { width: 100%; padding: 10px; background: var(--accent); border: none; border-radius: 6px; color: #fff; font-weight: 600; cursor: pointer; }
#save-entry-btn:hover { background-color: var(--accent-hover); }

/* Vault Section */
#search-vault-input { width: 100%; padding: 10px; background: var(--bg-input); border: 1px solid var(--border-color); border-radius: 6px; box-sizing: border-box; margin-bottom: 20px; }
#vault-list { list-style: none; padding: 0; margin: 0; max-height: 400px; overflow-y: auto; }
.vault-item { background: var(--bg-input); padding: 15px; border-radius: 8px; margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; }
.vault-item-details { display: flex; flex-direction: column; overflow: hidden; }
.item-website { font-weight: 600; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-username { font-size: 14px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vault-item-actions { display: flex; flex-shrink: 0; }
.vault-item-actions button {
    border: none;
    cursor: pointer;
    width: 24px;
    height: 24px;
    background-repeat: no-repeat;
    background-position: center;
    margin-left: 10px;
    background-color: transparent; /* 使用 background-color 替代 background */
}
.copy-user-btn { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%236c757d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2'%3E%3C/path%3E%3Ccircle cx='8.5' cy='7' r='4'%3E%3C/circle%3E%3Cpath d='M20 8v6'%3E%3C/path%3E%3Cpath d='M23 11h-6'%3E%3C/path%3E%3C/svg%3E") }
.copy-pass-btn { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%236c757d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='9' y='9' width='13' height='13' rx='2' ry='2'%3E%3C/rect%3E%3Cpath d='M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1'%3E%3C/path%3E%3C/svg%3E") }
.toggle-vis-btn { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%236c757d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z'%3E%3C/path%3E%3Ccircle cx='12' cy='12' r='3'%3E%3C/circle%3E%3C/svg%3E") }
.delete-item-btn { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23dc3545' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='3 6 5 6 21 6'%3E%3C/polyline%3E%3Cpath d='M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2'%3E%3C/path%3E%3C/svg%3E") }

.license-footer { text-align: center; padding: 20px; font-size: 12px; }
.license-footer a { color: #aaa; text-decoration: none; }