/**
 * 点击速度测试工具样式 - 现代简约版
 */

.pwt-click-speed-test {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
    --primary-color: #3a7bc2;
    --primary-color-dark: #2c5e94;
    --primary-color-light: #eef4fa;
    --primary-color-hover: #4e8ad0;
    --primary-gradient: linear-gradient(135deg, #3a7bc2, #2c5e94);
    --success-color: #4CAF50;
    --success-color-light: #e8f5e9;
    --warning-color: #ff9800;
    --danger-color: #f44336;
    --text-color: #333333;
    --text-light: #666666;
    --text-lighter: #888888;
    --border-color: #e0e0e0;
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --shadow-sm: 0 2px 5px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 5px 15px rgba(46, 105, 175, 0.15);
    --shadow-lg: 0 10px 25px rgba(46, 105, 175, 0.2);
    --transition-speed: 0.25s;
    max-width: 860px;
    margin: 0 auto;
    line-height: 1.6;
    letter-spacing: 0.01em;
    padding: 0 15px;
    background: white;
    border-radius: var(--border-radius);
    color: var(--text-color);
}

/* 模式选择区域 */
.pwt-click-speed-test .pwt-tool-header {
    margin-bottom: 30px;
    text-align: center;
}

.pwt-click-speed-test .pwt-tool-title {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 10px;
    margin-top: 30px;
    color: var(--primary-color-dark);
    position: relative;
    display: inline-block;
}

.pwt-click-speed-test .pwt-tool-description {
    color: var(--text-light);
    font-size: 16px;
    max-width: 600px;
    margin: 0 auto;
}

.pwt-click-speed-test .pwt-mode-selector {
    display: flex;
    justify-content: center;
    margin-bottom: 32px;
    gap: 16px;
    position: relative;
}

.pwt-click-speed-test .pwt-mode-selector:after {
    content: '';
    position: absolute;
    bottom: -16px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: var(--primary-gradient);
    border-radius: 3px;
    opacity: 0.7;
}

.pwt-click-speed-test .pwt-mode-btn {
    padding: 12px 24px;
    border: none;
    background-color: white;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all var(--transition-speed) ease;
    box-shadow: var(--shadow-sm);
    color: var(--text-color);
    min-width: 150px;
    text-align: center;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(58, 123, 194, 0.2);
}

.pwt-click-speed-test .pwt-mode-btn:hover {
    background-color: var(--primary-color-light);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.pwt-click-speed-test .pwt-mode-btn.active {
    background: var(--primary-gradient);
    color: white;
    border: none;
    box-shadow: var(--shadow-md);
}

.pwt-click-speed-test .pwt-mode-btn.pwt-disabled,
.pwt-click-speed-test .pwt-duration-btn.pwt-disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

/* 时长选择区域 */
.pwt-click-speed-test .pwt-duration-selector {
    margin-bottom: 36px;
    padding: 0 15px;
    background-color: rgba(58, 123, 194, 0.03);
    border-radius: var(--border-radius);
    padding: 20px 15px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

.pwt-click-speed-test .pwt-preset-durations {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

.pwt-click-speed-test .pwt-duration-btn {
    padding: 10px 16px;
    border: none;
    background-color: white;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    font-size: 15px;
    min-width: 55px;
    transition: all var(--transition-speed) ease;
    box-shadow: var(--shadow-sm);
    font-weight: 500;
    border: 1px solid rgba(58, 123, 194, 0.1);
}

.pwt-click-speed-test .pwt-duration-btn:hover {
    background-color: var(--primary-color-light);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.pwt-click-speed-test .pwt-duration-btn.active {
    background: var(--primary-gradient);
    color: white;
    border: none;
    box-shadow: var(--shadow-md);
}

.pwt-click-speed-test .pwt-custom-duration {
    display: flex;
    justify-content: center;
    margin-top: 16px;
}

.pwt-click-speed-test #pwt-custom-duration {
    width: 220px;
    padding: 12px 16px;
    border: 1px solid rgba(58, 123, 194, 0.2);
    border-radius: var(--border-radius-sm);
    font-size: 15px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-speed) ease;
    background-color: white;
}

.pwt-click-speed-test #pwt-custom-duration:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(58, 123, 194, 0.2);
}

.pwt-click-speed-test #pwt-custom-duration.error {
    border-color: var(--danger-color);
    background-color: #ffebee;
}

/* 实时数据显示区域 */
.pwt-click-speed-test .pwt-stats-display {
    display: flex;
    justify-content: center;
    margin-bottom: 36px;
    gap: 20px;
    flex-wrap: wrap;
}

.pwt-click-speed-test .pwt-stat-item {
    text-align: center;
    padding: 18px 10px;
    min-width: 120px;
    border: none;
    border-radius: var(--border-radius);
    background: white;
    box-shadow: var(--shadow-md);
    flex: 1;
    max-width: 180px;
    transition: all var(--transition-speed) ease;
    position: relative;
    overflow: hidden;
}

.pwt-click-speed-test .pwt-stat-item:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-gradient);
    opacity: 0.7;
}

.pwt-click-speed-test .pwt-stat-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.pwt-click-speed-test .pwt-stat-label {
    font-size: 15px;
    color: var(--text-light);
    margin-bottom: 10px;
    font-weight: 500;
    letter-spacing: 0.02em;
}

.pwt-click-speed-test .pwt-stat-value {
    font-size: 32px;
    font-weight: bold;
    color: var(--primary-color);
    text-shadow: 0 1px 1px rgba(0,0,0,0.05);
}

/* 点击区域 */
.pwt-click-speed-test .pwt-click-area {
    height: 240px;
    border: none;
    border-radius: var(--border-radius);
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 40px;
    cursor: pointer;
    background: linear-gradient(145deg, #f5f9ff, #edf4fc);
    transition: all var(--transition-speed) ease;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-md), inset 0 2px 3px rgba(255,255,255,0.5);
}

.pwt-click-speed-test .pwt-click-area:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 2px dashed rgba(58, 123, 194, 0.3);
    border-radius: var(--border-radius);
    pointer-events: none;
}

.pwt-click-speed-test .pwt-click-area:hover {
    background: linear-gradient(145deg, #edf4fc, #e5f0fc);
    transform: translateY(-3px) scale(1.01);
    box-shadow: var(--shadow-lg), inset 0 2px 5px rgba(255,255,255,0.5);
}

.pwt-click-speed-test .pwt-click-area.active {
    background: linear-gradient(145deg, #e5f0fc, #d9ebff);
    box-shadow: var(--shadow-lg), inset 0 -2px 10px rgba(58, 123, 194, 0.1);
}

.pwt-click-speed-test .pwt-click-area.active:before {
    border: 2px solid var(--primary-color);
    border-style: solid;
}

/* 水波纹效果 */
.pwt-click-speed-test .pwt-ripple {
    position: absolute;
    border-radius: 50%;
    transform: scale(0);
    background: rgba(58, 123, 194, 0.25);
    animation: pwt-ripple 800ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
    pointer-events: none;
    z-index: 1;
}

@keyframes pwt-ripple {
    0% {
        transform: scale(0);
        opacity: 0.7;
    }
    60% {
        opacity: 0.4;
    }
    100% {
        transform: scale(3);
        opacity: 0;
    }
}

.pwt-click-speed-test .pwt-click-area.space-mode {
    cursor: default;
}

.pwt-click-speed-test .pwt-click-prompt {
    font-size: 22px;
    color: var(--primary-color-dark);
    padding: 24px 30px;
    text-align: center;
    background: rgba(255, 255, 255, 0.9);
    border-radius: var(--border-radius);
    max-width: 75%;
    font-weight: 500;
    backdrop-filter: blur(4px);
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(255, 255, 255, 0.8);
    letter-spacing: 0.02em;
}

.pwt-click-speed-test .pwt-reset-prompt {
    font-size: 20px;
    color: var(--warning-color);
    font-weight: bold;
    animation: pwt-blink 1.2s infinite;
    padding: 18px 30px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(4px);
}

@keyframes pwt-blink {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* 结果区域 */
.pwt-click-speed-test .pwt-result-container {
    text-align: center;
    margin-bottom: 45px;
    padding: 35px 25px;
    border-radius: var(--border-radius);
    background: linear-gradient(145deg, #ffffff, #f9fbff);
    border: none;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.pwt-click-speed-test .pwt-result-container:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: var(--primary-gradient);
}

.pwt-click-speed-test .pwt-result-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 25px;
    color: var(--primary-color-dark);
    position: relative;
    display: inline-block;
    padding-bottom: 12px;
}

.pwt-click-speed-test .pwt-result-title:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 70px;
    height: 3px;
    background: var(--primary-gradient);
    border-radius: 3px;
    opacity: 0.8;
}

.pwt-click-speed-test .pwt-result-cps {
    font-size: 54px;
    font-weight: bold;
    margin: 30px 0;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-fill-color: transparent;
    text-shadow: 0 2px 4px rgba(0,0,0,0.05);
    position: relative;
    display: inline-block;
}

.pwt-click-speed-test .pwt-result-cps:after {
    content: 'CPS';
    position: absolute;
    bottom: -10px;
    right: -15px;
    font-size: 16px;
    font-weight: 500;
    color: var(--text-light);
    -webkit-text-fill-color: var(--text-light);
    text-fill-color: var(--text-light);
    opacity: 0.7;
}

.pwt-click-speed-test .pwt-result-details {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin: 10px auto 10px;
    padding: 0;
    max-width: 600px;
}

.pwt-click-speed-test .pwt-result-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    background: rgba(58, 123, 194, 0.05);
    padding: 12px 20px;
    border-radius: var(--border-radius-sm);
    min-width: 160px;
    box-shadow: var(--shadow-sm);
    flex: 1;
    transition: all var(--transition-speed) ease;
    max-width: 220px;
}

.pwt-click-speed-test .pwt-result-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    background: rgba(58, 123, 194, 0.08);
}

.pwt-click-speed-test .pwt-result-label {
    font-weight: 600;
    color: var(--primary-color-dark);
    font-size: 15px;
}

.pwt-click-speed-test .pwt-result-value {
    color: var(--text-color);
    font-weight: 600;
    font-size: 16px;
}

/* 历史记录区域 */
.pwt-click-speed-test .pwt-history-section {
    margin-top: 50px;
    padding: 0 5px;
    position: relative;
}

.pwt-click-speed-test .pwt-history-section:before {
    content: '';
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 3px;
    background: rgba(58, 123, 194, 0.2);
    border-radius: 3px;
}

.pwt-click-speed-test .pwt-history-title {
    margin-bottom: 24px;
    text-align: center;
    font-size: 22px;
    color: var(--primary-color-dark);
    font-weight: 600;
    position: relative;
    display: inline-block;
    padding-bottom: 10px;
    margin-left: auto;
    margin-right: auto;
    left: 50%;
    transform: translateX(-50%);
}

.pwt-click-speed-test .pwt-history-title:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary-gradient);
    border-radius: 2px;
    opacity: 0.7;
}

.pwt-click-speed-test .pwt-history-table-wrapper {
    margin-bottom: 24px;
    overflow-x: auto;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    max-height: 300px;
    font-size: 14px;
}

.pwt-click-speed-test .pwt-history-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 10px;
    border: none;
    border-radius: var(--border-radius);
    overflow: hidden;
}

.pwt-click-speed-test .pwt-history-table th,
.pwt-click-speed-test .pwt-history-table td {
    padding: 14px 12px;
    text-align: center;
    border-bottom: 1px solid rgba(58, 123, 194, 0.1);
}

.pwt-click-speed-test .pwt-history-table th {
    background: var(--primary-gradient);
    color: white;
    font-weight: 600;
    font-size: 15px;
    position: sticky;
    top: 0;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.pwt-click-speed-test .pwt-history-table tr:last-child td {
    border-bottom: none;
}

.pwt-click-speed-test .pwt-history-table tr:nth-child(even) {
    background-color: rgba(58, 123, 194, 0.03);
}

.pwt-click-speed-test .pwt-history-table tr:hover {
    background-color: rgba(58, 123, 194, 0.08);
}

.pwt-click-speed-test .pwt-clear-history-btn {
    padding: 12px 24px;
    background: linear-gradient(135deg, #f44336, #d32f2f);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    display: block;
    margin: 10px auto 0;
    transition: all var(--transition-speed);
    box-shadow: var(--shadow-sm);
    letter-spacing: 0.02em;
}

.pwt-click-speed-test .pwt-clear-history-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    opacity: 0.95;
}

/* 移动端适配 */
@media screen and (max-width: 768px) {
    .pwt-click-speed-test {
        padding: 0 10px;
    }
    
    .pwt-click-speed-test .pwt-tool-title {
        font-size: 24px;
    }
    
    .pwt-click-speed-test .pwt-tool-description {
        font-size: 15px;
        line-height: 1.5;
    }
    
    .pwt-click-speed-test .pwt-stats-display {
        flex-direction: row;
        gap: 8px;
    }
    
    .pwt-click-speed-test .pwt-stat-item {
        flex: 1;
        min-width: 0;
        padding: 14px 5px;
    }
    
    .pwt-click-speed-test .pwt-stat-value {
        font-size: 26px;
    }
    
    .pwt-click-speed-test .pwt-click-area {
        height: 180px;
    }
    
    .pwt-click-speed-test .pwt-result-details {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 0 10px;
    }
    
    .pwt-click-speed-test .pwt-result-item {
        justify-content: space-between;
        padding: 12px 16px;
    }
    
    .pwt-click-speed-test .pwt-mode-selector,
    .pwt-click-speed-test .pwt-preset-durations {
        flex-wrap: wrap;
        padding: 0 5px;
        gap: 10px;
    }
    
    .pwt-click-speed-test .pwt-mode-btn {
        flex: 1;
        min-width: 120px;
        padding: 12px 5px;
    }
    
    .pwt-click-speed-test .pwt-duration-btn {
        flex: 1;
        min-width: 0;
        padding: 10px 12px;
    }
    
    .pwt-click-speed-test #pwt-custom-duration {
        width: 100%;
        max-width: 260px;
    }
    
    .pwt-click-speed-test .pwt-result-cps {
        font-size: 42px;
        margin: 25px 0;
    }
    
    .pwt-click-speed-test .pwt-click-prompt {
        font-size: 18px;
        padding: 18px;
        max-width: 85%;
    }
    
    .pwt-click-speed-test .pwt-history-table th,
    .pwt-click-speed-test .pwt-history-table td {
        padding: 10px 8px;
        font-size: 14px;
    }
}

/* 超小屏幕适配 */
@media screen and (max-width: 480px) {
    .pwt-click-speed-test .pwt-mode-selector:after {
        bottom: -12px;
        width: 60px;
        height: 2px;
    }
    
    .pwt-click-speed-test .pwt-mode-btn,
    .pwt-click-speed-test .pwt-duration-btn {
        min-width: 0;
        font-size: 14px;
        padding: 10px 8px;
    }
    
    .pwt-click-speed-test .pwt-stats-display {
        gap: 6px;
        margin-bottom: 24px;
    }
    
    .pwt-click-speed-test .pwt-stat-item:before {
        height: 3px;
    }
    
    .pwt-click-speed-test .pwt-stat-label {
        font-size: 13px;
        margin-bottom: 8px;
    }
    
    .pwt-click-speed-test .pwt-stat-value {
        font-size: 22px;
    }
    
    .pwt-click-speed-test .pwt-click-area {
        height: 150px;
        margin-bottom: 30px;
    }
    
    .pwt-click-speed-test .pwt-result-cps {
        font-size: 38px;
    }
    
    .pwt-click-speed-test .pwt-result-cps:after {
        bottom: -8px;
        right: -10px;
        font-size: 14px;
    }
    
    .pwt-click-speed-test .pwt-history-title {
        font-size: 20px;
    }
    
    .pwt-click-speed-test .pwt-clear-history-btn {
        padding: 10px 20px;
    }
}

/* 一些美化的颜色和动画效果 */
@keyframes pwt-subtle-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

.pwt-click-speed-test .pwt-click-area:not(.active):hover .pwt-click-prompt {
    animation: pwt-subtle-pulse 1.5s infinite ease-in-out;
}

/* 动画效果 */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.pwt-click-speed-test .pwt-click-area.clicking {
    animation: pulse 0.2s ease;
}
