/* components.css - 组件样式文件 */

/* 按钮样式 */
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 1.5rem;
    border-radius: var(--border-radius-sm);
    font-weight: 500;
    font-size: 1rem;
    transition: all var(--transition-fast);
    border: none;
    outline: none;
    min-width: 120px;
}

.button.primary {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 2px 8px rgba(0, 113, 227, 0.3);
}

.button.primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 113, 227, 0.4);
}

.button.primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 113, 227, 0.3);
}

.button.secondary {
    background-color: rgba(0, 0, 0, 0.05);
    color: var(--text-color);
}

.button.secondary:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

.button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 自定义滑块样式 */
input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.1);
    transition: all var(--transition-fast);
}

input[type="range"]::-webkit-slider-thumb:hover {
    background: var(--primary-hover);
    box-shadow: 0 0 0 6px rgba(0, 113, 227, 0.2);
}

input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border: none;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.1);
    transition: all var(--transition-fast);
}

input[type="range"]::-moz-range-thumb:hover {
    background: var(--primary-hover);
    box-shadow: 0 0 0 6px rgba(0, 113, 227, 0.2);
}

input[type="range"]::-ms-thumb {
    width: 18px;
    height: 18px;
    border: none;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.1);
    transition: all var(--transition-fast);
}

input[type="range"]::-ms-thumb:hover {
    background: var(--primary-hover);
    box-shadow: 0 0 0 6px rgba(0, 113, 227, 0.2);
}

/* 下拉菜单 */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-toggle {
    padding: 0.6rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-radius: var(--border-radius-sm);
    background-color: rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: background-color var(--transition-fast);
}

.dropdown-toggle:hover {
    background-color: rgba(0, 0, 0, 0.08);
}

.dropdown-toggle::after {
    content: '';
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid var(--text-color);
    margin-left: 0.5rem;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 160px;
    z-index: 1000;
    display: none;
    padding: 0.5rem 0;
    margin-top: 0.5rem;
    background-color: var(--background-color);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-md);
}

.dropdown.show .dropdown-menu {
    display: block;
}

.dropdown-item {
    display: block;
    width: 100%;
    padding: 0.6rem 1rem;
    clear: both;
    text-align: inherit;
    white-space: nowrap;
    background-color: transparent;
    border: 0;
    color: var(--text-color);
    transition: background-color var(--transition-fast);
}

.dropdown-item:hover {
    background-color: rgba(0, 0, 0, 0.05);
    color: var(--primary-color);
}

/* 卡片组件 */
.card {
    background-color: var(--background-color);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: box-shadow var(--transition-normal), transform var(--transition-normal);
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.card-header {
    padding: 1.5rem 1.5rem 0.5rem;
}

.card-body {
    padding: 1rem 1.5rem;
}

.card-footer {
    padding: 0.5rem 1.5rem 1.5rem;
    display: flex;
    justify-content: flex-end;
}

/* 提示框组件 */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: var(--background-color);
    color: var(--text-color);
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity var(--transition-normal), transform var(--transition-normal);
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast-success {
    border-left: 4px solid var(--success-color);
}

.toast-error {
    border-left: 4px solid #ff3b30;
}

.toast-icon {
    margin-right: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-content {
    flex: 1;
}

.toast-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    line-height: 1;
    color: var(--light-text);
    cursor: pointer;
    margin-left: 1rem;
}

/* 标签组件 */
.badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    border-radius: 10px;
}

.badge-primary {
    background-color: var(--primary-color);
    color: white;
}

.badge-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.badge-success {
    background-color: var(--success-color);
    color: white;
}

/* 工具提示 */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip-text {
    visibility: hidden;
    width: 120px;
    background-color: var(--text-color);
    color: white;
    text-align: center;
    padding: 0.5rem;
    border-radius: var(--border-radius-sm);
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -60px;
    opacity: 0;
    transition: opacity var(--transition-normal);
    font-size: 0.85rem;
}

.tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: var(--text-color) transparent transparent transparent;
}

.tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
} 