/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

h1 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 30px;
    font-size: 2.5em;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.8em;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

/* 表单容器 */
.form-container {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    margin-bottom: 30px;
    transition: transform 0.3s ease;
}

.form-container:hover {
    transform: translateY(-5px);
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    color: #2c3e50;
    font-weight: 500;
}

input[type="text"],
input[type="password"],
input[type="number"],
select {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background-color: white;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
select:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52,152,219,0.2);
    outline: none;
}

select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
}

select:hover {
    border-color: #3498db;
}

/* 按钮样式 */
button {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
    width: 100%;
}

button:hover {
    background: linear-gradient(135deg, #2980b9 0%, #2471a3 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.button {
    display: inline-block;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.button:hover {
    background: linear-gradient(135deg, #2980b9 0%, #2471a3 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* 错误消息 */
.error {
    color: #e74c3c;
    background-color: #fde8e8;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #e74c3c;
}

/* 管理员链接 */
.admin-link {
    text-align: center;
    margin-top: 20px;
}

.admin-link a {
    color: #7f8c8d;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
}

.admin-link a:hover {
    color: #2c3e50;
    text-decoration: underline;
}

/* 表格样式 */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 20px;
    background: white;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    border-radius: 8px;
    overflow: hidden;
}

th, td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

th {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    font-weight: 600;
    color: #2c3e50;
}

tr:hover {
    background-color: #f8f9fa;
}

/* 状态标签 */
.badge {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 500;
}

.bg-success {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    color: white;
}

.bg-secondary {
    background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
    color: white;
}

/* 操作按钮 */
.delete-btn {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    padding: 8px 16px;
    font-size: 14px;
}

.delete-btn:hover {
    background: linear-gradient(135deg, #c0392b 0%, #a93226 100%);
}

.copy-btn {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    padding: 8px 16px;
    font-size: 14px;
    margin-left: 5px;
}

.copy-btn:hover {
    background: linear-gradient(135deg, #27ae60 0%, #219a52 100%);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .form-container {
        padding: 20px;
    }
    
    table {
        display: block;
        overflow-x: auto;
    }
    
    th, td {
        padding: 10px;
    }
    
    button, .button {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .copy-btn {
        margin-left: 0;
    }
}

/* 消息提示 */
.alert {
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    border-radius: 4px;
}

.alert-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

/* 导出表单 */
.export-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.export-form .form-group {
    margin-bottom: 0;
}

.export-form select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: white;
}

.export-form .button {
    width: 100%;
    text-align: center;
}

/* 分组密码列表样式 */
.form-container h3 {
    margin-top: 25px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e6e6e6;
    color: #34495e;
    font-size: 1.4em;
}

.form-container h3:first-of-type {
    margin-top: 0;
}

/* 密码组标题悬停效果 */
.form-container h3:hover {
    border-bottom-color: #3498db;
}

/* 组与组之间的间隔 */
.form-container table {
    margin-bottom: 30px;
}

/* 组内密码数量标记 */
.form-container h3 span.count {
    font-size: 0.8em;
    color: #7f8c8d;
    font-weight: normal;
    margin-left: 10px;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .form-container h3 {
        font-size: 1.2em;
    }
}

/* 密码统计样式 */
.password-stats {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.password-stats div {
    text-align: center;
    font-size: 0.95em;
    color: #555;
}

.password-stats strong {
    display: block;
    font-size: 1.5em;
    color: #2c3e50;
    margin-top: 5px;
}

/* 密码类型导航 */
.password-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 25px;
    padding: 5px 0;
    border-bottom: 1px solid #e6e6e6;
}

.type-link {
    display: inline-block;
    padding: 7px 13px;
    background-color: #f1f1f1;
    border-radius: 20px;
    color: #333;
    text-decoration: none;
    font-size: 0.9em;
    transition: all 0.2s ease;
}

.type-link:hover {
    background-color: #3498db;
    color: white;
}

.type-link .count {
    font-size: 0.85em;
    color: #666;
}

.type-link:hover .count {
    color: rgba(255, 255, 255, 0.8);
}

/* 响应式调整 */
@media (max-width: 768px) {
    .password-stats {
        flex-direction: column;
        gap: 10px;
    }
    
    .password-stats div {
        padding: 5px 0;
        border-bottom: 1px solid #eee;
    }
    
    .password-stats div:last-child {
        border-bottom: none;
    }
    
    .password-nav {
        justify-content: center;
    }
}

/* 页面头部样式 */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    position: relative;
}

.header h1 {
    margin-bottom: 0;
}

/* 退出登录按钮 */
.logout-btn {
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white !important;
    padding: 8px 15px;
    border-radius: 30px;
    text-decoration: none !important;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.logout-btn:hover {
    background: linear-gradient(135deg, #c0392b 0%, #a93226 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.2);
    color: white !important;
    text-decoration: none !important;
}

.logout-icon {
    display: inline-block;
    margin-right: 5px;
    font-weight: bold;
    transform: rotate(90deg);
}

/* 响应式调整 */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 15px;
    }
    
    .logout-btn {
        align-self: flex-end;
    }
}

/* 购买密码按钮 */
.buy-password {
    text-align: center;
    margin: 15px 0;
}

.buy-btn {
    display: inline-block;
    background: linear-gradient(135deg, #f5a623 0%, #f39c12 100%);
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.buy-btn:hover {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.15);
}

/* 输入框提示文字样式 */
input::placeholder {
    color: #aaa;
    font-size: 0.9em;
    font-style: italic;
} 