/* 全局样式 */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #eef1f6; /* 更柔和的背景色 */
    margin: 0;
    padding: 20px;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 760px; /* 增加宽度以容纳更多内容 */
    margin: 0 auto;
    padding: 25px 35px;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1); /* 更明显的阴影 */
    background-color: #ffffff;
}

h1, h2 {
    color: #2c3e50; /* 深色标题 */
    border-bottom: 1px solid #e0e0e0; /* 更细的分割线 */
    padding-bottom: 15px;
    margin-top: 25px;
    display: flex; /* 让图标和文字对齐 */
    align-items: center;
}

h1 {
    text-align: center;
    margin-bottom: 30px;
    font-size: 2.2em;
    color: #1a1a1a;
}

h1 i, h2 i {
    margin-right: 10px;
    color: #3498db; /* 图标颜色 */
}

/* 卡片效果 */
.card {
    background-color: #fcfcfc; /* 略微发白的背景 */
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    padding: 20px;
    margin-bottom: 25px;
}

/* 表单样式 */
.contact-form input[type="text"],
.contact-form input[type="tel"],
.contact-form input[type="email"] {
    width: calc(100% - 24px); /* 减去 padding 和 border */
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1em;
    transition: border-color 0.3s ease;
}

.contact-form input[type="text"]:focus,
.contact-form input[type="tel"]:focus,
.contact-form input[type="email"]:focus {
    border-color: #3498db;
    outline: none;
}

.contact-form button {
    padding: 12px 20px;
    font-size: 1em;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    background-color: #3498db; /* 蓝色按钮 */
    color: white;
    transition: background-color 0.3s ease;
    margin-right: 10px;
}

.contact-form button:hover {
    background-color: #2980b9;
}

.contact-form button#cancel-edit {
    background-color: #95a5a6; /* 灰色取消按钮 */
}

.contact-form button#cancel-edit:hover {
    background-color: #7f8c8d;
}

.contact-form button i {
    margin-right: 8px;
}

/* 标签输入区域 */
.tags-input {
    margin-bottom: 15px;
    padding: 10px 0;
    border: 1px dashed #e0e0e0; /* 虚线框 */
    border-radius: 6px;
    padding-left: 12px;
}

.tags-input label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #555;
}

.tags-input input[type="checkbox"] {
    margin-right: 5px;
}
.tags-input label[for^="tag-"] { /* 针对checkbox旁边的label */
    margin-right: 15px;
    display: inline-block;
    font-weight: normal;
    cursor: pointer;
}

/* 联系人列表样式 */
#contacts-list {
    list-style: none;
    padding: 0;
}

#contacts-list li {
    display: flex;
    flex-wrap: wrap; /* 允许换行 */
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    transition: background-color 0.2s ease;
}

#contacts-list li:last-child {
    border-bottom: none;
}

#contacts-list li:hover {
    background-color: #f8f8f8;
}

#contacts-list li .contact-main-info {
    flex: 1 1 60%; /* 允许占据多行，优先占据60%宽度 */
    margin-bottom: 10px; /* 如果换行，下方有间距 */
}

#contacts-list li .contact-main-info strong {
    font-size: 1.1em;
    color: #34495e;
    margin-right: 10px;
}

#contacts-list li .contact-main-info span {
    color: #7f8c8d;
}

#contacts-list li .contact-details {
    flex-basis: 100%; /* 细节信息单独占一行 */
    font-size: 0.9em;
    color: #555;
    margin-top: 5px;
}
#contacts-list li .contact-details span {
    display: block; /* 每个细节一行 */
}

#contacts-list li .contact-details .tag {
    display: inline-block;
    background-color: #ecf0f1;
    color: #2c3e50;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    margin-right: 5px;
    margin-top: 5px;
}


#contacts-list li .actions {
    flex: 0 0 auto; /* 不伸缩，不换行 */
    margin-top: 10px; /* 如果主信息换行，按钮也有间距 */
}

#contacts-list li .actions button {
    padding: 8px 12px;
    font-size: 0.9em;
    border-radius: 5px;
    margin-left: 8px;
}

#contacts-list li .actions .edit-btn {
    background-color: #2ecc71; /* 绿色修改按钮 */
    color: white;
}
#contacts-list li .actions .edit-btn:hover {
    background-color: #27ae60;
}

#contacts-list li .actions .delete-btn {
    background-color: #e74c3c; /* 红色删除按钮 */
    color: white;
}
#contacts-list li .actions .delete-btn:hover {
    background-color: #c0392b;
}

/* 过滤器样式 */
.filter-section {
    display: flex;
    gap: 15px; /* 间距 */
    margin-bottom: 25px;
    padding: 15px 20px;
    background-color: #f0f4f8; /* 过滤区域背景 */
    border-radius: 8px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.08); /* 内阴影 */
}

.filter-section input, .filter-section select {
    flex: 1; /* 平分空间 */
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1em;
}

.filter-section select {
    background-color: white;
    appearance: none; /* 移除默认下拉箭头 */
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23007bff%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13%205.4L147.2%20202.7%2018.9%2074.9c-6.6-6.6-17.5-6.6-24.1%200-6.6%206.6-6.6%2017.5%200%2024.1l133%20133c6.6%206.6%2017.5%206.6%2024.1%200l133-133a17.6%2017.6%200%200%0%200%200-24.1-24.1z%22%2F%3E%3C%2Fsvg%3E');
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px;
    padding-right: 30px; /* 防止文本被箭头覆盖 */
}