/* 地址管理 - 现代化简洁风格 */

.address-wrapper {
    width: 100%;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

/* 头部 */
.address-header {
    padding: 20px 24px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(to right, #fafafa, #fff);
}

.address-header .title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    position: relative;
    padding-left: 12px;
}

.address-header .title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 16px;
    background: linear-gradient(135deg, #1890ff, #36cfc9);
    border-radius: 2px;
}

.address-header .subtitle {
    font-size: 13px;
    color: #888;
}

/* 区块标题 */
.section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 500;
    color: #333;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f5f5f5;
}

.section-title i {
    font-size: 16px;
    color: #1890ff;
}

.section-title .edit-status,
.section-title .address-count {
    margin-left: auto;
    font-size: 12px;
    color: #999;
    font-weight: normal;
}

.section-title .edit-status {
    padding: 2px 10px;
    background: #e6f7ff;
    color: #1890ff;
    border-radius: 10px;
}

/* 智能识别区域 */
.address-intelligent {
    padding: 24px;
    border-bottom: 1px solid #f0f0f0;
    background: linear-gradient(135deg, #f0faff 0%, #fff 100%);
}

.intelligent-input-wrap {
    display: flex;
    gap: 12px;
}

.intelligent-input {
    flex: 1;
    min-height: 80px;
    padding: 12px 16px;
    border: 1px solid #d9d9d9;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.6;
    resize: vertical;
    outline: none;
    transition: all 0.2s;
    font-family: inherit;
    background: #fff;
}

.intelligent-input:focus {
    border-color: #1890ff;
    box-shadow: 0 0 0 3px rgba(24, 144, 255, 0.1);
}

.intelligent-input::placeholder {
    color: #bbb;
}

.intelligent-btn {
    padding: 0 20px;
    height: 44px;
    background: linear-gradient(135deg, #1890ff, #36cfc9);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.intelligent-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(24, 144, 255, 0.3);
}

.intelligent-btn i {
    font-size: 14px;
}

/* 编辑区域 */
.address-edit {
    padding: 24px;
    border-bottom: 1px solid #f0f0f0;
}

.address-form .form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px 20px;
}

.form-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-item.full-width {
    grid-column: 1 / -1;
}

.form-label {
    font-size: 13px;
    color: #666;
    font-weight: 500;
}

.form-input input,
.form-select-group select {
    width: 100%;
    height: 40px;
    padding: 0 12px;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    font-size: 13px;
    outline: none;
    transition: all 0.2s;
    background: #fff;
    box-sizing: border-box;
}

.form-input input:focus,
.form-select-group select:focus {
    border-color: #1890ff;
    box-shadow: 0 0 0 3px rgba(24, 144, 255, 0.1);
}

.form-input input::placeholder {
    color: #bbb;
}

/* 省市区选择 */
.form-select-group {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.form-select-group select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23999' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
}

/* 开关样式优化 */
.form-item .layui-form-switch {
    margin-top: 4px;
}

/* 按钮区域 */
.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px dashed #f0f0f0;
}

.btn {
    padding: 10px 24px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    outline: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn i {
    font-size: 14px;
}

.btn-primary {
    background: linear-gradient(135deg, #1890ff, #36cfc9);
    color: #fff;
}

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(24, 144, 255, 0.3);
}

.btn-default {
    background: #fff;
    border: 1px solid #d9d9d9;
    color: #666;
}

.btn-default:hover {
    border-color: #1890ff;
    color: #1890ff;
}

.btn-text {
    background: transparent;
    color: #999;
    padding: 10px 16px;
}

.btn-text:hover {
    color: #666;
    background: #f5f5f5;
}

/* 地址列表区域 */
.address-list-section {
    padding: 24px;
}

.address-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

/* 地址卡片 */
.address-card {
    position: relative;
    padding: 20px;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.address-card:hover {
    border-color: #1890ff;
    box-shadow: 0 4px 16px rgba(24, 144, 255, 0.1);
    transform: translateY(-2px);
}

.address-card.active {
    border-color: #1890ff;
    background: linear-gradient(135deg, #f0faff, #fff);
    box-shadow: 0 4px 16px rgba(24, 144, 255, 0.15);
}

.address-card.default::before {
    content: '默认';
    position: absolute;
    top: 0;
    right: 0;
    padding: 4px 12px;
    font-size: 11px;
    font-weight: 500;
    color: #fff;
    background: linear-gradient(135deg, #ff4d4f, #ff7875);
    border-bottom-left-radius: 8px;
    border-top-right-radius: 8px;
}

.address-card .card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.address-card .avatar {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #1890ff, #36cfc9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 16px;
    font-weight: 500;
    flex-shrink: 0;
}

.address-card .info {
    flex: 1;
    min-width: 0;
}

.address-card .name {
    font-size: 15px;
    font-weight: 500;
    color: #333;
    margin-bottom: 4px;
}

.address-card .phone {
    font-size: 13px;
    color: #888;
}

.address-card .address-detail {
    font-size: 13px;
    color: #666;
    line-height: 1.6;
    padding: 12px;
    background: #fafafa;
    border-radius: 6px;
    margin-bottom: 12px;
}

.address-card .address-detail span {
    margin-right: 4px;
}

.address-card .card-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.address-card .card-actions span {
    padding: 6px 14px;
    font-size: 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.address-card .card-actions .edit {
    color: #1890ff;
    background: #e6f7ff;
}

.address-card .card-actions .edit:hover {
    background: #bae7ff;
}

.address-card .card-actions .del {
    color: #ff4d4f;
    background: #fff2f0;
}

.address-card .card-actions .del:hover {
    background: #ffccc7;
}

/* 空状态 */
.address-empty {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #bbb;
    text-align: center;
}

.address-empty.show {
    display: flex;
}

.address-empty i {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.4;
}

.address-empty p {
    font-size: 15px;
    margin-bottom: 8px;
}

.address-empty span {
    font-size: 13px;
    color: #ccc;
}

/* 兼容旧样式 - 确保原有JS能正常工作 */
.address-list .address {
    display: none;
}

/* Layui 表单兼容 */
.layui-form-item {
    margin-bottom: 0;
}

.layui-form-label {
    display: none;
}

.layui-input-block {
    margin-left: 0;
    min-height: auto;
}

.layui-form-switch {
    margin-top: 0;
}

/* 响应式 */
@media (max-width: 768px) {
    .address-form .form-grid {
        grid-template-columns: 1fr;
    }

    .form-select-group {
        grid-template-columns: 1fr;
    }

    .intelligent-input-wrap {
        flex-direction: column;
    }

    .intelligent-btn {
        width: 100%;
        justify-content: center;
    }

    .address-list {
        grid-template-columns: 1fr;
    }

    .form-actions {
        flex-wrap: wrap;
    }

    .btn {
        flex: 1;
        justify-content: center;
    }
}
