/* 通用变量 */
:root {
    --apple-blur: saturate(180%) blur(20px);
    --modal-background: rgba(255, 255, 255, 0.72);
    --toast-background: rgba(29, 29, 31, 0.72);
    --toast-success: rgba(52, 199, 89, 0.72);  /* Apple System Green */
    --toast-error: rgba(255, 59, 48, 0.72);    /* Apple System Red */
    --dialog-background: rgba(255, 255, 255, 0.9);
    --apple-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

/* 模态对话框样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    width: 90%;
    max-width: 480px;
    transform: scale(0.95);
    opacity: 0;
    transition: all 0.3s ease;
}

.modal-overlay.show .modal-container {
    transform: scale(1);
    opacity: 1;
}

.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.modal-title {
    font-size: 1.125rem;
    font-weight: 500;
    color: var(--text-color);
    margin: 0;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* 表单控件样式 */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.form-control {
    width: 100%;
    height: 36px;
    padding: 0 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

/* 为 textarea 添加特定样式 */
.form-control[rows] {
    height: auto;
    min-height: 100px;
    padding: 12px;
    line-height: 1.5;
    resize: vertical;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 102, 204, 0.1);
}

/* 按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    padding: 0 16px;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary {
    background-color: rgba(0, 0, 0, 0.05);
    color: var(--text-color);
}

.btn-secondary:hover {
    background-color: rgba(0, 0, 0, 0.08);
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-color-dark);
}

.btn-danger {
    background-color: var(--color-danger);
    color: white;
}

.btn-danger:hover {
    background-color: #d63030;
}

/* 禁用状态 */
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Toast 通知 */
.toast-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10001;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.toast {
    background: var(--toast-background);
    color: white;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.4;
    margin: 8px 0;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    backdrop-filter: var(--apple-blur);
    -webkit-backdrop-filter: var(--apple-blur);
    box-shadow: var(--apple-shadow);
    text-align: center;
    pointer-events: auto;
    min-width: 200px;
    max-width: 80vw;
    font-weight: 500;
    letter-spacing: -0.01em;
}

.toast.success {
    background: var(--toast-success);
}

.toast.error {
    background: var(--toast-error);
}

.toast.active {
    opacity: 1;
    transform: translateY(0);
}

/* 按钮样式 */
.apple-button {
    background: #0071e3;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 980px;
    font-size: 14px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.3s ease;
}

.apple-button:hover {
    background: #0077ed;
}

.apple-button.secondary {
    background: #e8e8ed;
    color: #1d1d1f;
}

.apple-button.secondary:hover {
    background: #d2d2d7;
}

/* 对话框样式 */
.dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.dialog-overlay.show {
    display: flex;
}

.dialog {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.3s ease;
}

.dialog.show {
    transform: translateY(0);
    opacity: 1;
}

.dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
}

.dialog-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
}

.dialog-close {
    background: none;
    border: none;
    padding: 8px;
    margin: -8px;
    cursor: pointer;
    color: var(--text-color-secondary);
    font-size: 24px;
    line-height: 1;
    transition: all 0.2s ease;
}

.dialog-close:hover {
    color: var(--text-color);
}

.dialog-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    background-color: white;
}

.dialog-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background-color: white;
}

/* 修改按钮样式 */
.dialog-button {
    min-width: 80px;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.dialog-button.primary {
    background-color: #0071e3;
    color: white;
}

.dialog-button.primary:hover {
    background-color: #0077ed;
}

.dialog-button.secondary {
    background-color: var(--background-hover);
    color: var(--text-primary);
}

.dialog-button.secondary:hover {
    background-color: var(--border-color);
} 